Skip to content

Commit d275d24

Browse files
committed
Project almost finished - some bugs need to solve
1 parent 0bc9f05 commit d275d24

3 files changed

Lines changed: 30 additions & 20 deletions

File tree

‎Week1/project/index.css‎

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
margin: 0;
33
padding: 0;
44
box-sizing: border-box;
5+
/* font-family: Georgia, serif; */
56
}
67
body {
78
background-color: #ffa500;
89

910
}
1011

1112
.container {
12-
/* display: flex; */
13+
display: flex;
1314
width: 70vw;
1415
height: 50vh;
1516
margin-left: 30px;
@@ -25,26 +26,26 @@ body {
2526
top: 10vh;
2627
left: 5vw;
2728
margin-right: 30px;
28-
29-
3029

3130
}
3231

32+
3333
button {
3434
color: white;
3535
background-color: #ffa500;
3636
font-size: 20px;
3737
position: absolute;
3838
right: 50px;
3939
bottom: 50px;
40-
padding: 10px;
40+
padding: 15px;
4141
width: 150px;
4242
margin-right: 40px;
43+
border: none;
44+
font-family: Georgia, serif;
45+
4346

4447

4548
}
46-
/* button:focus {outline: none;} */
47-
4849
.social {
4950
position: absolute;
5051
bottom:50px;
@@ -56,7 +57,7 @@ button {
5657
width: 50px;
5758
text-align: center;
5859
text-decoration: none;
59-
/* align-self: flex-end; */
60+
6061

6162

6263

@@ -83,7 +84,8 @@ blockquote {
8384
margin: 0.5em;
8485
padding: 0.5em 2em 0.5em 3em;
8586
}
86-
/* Thanks: http://callmenick.com/post/styling-blockquotes-with-css-pseudo-classes */
87+
88+
8789
blockquote:before {
8890
font-family: Georgia, serif;
8991
position: absolute;
@@ -93,21 +95,13 @@ blockquote:before {
9395
left: 0;
9496
content: "\201C";
9597
}
96-
blockquote:after {
97-
font-family: Georgia, serif;
98-
position: absolute;
99-
/* display: block; don't use this, it raised the quote too high from the bottom - defeated line-height? */
100-
float:right;
101-
font-size:6em;
102-
line-height: 1;
103-
right:0;
104-
bottom:-0.5em;
105-
/* content: "\201D"; */
106-
}
98+
99+
107100
blockquote footer {
108101
padding: 0 2em 0 0;
109102
text-align:right;
110103
}
104+
111105
blockquote cite:before {
112106
content: "\2013";
113107
}

‎Week1/project/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<body>
1111
<div class="container">
1212
<blockquote class="quote">
13-
Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut, quod?
13+
<p class="Sentence">Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut, quod?</p>
1414
<footer>
1515
<cite>
1616
Someone famouse

‎Week1/project/index.js‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,19 @@ const quotes = [
2727
]
2828

2929

30+
31+
32+
function readQuotes(){
33+
const quoteSentence = document.querySelector('blockquote p');
34+
const quoteAuthor = document.querySelector('cite');
35+
const randomQuote = quotes[Math.floor(Math.random() * quotes.length)];
36+
const randomEl = Object.values(randomQuote)
37+
quoteSentence.textContent = randomEl[0];
38+
quoteAuthor.textContent = randomEl[1];
39+
40+
41+
};
42+
43+
const button = document.querySelector('button')
44+
button.addEventListener('click', readQuotes);
45+

0 commit comments

Comments
 (0)