gototop

Von $1

    Inhaltsverzeichnis
    keine Gliederung

    Version seit 16:46, 11 Aug 2026

    zu dieser Version.

    Zurück zu Versionshistorie.

    Zeige aktuelle Version

    /* SCROLL BUTTONS + DARK MODE TOGGLE BUTTON */
    
    /* === SCROLL BUTTONS === */
    .scroll-btn {
        position: fixed !important;
        right: 30px !important;
        width: 50px !important;
        height: 50px !important;
        cursor: pointer !important;
        z-index: 9999 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        transition: opacity 0.4s ease, visibility 0.4s ease !important;
        pointer-events: none !important;
    }
    .scroll-btn.visible {
        opacity: 0.8 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    .scroll-btn:hover {
        opacity: 1 !important;
    }
    .scroll-to-top {
        bottom: 30px !important;
    }
    .scroll-to-bottom {
        top: 30px !important;
        transform: rotate(180deg) !important;
    }
    @media (max-width: 768px) {
        .scroll-btn {
            width: 45px !important;
            height: 45px !important;
        }
        .scroll-to-top {
            bottom: 20px !important;
            right: 20px !important;
        }
        .scroll-to-bottom {
            top: 20px !important;
            right: 20px !important;
        }
    }
    
    /* === DARK MODE TOGGLE (rechts, unter scroll-to-bottom) === */
    .darkmode-toggle {
        position: fixed !important;
        top: 85px !important;
        right: 30px !important;
        width: 50px !important;
        height: 50px !important;
        border: none !important;
        border-radius: 50% !important;
        cursor: pointer !important;
        z-index: 99999 !important;
        font-size: 24px !important;
        line-height: 50px !important;
        text-align: center !important;
        padding: 0 !important;
        background: rgba(0, 0, 0, 0.06) !important;
        color: #555 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        opacity: 0.8 !important;
    }
    .darkmode-toggle:hover {
        background: rgba(0, 0, 0, 0.12) !important;
        transform: scale(1.1) !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15) !important;
        opacity: 1 !important;
    }
    .darkmode-toggle:active {
        transform: scale(0.95) !important;
    }
    
    @media (max-width: 768px) {
        .darkmode-toggle {
            width: 45px !important;
            height: 45px !important;
            font-size: 22px !important;
            line-height: 45px !important;
            top: 75px !important;
            right: 20px !important;
        }
    }
    

    Nach oben Nach unten

    (function () {
        if (window._scrollBtnsInit) {
            if (window.console) console.log('[ScrollBtns] SKIP: Bereits initialisiert (Singleton)');
            return;
        }
        window._scrollBtnsInit = true;
    
        var PREFIX = '[ScrollBtns] ';
        var THRESHOLD = 1000;
        var timer = null;
        var isVisible = false;
    
        function log(msg) {
            if (window.console && console.log) {
                console.log(PREFIX + msg);
            }
        }
    
        /* ===== SCROLL BUTTONS ===== */
        var topBtn = document.getElementById('scrollTopBtn');
        var bottomBtn = document.getElementById('scrollBottomBtn');
    
        if (!topBtn || !bottomBtn) {
            log('Buttons nicht gefunden!');
            return;
        }
    
        log('Init gestartet...');
    
        document.body.appendChild(topBtn);
        document.body.appendChild(bottomBtn);
        log('Buttons an body verschoben (Stacking Fix)');
    
        function goToTop(e) {
            if (e && e.preventDefault) e.preventDefault();
            document.body.scrollTop = 0;
            document.documentElement.scrollTop = 0;
            log('Scroll to Top');
        }
    
        function goToBottom(e) {
            if (e && e.preventDefault) e.preventDefault();
            var maxScroll = Math.max(
                document.body.scrollHeight || 0,
                document.documentElement.scrollHeight || 0
            );
            document.body.scrollTop = maxScroll;
            document.documentElement.scrollTop = maxScroll;
            log('Scroll to Bottom: ' + maxScroll + 'px');
        }
    
        function updateVisibility() {
            var scrollTop = window.pageYOffset ||
                            document.documentElement.scrollTop ||
                            document.body.scrollTop || 0;
    
            if (scrollTop > THRESHOLD && !isVisible) {
                topBtn.className = 'scroll-btn scroll-to-top visible';
                bottomBtn.className = 'scroll-btn scroll-to-bottom visible';
                isVisible = true;
                log('Buttons sichtbar (Scroll > ' + THRESHOLD + 'px)');
            } else if (scrollTop <= THRESHOLD && isVisible) {
                topBtn.className = 'scroll-btn scroll-to-top';
                bottomBtn.className = 'scroll-btn scroll-to-bottom';
                isVisible = false;
            }
        }
    
        if (topBtn.addEventListener) {
            topBtn.addEventListener('click', goToTop, false);
            bottomBtn.addEventListener('click', goToBottom, false);
        } else if (topBtn.attachEvent) {
            topBtn.attachEvent('onclick', goToTop);
            bottomBtn.attachEvent('onclick', goToBottom);
        }
    
        if (window.addEventListener) {
            window.addEventListener('scroll', function () {
                clearTimeout(timer);
                timer = setTimeout(updateVisibility, 80);
            }, false);
        } else if (window.attachEvent) {
            window.attachEvent('onscroll', function () {
                clearTimeout(timer);
                timer = setTimeout(updateVisibility, 80);
            });
        }
    
        updateVisibility();
        log('ScrollBtns fertig! Threshold: ' + THRESHOLD + 'px');
    
        /* =========================================================
           DARK MODE
           CSS wird per JS injiziert = hoechste Prioritaet
           ueberschreibt garantiert alles von MindTouch
           ========================================================= */
        var DARK_PREFIX = '[DarkMode] ';
        var COOKIE_NAME = 'taet_darkmode';
        var COOKIE_DAYS = 365;
        var isDark = false;
        var styleTag = null;
    
        function darkLog(msg) {
            if (window.console && console.log) {
                console.log(DARK_PREFIX + msg);
            }
        }
    
        /* Cookie lesen - mit try/catch fuer Tracking Prevention */
        function getCookie(name) {
            try {
                var cookies = document.cookie ? document.cookie.split(';') : [];
                for (var i = 0; i < cookies.length; i++) {
                    var c = cookies[i];
                    while (c.charAt(0) === ' ') c = c.substring(1);
                    if (c.indexOf(name + '=') === 0) {
                        return c.substring(name.length + 1);
                    }
                }
            } catch(e) {
                darkLog('Cookie lesen fehlgeschlagen (Tracking Prevention?)');
            }
            return '';
        }
    
        /* Cookie setzen - mit try/catch */
        function setCookie(name, value, days) {
            try {
                var d = new Date();
                d.setTime(d.getTime() + (days * 24 * 60 * 60 * 1000));
                document.cookie = name + '=' + value + ';expires=' + d.toUTCString() + ';path=/;SameSite=Lax';
            } catch(e) {
                darkLog('Cookie setzen fehlgeschlagen (Tracking Prevention?)');
            }
        }
    
        /* Dark Mode CSS - wird als 

     
    Use the language selection below for English Utilise le sélecteur de langue ci-dessous pour français Per l'italiano, utilizzare la selezione della lingua qui sotto Schön sprichst du deutsch :-)