| ... |
... |
@@ -193,6 +193,25 @@ |
| 193 |
193 |
align-items: center; |
| 194 |
194 |
justify-content: center; |
| 195 |
195 |
} |
|
196 |
+ |
|
197 |
+.sound-control { |
|
198 |
+ position: fixed; |
|
199 |
+ bottom: 20px; |
|
200 |
+ right: 20px; |
|
201 |
+ background: rgba(102, 126, 234, 0.8); |
|
202 |
+ color: white; |
|
203 |
+ border: none; |
|
204 |
+ padding: 10px 20px; |
|
205 |
+ border-radius: 30px; |
|
206 |
+ cursor: pointer; |
|
207 |
+ font-size: 16px; |
|
208 |
+ z-index: 1000; |
|
209 |
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); |
|
210 |
+} |
|
211 |
+ |
|
212 |
+.sound-control:hover { |
|
213 |
+ background: rgba(118, 75, 162, 0.9); |
|
214 |
+} |
| 196 |
196 |
</style> |
| 197 |
197 |
|
| 198 |
198 |
<div class="bouton-container"> |
| ... |
... |
@@ -208,7 +208,84 @@ |
| 208 |
208 |
</div> |
| 209 |
209 |
|
| 210 |
210 |
<a href="https://epn.doc.decalog.net/wiki/epn/view/Guide%20administrateur%20%26%20utilisateur/" class="bouton-guide-multicolore"> |
| 211 |
|
- Guide Administrateur & Utilisateur |
|
230 |
+ 📚 Guide Administrateur & Utilisateur |
| 212 |
212 |
</a> |
|
232 |
+ |
|
233 |
+ <button class="sound-control" id="soundToggle">🔊 Son ON</button> |
| 213 |
213 |
</div> |
|
235 |
+ |
|
236 |
+<script> |
|
237 |
+// Création du contexte audio |
|
238 |
+const audioContext = new (window.AudioContext || window.webkitAudioContext)(); |
|
239 |
+let oscillator = null; |
|
240 |
+let gainNode = null; |
|
241 |
+let isPlaying = false; |
|
242 |
+ |
|
243 |
+function playTututu() { |
|
244 |
+ if (oscillator) return; // Déjà en train de jouer |
|
245 |
+ |
|
246 |
+ oscillator = audioContext.createOscillator(); |
|
247 |
+ gainNode = audioContext.createGain(); |
|
248 |
+ |
|
249 |
+ oscillator.connect(gainNode); |
|
250 |
+ gainNode.connect(audioContext.destination); |
|
251 |
+ |
|
252 |
+ // Fréquence pour le son "tu" |
|
253 |
+ oscillator.frequency.value = 800; |
|
254 |
+ oscillator.type = 'square'; // Son électronique |
|
255 |
+ |
|
256 |
+ // Volume |
|
257 |
+ gainNode.gain.value = 0.1; |
|
258 |
+ |
|
259 |
+ oscillator.start(); |
|
260 |
+ isPlaying = true; |
|
261 |
+ |
|
262 |
+ // Créer l'effet tututututu en modulant la fréquence |
|
263 |
+ let time = audioContext.currentTime; |
|
264 |
+ const pattern = [800, 900, 800, 950, 800, 900, 800, 1000]; // Variation de fréquences |
|
265 |
+ const duration = 0.1; // Durée de chaque "tu" |
|
266 |
+ |
|
267 |
+ function schedulePattern() { |
|
268 |
+ if (!isPlaying) return; |
|
269 |
+ |
|
270 |
+ pattern.forEach((freq, index) => { |
|
271 |
+ oscillator.frequency.setValueAtTime(freq, time + (index * duration)); |
|
272 |
+ }); |
|
273 |
+ |
|
274 |
+ time += pattern.length * duration; |
|
275 |
+ setTimeout(schedulePattern, pattern.length * duration * 1000); |
|
276 |
+ } |
|
277 |
+ |
|
278 |
+ schedulePattern(); |
|
279 |
+} |
|
280 |
+ |
|
281 |
+function stopSound() { |
|
282 |
+ if (oscillator) { |
|
283 |
+ isPlaying = false; |
|
284 |
+ oscillator.stop(); |
|
285 |
+ oscillator.disconnect(); |
|
286 |
+ oscillator = null; |
|
287 |
+ gainNode.disconnect(); |
|
288 |
+ gainNode = null; |
|
289 |
+ } |
|
290 |
+} |
|
291 |
+ |
|
292 |
+// Contrôle du bouton |
|
293 |
+const soundToggle = document.getElementById('soundToggle'); |
|
294 |
+let soundEnabled = true; |
|
295 |
+ |
|
296 |
+soundToggle.addEventListener('click', function() { |
|
297 |
+ soundEnabled = !soundEnabled; |
|
298 |
+ if (soundEnabled) { |
|
299 |
+ playTututu(); |
|
300 |
+ soundToggle.textContent = '🔊 Son ON'; |
|
301 |
+ } else { |
|
302 |
+ stopSound(); |
|
303 |
+ soundToggle.textContent = '🔇 Son OFF'; |
|
304 |
+ } |
|
305 |
+}); |
|
306 |
+ |
|
307 |
+// Démarrer automatiquement le son |
|
308 |
+playTututu(); |
|
309 |
+</script> |
| 214 |
214 |
{{/html}} |