-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
206 lines (176 loc) · 5.22 KB
/
index.html
File metadata and controls
206 lines (176 loc) · 5.22 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Site de Blagues Moderne</title>
<style>
/* Global styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
line-height: 1.6;
background-color: #f4f4f4;
color: #333;
display: flex;
flex-direction: column;
min-height: 100vh;
}
header {
background-color: #4a90e2;
color: white;
padding: 20px;
text-align: center;
}
header h1 {
font-size: 2.5rem;
}
nav {
display: flex;
justify-content: center;
gap: 20px;
padding: 10px 0;
background-color: #357ABD;
}
nav a {
color: white;
padding: 10px 15px;
text-decoration: none;
background-color: #286090;
border-radius: 5px;
transition: background-color 0.3s ease;
}
nav a:hover {
background-color: #204d74;
}
.hero {
background: url('https://via.placeholder.com/1920x1080') no-repeat center center/cover;
height: 60vh;
display: flex;
justify-content: center;
align-items: center;
color: white;
text-align: center;
}
.hero h2 {
font-size: 3rem;
margin-bottom: 20px;
}
.hero button {
background-color: #ff4081;
border: none;
padding: 15px 30px;
font-size: 1.2rem;
color: white;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.3s ease, transform 0.3s ease;
}
.hero button:hover {
background-color: #ff609d;
transform: scale(1.05);
}
.content {
padding: 40px;
text-align: center;
background-color: white;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin: 20px;
border-radius: 10px;
}
.content h2 {
font-size: 2.5rem;
margin-bottom: 20px;
}
.joke {
font-size: 1.5rem;
margin: 20px 0;
color: #333;
transition: opacity 0.3s ease;
}
#change-joke {
padding: 15px 30px;
background-color: #28a745;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.3s ease;
}
#change-joke:hover {
background-color: #218838;
transform: scale(1.05);
}
footer {
background-color: #4a90e2;
color: white;
padding: 20px;
text-align: center;
margin-top: auto;
}
footer p {
margin: 0;
}
@media (max-width: 768px) {
.hero h2 {
font-size: 2rem;
}
.content {
margin: 10px;
padding: 20px;
}
.joke {
font-size: 1.2rem;
}
.hero {
height: 50vh;
}
}
</style>
</head>
<body>
<header>
<h1>Bienvenue sur le site de blagues amusant 🎉</h1>
<nav>
<a href="#content">Blagues</a>
<a href="#footer">Contact</a>
</nav>
</header>
<section class="hero">
<div>
<h2>Rires garantis ! 😄</h2>
<button>Découvrir</button>
</div>
</section>
<section id="content" class="content">
<h2>Blague du moment :</h2>
<p class="joke">Pourquoi les plongeurs plongent-ils toujours en arrière ? Parce que sinon ils tombent dans le bateau ! 😆</p>
<button id="change-joke">Changer de blague</button>
</section>
<footer id="footer">
<p>© 2024 Site de Blagues Moderne</p>
</footer>
<script>
const jokes = [
"Pourquoi les plongeurs plongent-ils toujours en arrière ? Parce que sinon ils tombent dans le bateau ! 😆",
"Quelle est la femelle du hamster ? L'amsterdame ! 😂",
"Pourquoi les canards sont toujours à l'heure ? Parce qu'ils sont dans l'étang ! 🦆",
"Quel est le comble pour un électricien ? De ne pas être au courant ! ⚡"
];
const jokeElement = document.querySelector('.joke');
const changeJokeButton = document.getElementById('change-joke');
changeJokeButton.addEventListener('click', () => {
jokeElement.style.opacity = '0';
setTimeout(() => {
const randomJoke = jokes[Math.floor(Math.random() * jokes.length)];
jokeElement.textContent = randomJoke;
jokeElement.style.opacity = '1';
}, 300);
});
</script>
</body>
</html>