File tree 3 files changed +133
-2
lines changed 3 files changed +133
-2
lines changed Original file line number Diff line number Diff line change
1
+ body {
2
+ background-color : orange;
3
+ }
4
+ .container {
5
+ text-align : center;
6
+ display : flex;
7
+ flex-direction : column;
8
+ align-items : center;
9
+ margin : 5% 15% ;
10
+ }
11
+ .quote-generator {
12
+ display : flex;
13
+ flex-direction : column;
14
+ background-color : # ffffff ;
15
+ width : 100% ;
16
+ }
17
+ .quote {
18
+ margin : 10% 10% 5% 10% ;
19
+ line-height : 1.5em ;
20
+ font-size : xx-large;
21
+ font-weight : bold;
22
+ color : orange;
23
+ }
24
+ .fa-quote-left {
25
+ float : left;
26
+ }
27
+ # author {
28
+ text-align : right;
29
+ font-size : x-large;
30
+ font-weight : bold;
31
+ padding : 0% 10% ;
32
+ color : orange;
33
+ }
34
+ .tools {
35
+ display : flex;
36
+ justify-content : space-between;
37
+ margin : 3% 10% 8% 10% ;
38
+ }
39
+ .fa-twitter , .fa-tumblr {
40
+ background-color : orange;
41
+ color : # ffffff ;
42
+ padding : 15px ;
43
+ }
44
+ {
45
+ margin-left : 5px ;
46
+ }
47
+ .quote-changer {
48
+ background-color : orange;
49
+ outline : none;
50
+ border : none;
51
+ color : # ffffff ;
52
+ font-weight : bold;
53
+ font-size : large;
54
+ padding : 0% 3% ;
55
+ }
56
+ .empty {
57
+ background-color : # ffffff ;
58
+ width : 40% ;
59
+ height : 75px ;
60
+ margin-top : 0.5% ;
61
+ }
Original file line number Diff line number Diff line change 1
- <!-- Your code goes in here -->
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="UTF-8 " />
5
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
6
+ < title > Document</ title >
7
+ < link rel ="stylesheet " href ="index.css " />
8
+ < link
9
+ rel ="stylesheet "
10
+ href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css "
11
+ />
12
+ </ head >
13
+ < body >
14
+ < div class ="container ">
15
+ < div class ="quote-generator ">
16
+ < p class ="quote ">
17
+ < i class ="fa fa-quote-left " aria-hidden ="true "> </ i >
18
+ < span id ="sentence "> Don't cry because it's over, smile because it happened.</ span >
19
+ </ p >
20
+ < span id ="author "> - Dr. Seuss</ span >
21
+ < div class ="tools ">
22
+ < div class ="icons ">
23
+ < a href ="# "> < i class ="fa fa-twitter "> </ i > </ a >
24
+ < a href ="# "> < i class ="fa fa-tumblr "> </ i > </ a >
25
+ </ div >
26
+ < button class ="quote-changer " type ="button "> New quote</ button >
27
+ </ div >
28
+ </ div >
29
+ < div class ="empty "> </ div >
30
+ </ div >
31
+ < script src ="index.js "> </ script >
32
+ </ body >
33
+ </ html >
Original file line number Diff line number Diff line change 1
- // your code goes in here
1
+ 'use strict' ;
2
+
3
+ const quotes = [
4
+ {
5
+ quote : "Peace at home, peace on the world." ,
6
+ author : "- M.K. Ataturk"
7
+ } ,
8
+ {
9
+ quote : "Honesty is an expensive gift, don't expect it from cheap people." ,
10
+ author : "- Warren Buffett"
11
+ } ,
12
+ {
13
+ quote : "Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma – which is living with the results of other people's thinking." ,
14
+ author : "- Steve Jobs"
15
+ } ,
16
+ {
17
+ quote : "Look at the world through the eyes of the people you're speaking to." ,
18
+ author : "- Frank Caprio"
19
+ } ,
20
+ {
21
+ quote : "Whoever has taught me one letter has made me his slave." ,
22
+ author : "- Hz. Ali"
23
+ } ,
24
+ {
25
+ quote : "Simplicity is the key to brilliance." ,
26
+ author : "- Bruce Lee"
27
+ }
28
+ ] ;
29
+
30
+ const quoteChanger = document . querySelector ( 'button' ) ;
31
+ quoteChanger . addEventListener ( 'click' , function ( ) {
32
+ let randomQuote = Math . floor ( Math . random ( ) * quotes . length ) ;
33
+
34
+ const newQuote = document . querySelector ( '#sentence' ) ;
35
+ newQuote . innerText = quotes [ randomQuote ] . quote ;
36
+
37
+ const newAuthor = document . querySelector ( '#author' ) ;
38
+ newAuthor . innerText = quotes [ randomQuote ] . author ;
39
+ } )
You can’t perform that action at this time.
0 commit comments