Modifications pour le document Home

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

Depuis 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
À 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

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" id="hypnoticButton">
229 + <a href="https://epn.doc.decalog.net/wiki/epn/view/Guide%20administrateur%20%26%20utilisateur/" class="bouton-guide-multicolore">
230 230   📚 Guide Administrateur & Utilisateur
231 231   </a>
232 232  
... ... @@ -239,8 +239,6 @@
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;
244 244  
245 245  function playTututu() {
246 246   if (oscillator) return; // Déjà en train de jouer
... ... @@ -262,22 +262,22 @@
262 262   isPlaying = true;
263 263  
264 264   // 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];
272 272   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"
273 273  
274 - pattern.forEach((freq, index) => {
275 - if (oscillator) {
276 - oscillator.frequency.setValueAtTime(freq, time + (index * currentDuration));
277 - }
278 - });
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 + }
279 279  
280 - patternTimeout = setTimeout(schedulePattern, pattern.length * currentDuration * 1000);
278 + schedulePattern();
281 281  }
282 282  
283 283  function stopSound() {
... ... @@ -289,23 +289,10 @@
289 289   gainNode.disconnect();
290 290   gainNode = null;
291 291   }
292 - if (patternTimeout) {
293 - clearTimeout(patternTimeout);
294 - patternTimeout = null;
295 - }
296 296  }
297 297  
298 -function speedUpSound() {
299 - currentDuration = 0.03; // Super rapide au survol !
300 -}
301 -
302 -function normalizeSound() {
303 - currentDuration = 0.1; // Vitesse normale
304 -}
305 -
306 306  // Contrôle du bouton
307 307  const soundToggle = document.getElementById('soundToggle');
308 -const hypnoticButton = document.getElementById('hypnoticButton');
309 309  let soundEnabled = true;
310 310  
311 311  soundToggle.addEventListener('click', function() {
... ... @@ -319,19 +319,6 @@
319 319   }
320 320  });
321 321  
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 -
335 335  // Démarrer automatiquement le son
336 336  playTututu();
337 337  </script>