-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
47 lines (46 loc) · 2.2 KB
/
index.html
File metadata and controls
47 lines (46 loc) · 2.2 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Quote Machine</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script>
window.onload = loadQuote;
function loadQuote() {
generateQuote();
}
function generateQuote() {
let randomQuote = quoteBank[Math.floor(Math.random() * quoteBank.length)];
document.getElementById("text").innerText = '"' + randomQuote.quote + '"' ;
document.getElementById("author").innerText = "-" + randomQuote.author;
}
</script>
</head>
<body>
<div class="container">
<div class="row py-3">
<div class="col-md-8 offset-md-2">
<div class="card">
<h5 class="card-header text-center">Random Quote Generator</h5>
<div id="quote-box" class="card-body">
<div class="row justify-content-center">
<div id="text" class="row"></div>
<div id="author" class="row"></div>
</div>
<div class="d-grid gap-2 col-6 mx-auto">
<button id="new-quote" class="row btn btn-secondary" onclick="generateQuote()">New Quote</button>
<a id="tweet-quote" class="row btn btn-primary" href="twitter.com/intent/tweet">Tweet Quote</a>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<script src="quotes.js"></script>
<script src="main.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
</body>
</html>