Zum Inhalt springen

MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Schutzanlage
Keine Bearbeitungszusammenfassung
Die Seite wurde geleert.
Markierung: Geleert
 
Zeile 1: Zeile 1:
$(document).ready(function () {
 
  const toggle = $('<button>')
    .text('🌓')
    .attr('id', 'toggle-dark')
    .css({
      position: 'fixed',
      bottom: '1em',
      right: '1em',
      zIndex: 999,
      padding: '0.6em 0.8em',
      background: 'rgba(30,30,30,0.7)',
      color: '#ccc',
      border: 'none',
      borderRadius: '50%',
      fontSize: '1.2em',
      cursor: 'pointer',
      backdropFilter: 'blur(4px)'
    })
    .hover(
      function () { $(this).css('background', '#444'); },
      function () { $(this).css('background', 'rgba(30,30,30,0.7)'); }
    )
    .click(function () {
      $('body').toggleClass('dark-mode');
    });
  $('body').append(toggle);
});

Aktuelle Version vom 16. Juni 2025, 20:42 Uhr