-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLevels.html
64 lines (51 loc) · 2.22 KB
/
Levels.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="styles.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hangman</title>
</head>
<body style="background-color: black">
<div class="video-container">
<video autoplay loop muted>
<source src="Bats.mp4" type="video/mp4">
</video>
</div>
<section>
<button id="btn1" class="btn1" value="easy">Beginner</button>
<button id="btn2" class="btn2" value="medium">Intermediate</button>
<button id="btn3" class="btn3" value="hard">Expert</button>
<div class="container">
<h1 id="main2" style="color: beige">HANGMAN</h1>
</div>
<img class="hat" src="images/hat.png" width="100" height="80" alt="Hat">
<img id="broom" src="images/witch.png" alt="Broom">
</section>
<script >
var easybtn = document.getElementById("btn1");
var mediumbtn = document.getElementById("btn2");
var Hardbtn = document.getElementById("btn3");
var difficulty="";
var url ="";
easybtn.addEventListener('click', function(event){
difficulty = event.target.value.toLowerCase();
// url = `https://opentdb.com/api.php?amount=10&category=18&difficulty=${difficulty}&type=multiple`
url = `main.html?difficulty=${difficulty}`;
window.location.href = url;
})
mediumbtn.addEventListener('click',function(event){
difficulty = event.target.value.toLowerCase();
// url = `https://opentdb.com/api.php?amount=10&category=18&difficulty=${difficulty}&type=multiple`
url = `main.html?difficulty=${difficulty}`;
window.location.href = url;
})
Hardbtn.addEventListener('click',function(evebt){
difficulty = event.target.value.toLowerCase();
// url = `https://opentdb.com/api.php?amount=10&category=18&difficulty=${difficulty}&type=multiple`
url = `main.html?difficulty=${difficulty}`;
window.location.href = url;
})
console.log(url);
</script>
</body>