Skip to content

Commit 876d710

Browse files
authored
Update quotes.js
1 parent 189d29c commit 876d710

File tree

1 file changed

+73
-28
lines changed

1 file changed

+73
-28
lines changed

assets/js/quotes.js

Lines changed: 73 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,73 @@
1-
var poetry = [
2-
3-
'"Fled is that music:—Do I wake or sleep?" -Keats',
4-
5-
'"Heard melodies are sweet, but those unheard are sweeter" -Keats',
6-
7-
'"\'Beauty is Truth, Truth Beauty,\'—that is all ye know on earth, and all ye need to know." -Keats',
8-
9-
'"Love is not love which alters when it alteration finds" -Shakespeare',
10-
11-
'"Water can be boiled in a pot, or if you have no pot, over a fire in your cupped hands." -Jollimore',
12-
13-
'"Is this world other than what I see?" -Adonis',
14-
15-
'"I\'ll tell you what I\'ll inherit: the margins" -Doty',
16-
17-
'"Without thinking at all I was my foolish aunt, I—we—were falling, falling" -Bishop',
18-
19-
'"In this short life That only lasts an hour How much — how little — is thin our power?" -Dickinson',
20-
21-
'"You\'re thinking about this too much. Slow down. Nothing bad will happen." -Prufer',
22-
23-
'"Let us go then, you and I, When the evening is spread out against the sky" -Eliot'
24-
];
25-
26-
var line = poetry[Math.floor(Math.random() * poetry.length)];
27-
28-
document.getElementById("quote").innerHTML = line;
1+
var total_lines = 11;
2+
var random_line = Math.floor(Math.random() * total_lines);
3+
4+
var quote_element = document.getElementById("quote");
5+
var quote_link = document.getElementById("quote-link");
6+
7+
var quote;
8+
var link;
9+
10+
switch (random_line) {
11+
case 1:
12+
quote = '"Fled is that music:—Do I wake or sleep?" -Keats';
13+
link = 'https://www.poetryfoundation.org/poems/44479/ode-to-a-nightingale';
14+
break;
15+
16+
case 2:
17+
quote = '"Heard melodies are sweet, but those unheard are sweeter" -Keats';
18+
link = 'https://www.poetryfoundation.org/poems/44477/ode-on-a-grecian-urn';
19+
break;
20+
21+
case 3:
22+
quote = '"\'Beauty is Truth, Truth Beauty,\'—that is all ye know on earth, and all ye need to know." -Keats';
23+
link = 'https://www.poetryfoundation.org/poems/44477/ode-on-a-grecian-urn';
24+
break;
25+
26+
case 4:
27+
quote = '"Love is not love which alters when it alteration finds" -Shakespeare';
28+
link = 'https://www.poetryfoundation.org/poems/45106/sonnet-116-let-me-not-to-the-marriage-of-true-minds';
29+
break;
30+
31+
case 5:
32+
quote = '"Water can be boiled in a pot, or if you have no pot, over a fire in your cupped hands." -Jollimore';
33+
link = 'https://www.troyjollimore.com/';
34+
break;
35+
36+
case 6:
37+
quote = '"Is this world other than what I see?" -Adonis';
38+
link = 'https://www.poetryfoundation.org/poets/adonis';
39+
break;
40+
41+
case 7:
42+
quote = '"I\'ll tell you what I\'ll inherit: the margins" -Doty';
43+
link = 'https://www.poetryfoundation.org/poems/44139/homo-will-not-inherit';
44+
break;
45+
46+
case 8:
47+
quote = '"Without thinking at all I was my foolish aunt, I—we—were falling, falling" -Bishop';
48+
link = 'https://poets.org/poem/waiting-room';
49+
break;
50+
51+
case 9:
52+
quote = '"In this short life That only lasts an hour How much — how little — is within our power?" -Dickinson';
53+
link = 'https://www.poetryfoundation.org/poems/56456/in-this-short-life-that-only-lasts-an-hour-1292';
54+
break;
55+
56+
case 10:
57+
quote = '"You\'re thinking about this too much. Slow down. Nothing bad will happen." -Prufer';
58+
link = 'https://www.poetryfoundation.org/poetrymagazine/poems/52972/in-a-beautiful-country';
59+
break;
60+
61+
case 11:
62+
quote = '"Let us go then, you and I, When the evening is spread out against the sky" -Eliot';
63+
link = 'https://www.poetryfoundation.org/poetrymagazine/poems/44212/the-love-song-of-j-alfred-prufrock';
64+
break;
65+
66+
default:
67+
quote = '"Fled is that music:—Do I wake or sleep?" -Keats';
68+
link = 'https://www.poetryfoundation.org/poems/44479/ode-to-a-nightingale';
69+
break;
70+
}
71+
72+
quote_element.innerHTML = quote;
73+
quote_link.setAttribute('href', link);

0 commit comments

Comments
 (0)