File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<!DOCTYPE html>
22< html lang ="en ">
3- < head >
4- < meta charset ="UTF-8 " />
5- < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6- < title > Title here</ title >
7- < script defer src ="quotes.js "> </ script >
8- </ head >
9- < body >
10- < h1 > hello there</ h1 >
11- < p id ="quote "> </ p >
12- < p id ="author "> </ p >
13- < button type ="button " id ="new-quote "> New quote</ button >
14- </ body >
15- </ html >
3+
4+ < head >
5+ < meta charset ="UTF-8 " />
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7+ < title > Quote Generator</ title >
8+ < script defer src ="quotes.js "> </ script >
9+ < link rel ="stylesheet " href ="style.css ">
10+ </ head >
11+
12+ < body >
13+ < div class ="quote-box ">
14+ < h1 > Quote of the Day</ h1 >
15+ < p id ="quote "> "this is the quote"</ p >
16+ < p id ="author "> - Author Name</ p >
17+ </ div >
18+ < button type ="button " id ="new-quote " onclick ="generateQuote() "> New quote</ button >
19+ </ body >
20+
21+ </ html >
Original file line number Diff line number Diff line change 1+ function generateQuote ( ) {
2+ const randomQuote = pickFromArray ( quotes ) ;
3+ document . getElementById ( "quote" ) . textContent = `"${ randomQuote . quote } "` ;
4+ document . getElementById ( "author" ) . textContent = `- ${ randomQuote . author } ` ;
5+ }
6+ generateQuote ( ) ;
7+
18// DO NOT EDIT BELOW HERE
29
310// pickFromArray is a function which will return one item, at
Original file line number Diff line number Diff line change 1- /** Write your CSS in here **/
1+ body {
2+ margin : 0 ;
3+ padding : 0 ;
4+ justify-content : center;
5+ font-family : Arial, sans-serif;
6+ background-color : # d4b4ec;
7+ }
8+
9+ . quote-box {
10+ margin : 50px auto;
11+ width : 80% ;
12+ max-width : 600px ;
13+ padding : 30px ;
14+ text-align : center;
15+ background-color : # fff;
16+ border-radius : 10px ;
17+ box-shadow : 0 4px 8px rgba ( 0 , 0 , 0 , 0.2 ) ;
18+ }
19+
20+ h1 {
21+ margin-bottom : 25px ;
22+ }
23+ # quote {
24+ min-height : 60px ;
25+ margin-bottom : 25px ;
26+ font-size : 1.5em ;
27+ line-height : 1.5 ;
28+ font-style : italic;
29+ }
30+
31+ button {
32+ display : block;
33+ margin : 20px auto;
34+ font-weight : bold;
35+ padding : 12px 20px ;
36+ font-size : 1.5em ;
37+ background-color : rgba ( 96 , 55 , 92 , 0.2 ) ;
38+ color : # 232b2e;
39+ border : none;
40+ cursor : pointer;
41+ box-shadow : 0 4px 8px rgba ( 0 , 0 , 0 , 0.2 ) ;
42+ }
43+
44+ button : hover {
45+ background-color : rgba ( 53 , 31 , 51 , 0.2 ) ;
46+ font-weight : bold;
47+ text-shadow : 0 1px 2px white;
48+ }
You can’t perform that action at this time.
0 commit comments