-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
50 lines (41 loc) · 1.35 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
<!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>Giphy Viewer</title>
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Ranchers&display=swap" rel="stylesheet">
</head>
<body>
<h1 class="title">Howdy, Partner! 🤠</h1>
<div class="container">
<img src="cowboylasso.jpg" id="giphyImage" alt="Giphy Image" />
<div id="countdown" style="font-size: 3rem; text-align: center;"></div>
</div>
<script>
let countdownValue = 5;
const countdownElement = document.getElementById('countdown');
const giphyImage = document.getElementById('giphyImage');
function updateCountdown() {
countdownElement.innerText = `Wrangling in... ${countdownValue}`;
countdownValue--;
if (countdownValue < 0) {
clearInterval(countdownInterval);
countdownElement.style.display = 'none';
giphyImage.style.display = 'block';
fetchGiphy();
}
}
const countdownInterval = setInterval(updateCountdown, 1000);
function fetchGiphy() {
fetch('/giphy')
.then(response => response.json())
.then(data => {
giphyImage.src = data.imageUrl;
});
}
</script>
</body>
</html>