-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
83 lines (73 loc) · 2.62 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="fr">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Comic+Neue:ital,wght@0,300;0,400;0,700;1,300;1,400;1,700&display=swap" rel="stylesheet">
<style>
body {
text-align: center;
padding-top: 100px;
margin: auto;
color: #000000;
font-family: "Comic Neue", cursive;
text-align: center;
}
.pouet {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
}
img {
max-width: 100%;
height: auto;
}
h1 {
font-size: 3em;
font-weight: bold;
}
/* CSS to limit image size */
#picture {
max-width: 500px; /* Limits the image width */
max-height: 500px; /* Limits the image height */
width: auto; /* Maintains aspect ratio */
height: auto; /* Maintains aspect ratio */
}
</style>
</head>
<body>
<div class="pouet">
<h1 id="response">Oui</h1>
<img src="https://raw.githubusercontent.com/jadeen/estcequelacitedysestouverte/refs/heads/main/images/1630417845183.jpeg" alt="Harpe Noire" id="picture"/>
<p>L'abus d'alcool est dangereux pour la santé, à consommer avec modération.</p>
</div>
</body>
<script>
const date = new Date();
const openHours = {
0: [[0, 60], [960, 1440]],
1: [[0, 60], [870, 1440]],// 14: 30–01:00
2: [[0, 60], [870, 1440]], //14: 30–01:00
3: [[0, 60], [870, 1440]], //14: 30–01:00
4: [[0, 60], [870, 1440]], //14: 30–01:00
5: [[0, 60], [870, 1440]], //14: 30–01:00
6: [[0, 60], [840, 1440]], //14:00–01:00
}
const dateOfTheWeek = date.getDay();
const time = date.getHours() * 60 + date.getMinutes();
const text = document.getElementById('response');
const picture = document.getElementById('picture');
if (openHours[dateOfTheWeek].some(range => time >= range[0] && time <= range[1])) {
text.textContent = 'Oui';
picture.src = "https://raw.githubusercontent.com/jadeen/estcequelacitedysestouverte/refs/heads/main/images/1630417845183.jpeg";
picture.alt = "Harpe noire";
} else {
text.textContent = 'Non';
picture.src = "https://raw.githubusercontent.com/jadeen/estcequelacitedysestouverte/refs/heads/main/images/citedysclosed.webp";
picture.alt = "Bar fermé. Revenez plus tard !";
}
</script>
</html>