Modifications pour le document Home

Modifié par Admin le 2026/05/11 09:26

Depuis la version 6.1
modifié par Admin
sur 2026/05/11 09:22
Commentaire de modification : Il n'y a aucun commentaire pour cette version
À la version 7.1
modifié par Admin
sur 2026/05/11 09:24
Commentaire de modification : Il n'y a aucun commentaire pour cette version

Résumé

Détails

Propriétés de la Page
Contenu
... ... @@ -226,7 +226,7 @@
226 226   <div class="ray"></div>
227 227   </div>
228 228  
229 - <a href="https://epn.doc.decalog.net/wiki/epn/view/Guide%20administrateur%20%26%20utilisateur/" class="bouton-guide-multicolore">
229 + <a href="https://epn.doc.decalog.net/wiki/epn/view/Guide%20administrateur%20%26%20utilisateur/" class="bouton-guide-multicolore" id="hypnoticButton">
230 230   📚 Guide Administrateur & Utilisateur
231 231   </a>
232 232  
... ... @@ -239,6 +239,8 @@
239 239  let oscillator = null;
240 240  let gainNode = null;
241 241  let isPlaying = false;
242 +let currentDuration = 0.1; // Durée normale de chaque "tu"
243 +let patternTimeout = null;
242 242  
243 243  function playTututu() {
244 244   if (oscillator) return; // Déjà en train de jouer
... ... @@ -260,22 +260,22 @@
260 260   isPlaying = true;
261 261  
262 262   // Créer l'effet tututututu en modulant la fréquence
265 + schedulePattern();
266 +}
267 +
268 +function schedulePattern() {
269 + if (!isPlaying) return;
270 +
271 + const pattern = [800, 900, 800, 950, 800, 900, 800, 1000];
263 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 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 - }
274 + pattern.forEach((freq, index) => {
275 + if (oscillator) {
276 + oscillator.frequency.setValueAtTime(freq, time + (index * currentDuration));
277 + }
278 + });
277 277  
278 - schedulePattern();
280 + patternTimeout = setTimeout(schedulePattern, pattern.length * currentDuration * 1000);
279 279  }
280 280  
281 281  function stopSound() {
... ... @@ -287,10 +287,23 @@
287 287   gainNode.disconnect();
288 288   gainNode = null;
289 289   }
292 + if (patternTimeout) {
293 + clearTimeout(patternTimeout);
294 + patternTimeout = null;
295 + }
290 290  }
291 291  
298 +function speedUpSound() {
299 + currentDuration = 0.03; // Super rapide au survol !
300 +}
301 +
302 +function normalizeSound() {
303 + currentDuration = 0.1; // Vitesse normale
304 +}
305 +
292 292  // Contrôle du bouton
293 293  const soundToggle = document.getElementById('soundToggle');
308 +const hypnoticButton = document.getElementById('hypnoticButton');
294 294  let soundEnabled = true;
295 295  
296 296  soundToggle.addEventListener('click', function() {
... ... @@ -304,6 +304,19 @@
304 304   }
305 305  });
306 306  
322 +// Événements de survol pour accélérer le son
323 +hypnoticButton.addEventListener('mouseenter', function() {
324 + if (soundEnabled && isPlaying) {
325 + speedUpSound();
326 + }
327 +});
328 +
329 +hypnoticButton.addEventListener('mouseleave', function() {
330 + if (soundEnabled && isPlaying) {
331 + normalizeSound();
332 + }
333 +});
334 +
307 307  // Démarrer automatiquement le son
308 308  playTututu();
309 309  </script>