MediaWiki:Common.js: Unterschied zwischen den Versionen

Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 1.244: Zeile 1.244:




/* === ADOS – Winter Schneefall (Variante B: weniger Schnee auf Mobil) === */
/* === ADOS – Dezenter Winter-Schneefall (very subtle) === */
(function() {
(function() {


   // Nutzer, die reduzierte Animation bevorzugen → kein Schnee
   // Nutzer mit "reduce motion" → kein Schnee
   var mq = window.matchMedia("(prefers-reduced-motion: reduce)");
   if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
  if (mq.matches) return;


   function initSnow() {
   function initSnow() {


     var width = window.innerWidth;
     const width = window.innerWidth;
     var isSmall = width < 600;         // Mobil-Check
     const isSmall = width < 600;


     var container = document.createElement('div');
     const container = document.createElement('div');
     container.id = 'ados-snow';
     container.id = 'ados-snow';
     container.style.position = 'fixed';
     container.style.position = 'fixed';
Zeile 1.268: Zeile 1.267:
     document.body.appendChild(container);
     document.body.appendChild(container);


     // Schneeflocken
     // Dezente, neutrale Flocken (Punkte statt Symbole)
     var flakeChars = ['❄', '✻', '✼', '', ''];
     const flakeChars = ['', '·', ''];


     // Mobil weniger Schneeflocken
     // Weniger als vorher
     var flakeCount = isSmall ? 25 : 35;
     const flakeCount = isSmall ? 15 : 35;


     for (var i = 0; i < flakeCount; i++) {
     for (let i = 0; i < flakeCount; i++) {


       var flake = document.createElement('div');
       const flake = document.createElement('div');
       flake.textContent = flakeChars[Math.floor(Math.random() * flakeChars.length)];
       flake.textContent = flakeChars[Math.floor(Math.random() * flakeChars.length)];
      // Kleine Flocken
      flake.style.fontSize = (isSmall ? (4 + Math.random() * 4) : (5 + Math.random() * 5)) + 'px';
      // Sehr dezent
      flake.style.opacity = (0.15 + Math.random() * 0.25).toFixed(2);
       flake.style.position = 'absolute';
       flake.style.position = 'absolute';
       flake.style.left = Math.random() * 100 + 'vw';
       flake.style.left = Math.random() * 100 + 'vw';
       flake.style.top = -(Math.random() * 20) + 'vh';
       flake.style.top = -(Math.random() * 15) + 'vh';
       flake.style.fontSize = (isSmall ? (10 + Math.random() * 14) : (14 + Math.random() * 20)) + 'px';
 
      flake.style.opacity = (0.4 + Math.random() * 0.6).toFixed(2);
      // Sehr langsames Fallen
       const duration = isSmall
        ? (12 + Math.random() * 14)
        : (14 + Math.random() * 18);


      // Animation
       flake.style.animation =
       flake.style.animation =  
         `adosSnowSoft ${duration}s linear infinite`;
         'adosSnowFall ' + (8 + Math.random() * 10) + 's linear infinite';


       // leichte Drift
       // Leichter Versatz für natürliches Gefühl
       flake.style.animationDelay = (-Math.random() * 10) + 's';
       flake.style.animationDelay = (-Math.random() * duration) + 's';


       container.appendChild(flake);
       container.appendChild(flake);
Zeile 1.295: Zeile 1.303:
   }
   }


   // Animation definieren
   // Animation (langsam, dezenter Drift)
   var style = document.createElement('style');
   const style = document.createElement('style');
   style.textContent = `
   style.textContent = `
     @keyframes adosSnowFall {
     @keyframes adosSnowSoft {
       0%  { transform: translateY(-10vh) translateX(0); }
       0%  { transform: translateY(-10vh) translateX(0);   }
       100% { transform: translateY(110vh) translateX(15px); }
       100% { transform: translateY(110vh) translateX(5px); }
     }
     }
   `;
   `;
   document.head.appendChild(style);
   document.head.appendChild(style);


  // Starten
   if (document.readyState === 'loading') {
   if (document.readyState === 'loading') {
     document.addEventListener('DOMContentLoaded', initSnow);
     document.addEventListener('DOMContentLoaded', initSnow);