-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
96 lines (74 loc) · 2.38 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
84
85
86
87
88
89
90
91
92
93
94
95
96
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Moviedle</title>
<link rel="stylesheet" href="./public/css/style.css">
<script src="./public/js/script.js"></script>
</head>
<body>
<nav>
<div class="title">
<h1 class="maintitle">Moviedle</h1>
<img src="./public/img/john-wick.png" alt="John Wick">
</div>
</nav>
<canvas id="photo">
</canvas>
<div id="scores">
<div id="scoreUp">
<p id="score">Score : </p>
<p id="scoreNB"></p>
</div>
<div id="scoreDown">
<p id="maxscore">Score maximum : </p>
<p id="maxscoreNB"></p>
</div>
</div>
<input type="text" id="guessinput" placeholder="Rentrez le nom du film">
<ul id="infobulle"></ul>
<button id="button">Valider</button>
<button id="depixelate">Dépixeliser</button>
<div id="buttonContainer">
</div>
<script>
var inputText = document.getElementById("guessinput");
inputText.addEventListener("keydown", function (event) {
if (event.keyCode === 13) {
event.preventDefault();
document.getElementById("button").click();
}
});
let clickCount = 0;
let depixeliseButton = document.getElementById('depixelate');
let validButton = document.getElementById('button');
let skipButton = document.createElement('button');
skipButton.textContent = 'Skip';
skipButton.style.display = 'none';
skipButton.style.marginTop = '1vh';
skipButton.style.width = '25%';
buttonContainer.appendChild(skipButton);
validButton.addEventListener('click',function()
{
clickCount=0;
});
depixeliseButton.addEventListener('click', function()
{
clickCount++;
if (clickCount >= 4)
{
skipButton.style.display = 'block';
clickCount = 0;
}
});
skipButton.addEventListener('click', function()
{
location.reload();
});
</script>
<footer>
<p id="credits">© Thomas Portelette, Logan Laporte, Rayan Outili - 2023</p>
</footer>
</body>
</html>