-
Notifications
You must be signed in to change notification settings - Fork 0
/
hallmonitor.html
30 lines (27 loc) · 993 Bytes
/
hallmonitor.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Hall Monitor</title>
</head>
<body>
<button id="fullscreen">Click to open</button>
<button id="random">Randomise colour</button>
<script>
const randomiseColor = () => {
const hue = Math.random() * 360
document.documentElement.style.backgroundColor = `hsl(${hue},100%,50%)`
}
const openButton = document.getElementById('fullscreen')
openButton.addEventListener('click', () => {
document.documentElement.requestFullscreen()
openButton.style.display = 'none'
})
const randomButton = document.getElementById('random')
randomButton.addEventListener('click', randomiseColor)
setInterval(randomiseColor, 1000 * 60 * 60)
</script>
</body>
</html>