File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33 < head >
44 < meta charset ="UTF-8 " />
55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6- < title > Title here</ title >
7- < script defer src ="quotes.js "> </ script >
6+ < title > Quote generator app</ title >
7+
8+ < link rel ="stylesheet " href ="style.css " />
9+
10+ < script src ="quotes.js "> </ script >
811 </ head >
912 < body >
1013 < h1 > hello there</ h1 >
Original file line number Diff line number Diff line change @@ -491,3 +491,18 @@ const quotes = [
491491] ;
492492
493493// call pickFromArray with the quotes array to check you get a random quote
494+
495+ const quoteElement = document . querySelector ( "#quote" ) ;
496+ const authorElement = document . querySelector ( "#author" ) ;
497+ const newQuoteButton = document . querySelector ( "#new-quote" ) ;
498+
499+ function displayRandomQuote ( ) {
500+ const randomQuote = pickFromArray ( quotes ) ;
501+
502+ quoteElement . textContent = randomQuote . quote ;
503+ authorElement . textContent = randomQuote . author ;
504+ }
505+
506+ displayRandomQuote ( ) ;
507+
508+ newQuoteButton . addEventListener ( "click" , displayRandomQuote ) ;
Original file line number Diff line number Diff line change 1- /** Write your CSS in here **/
1+ body {
2+ background-color : white;
3+ font-family : Arial, sans-serif;
4+ display : flex;
5+ justify-content : center;
6+ align-items : center;
7+ min-height : 100vh ;
8+ }
9+
10+
11+ . outer-container {
12+ background-color : orange;
13+ padding : 30px ;
14+ text-align : center;
15+ }
16+
17+
18+ . quote-box {
19+ background-color : white;
20+ color : orange;
21+ padding : 40px ;
22+ width : 400px ;
23+ margin-bottom : 20px ;
24+ }
25+
26+
27+ # quote {
28+ font-size : 24px ;
29+ font-weight : bold;
30+ }
31+
32+
33+ # author {
34+ font-size : 18px ;
35+ font-style : italic;
36+ }
37+
38+
39+ # new-quote {
40+ background-color : orange;
41+ color : white;
42+ border : none;
43+ padding : 15px 30px ;
44+ font-size : 18px ;
45+ cursor : pointer;
46+ }
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments