forked from CSE110-FA22/Lab10_Starter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
83 lines (76 loc) · 2.96 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-4QZ4RLKY3F"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-4QZ4RLKY3F');
</script>
<!-- Google Tag Manager -->
<script>(function (w, d, s, l, i) {
w[l] = w[l] || []; w[l].push({
'gtm.start':
new Date().getTime(), event: 'gtm.js'
}); var f = d.getElementsByTagName(s)[0],
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-MF4KG9CT');</script>
<!-- End Google Tag Manager -->
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<title>Lab 10 - Return of the Party Horn</title>
<!-- JS Confetti -->
<script src="assets/scripts/js-confetti.browser.js"></script>
<!-- Main Stylesheet & Scripts -->
<link rel="stylesheet" href="assets/styles/global.css" />
<script src="assets/scripts/partyHorn.js" type="module"></script>
</head>
<body>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MF4KG9CT" height="0" width="0"
style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<header>
<nav>
<a href="speechSynth.html" title="Go to speech synthesizer">Speech Synthesizer</a>
</nav>
</header>
<main>
<section id="expose">
<header>
<h2>Return of the Party Horn</h2>
</header>
<img src="assets/images/no-image.png" alt="No image selected" />
<select name="horn" id="horn-select">
<option value="select" disabled selected>Select Horn:</option>
<option value="air-horn">Air Horn</option>
<option value="car-horn">Car Horn</option>
<option value="party-horn">Party Horn</option>
</select>
<div id="volume-controls">
<input type="range" name="volume" id="volume" value="50" min="0" max="100" step="1" />
<img src="assets/icons/volume-level-2.svg" alt="Volume level 2" />
</div>
<button>Play Sound</button>
<audio class="hidden" src=""></audio>
</section>
</main>
<script>
// Generate a random number between 0 and 1
const randomNumber = Math.random();
// Determine if the class should be applied
const shouldApplyClass = randomNumber < 0.5;
// Get the body element
let body = document.querySelector('body');
// Apply or remove the "blue" class based on the random number
if (shouldApplyClass) {
body.classList.add('blue');
}
</script>
</body>
</html>