-
Notifications
You must be signed in to change notification settings - Fork 0
/
newrandom.html
226 lines (220 loc) · 6.76 KB
/
newrandom.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Random Quote Generator</title>
</head>
<body>
<h1>Random Quote Generator</h1>
<div id="quote-container">
<p id="quote"></p>
<p id="author"></p>
</div>
<button onclick="displayRandomQuote()">Generate Random Quote</button>
<script>
// Here's the JavaScript code to display the quotes
const quotes = [
{
quote: "Beware; for I am fearless, and therefore powerful.",
author: "Mary Shelley, Frankenstein"
},
{
quote: "All the darkness in the world cannot extinguish the light of a single candle.",
author: "Saint Francis of Assisi"
},
{
quote: "Beware; for I am fearless, and therefore powerful.",
author: "Mary Shelley, Frankenstein"
},
{
quote: "All the darkness in the world cannot extinguish the light of a single candle.",
author: "Saint Francis of Assisi"
},
{
quote: "The only way to deal with fear is to face it head on.",
author: "Sarah J. Maas, Throne of Glass"
},
{
quote: "It is better to be hated for what you are than to be loved for what you are not.",
author: "Andre Gide, Autumn Leaves"
},
{
quote: "I can resist anything except temptation.",
author: "Oscar Wilde, Lady Windermere's Fan"
},
{
quote: "The man in black fled across the desert, and the gunslinger followed.",
author: "Stephen King, The Gunslinger"
},
{
quote: "We are all in the gutter, but some of us are looking at the stars.",
author: "Oscar Wilde, Lady Windermere's Fan"
},
{
quote: "To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.",
author: "Ralph Waldo Emerson"
},
{
quote: "Not all those who wander are lost.",
author: "J.R.R. Tolkien, The Lord of the Rings"
},
{
quote: "The best way to predict your future is to create it.",
author: "Abraham Lincoln"
},
{
quote: "The only true wisdom is in knowing you know nothing.",
author: "Socrates"
},
{
quote: "There is nothing noble in being superior to your fellow man; true nobility is being superior to your former self.",
author: "Ernest Hemingway"
},
{
quote: "It does not do to dwell on dreams and forget to live.",
author: "J.K. Rowling, Harry Potter and the Philosopher's Stone"
},
{
quote: "Life isn't about finding yourself. Life is about creating yourself.",
author: "George Bernard Shaw"
},
{
quote: "In three words I can sum up everything I've learned about life: it goes on.",
author: "Robert Frost"
},
{
quote: "Success is not final, failure is not fatal: it is the courage to continue that counts.",
author: "Winston Churchill"
},
{
quote: "Love all, trust a few, do wrong to none.",
author: "William Shakespeare, All's Well That Ends Well"
},
{
quote: "A room without books is like a body without a soul.",
author: "Marcus Tullius Cicero"
},
{
quote: "The unexamined life is not worth living.",
author: "Socrates"
},
{
quote: "I have not failed. I've just found 10,000 ways that won't work.",
author: "Thomas Edison"
},
{
quote: "Believe you can and you're halfway there.",
author: "Theodore Roosevelt"
},
{
quote: "To be yourself is all that you can do.",
author: "Chris Cornell"
},// Add the other quotes here
];
function displayRandomQuote() {
const randomQuote = quotes[Math.floor(Math.random() * quotes.length)];
document.getElementById("quote").textContent = `"${randomQuote.quote}"`;
document.getElementById("author").textContent = `- ${randomQuote.author}`;
}
</script>
</body>
</html>
<!--
const quotes = [
{
quote: "Beware; for I am fearless, and therefore powerful.",
author: "Mary Shelley, Frankenstein"
},
{
quote: "All the darkness in the world cannot extinguish the light of a single candle.",
author: "Saint Francis of Assisi"
},
{
quote: "The only way to deal with fear is to face it head on.",
author: "Sarah J. Maas, Throne of Glass"
},
{
quote: "It is better to be hated for what you are than to be loved for what you are not.",
author: "Andre Gide, Autumn Leaves"
},
{
quote: "I can resist anything except temptation.",
author: "Oscar Wilde, Lady Windermere's Fan"
},
{
quote: "The man in black fled across the desert, and the gunslinger followed.",
author: "Stephen King, The Gunslinger"
},
{
quote: "We are all in the gutter, but some of us are looking at the stars.",
author: "Oscar Wilde, Lady Windermere's Fan"
},
{
quote: "To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.",
author: "Ralph Waldo Emerson"
},
{
quote: "Not all those who wander are lost.",
author: "J.R.R. Tolkien, The Lord of the Rings"
},
{
quote: "The best way to predict your future is to create it.",
author: "Abraham Lincoln"
},
{
quote: "The only true wisdom is in knowing you know nothing.",
author: "Socrates"
},
{
quote: "There is nothing noble in being superior to your fellow man; true nobility is being superior to your former self.",
author: "Ernest Hemingway"
},
{
quote: "It does not do to dwell on dreams and forget to live.",
author: "J.K. Rowling, Harry Potter and the Philosopher's Stone"
},
{
quote: "Life isn't about finding yourself. Life is about creating yourself.",
author: "George Bernard Shaw"
},
{
quote: "In three words I can sum up everything I've learned about life: it goes on.",
author: "Robert Frost"
},
{
quote: "Success is not final, failure is not fatal: it is the courage to continue that counts.",
author: "Winston Churchill"
},
{
quote: "Love all, trust a few, do wrong to none.",
author: "William Shakespeare, All's Well That Ends Well"
},
{
quote: "A room without books is like a body without a soul.",
author: "Marcus Tullius Cicero"
},
{
quote: "The unexamined life is not worth living.",
author: "Socrates"
},
{
quote: "I have not failed. I've just found 10,000 ways that won't work.",
author: "Thomas Edison"
},
{
quote: "Believe you can and you're halfway there.",
author: "Theodore Roosevelt"
},
{
quote: "To be yourself is all that you can do.",
author: "Chris Cornell"
},
]
function displayRandomQuote() {
// Get a random quote object from the array
const randomQuote = quotes[Math.floor(Math.random() * quotes.length)];
// Display the quote and author in the HTML
document.getElementById("quote").textContent = `"${randomQuote.quote}"`;
document.getElementById("author").textContent = `- ${randomQuote.author}`;
}
-->