MediaWiki:Test.css: различия между версиями

Страница интерфейса MediaWiki
Нет описания правки
Метка: отменено
Нет описания правки
 
(не показаны 2 промежуточные версии этого же участника)
Строка 1: Строка 1:
(function() {
body:before {
     var today = new Date();
     content: "";
     var month = today.getMonth() + 1;
    position: fixed;
     if (month !== 10 && month !== 11) return;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("https://upload.wikimedia.org/wikipedia/commons/3/36/Snowflakes_falling_transparent.gif");
     background-repeat: repeat;
    pointer-events: none;
    opacity: 0.35;
    z-index: 2;
     animation: snowmove 60s linear infinite;
}


     mw.loader.load('/w/index.php?title=MediaWiki:Test.css&action=raw&ctype=text/css');
@keyframes snowmove {
     from { background-position: 0 0; }
    to { background-position: 500px 1000px; }
}


    var config = {
h1, h2, h3, h4, h5 {
        leavesCount: 50,
    text-shadow: 0 0 6px rgba(179, 229, 252, 0.7), 0 0 12px rgba(179, 229, 252, 0.4);
        batsCount: 8,
    transition: text-shadow 0.3s;
        websCount: 5,
}
        pumpkinCount: 3,
        leafIcons: ['🍂','🍁','🦇','🕸️'],
        leafSizes: {min: 14, max: 42},
        pumpkinSizes: {min: 24, max: 36},
        batAnimationDuration: {min: 8, max: 14},
        leafAnimationDuration: [8, 10, 12],
        mobileMaxLeaves: 25
    };


     function isMobile() {
h1:hover, h2:hover, h3:hover, h4:hover, h5:hover {
        return window.innerWidth <= 768;
     text-shadow: 0 0 12px rgba(179, 229, 252, 0.9), 0 0 20px rgba(179, 229, 252, 0.6);
    }
}


    function random(min, max) {
a, a:visited {
        return min + Math.random() * (max - min);
    transition: color 0.3s, text-shadow 0.3s;
    }
}


    function createElement(tag, className, innerHTML) {
a:hover {
        var el = document.createElement(tag);
    color: #b3e5fc !important;
        if (className) el.className = className;
    text-shadow: 0 0 6px #b3e5fc;
        if (innerHTML) el.innerHTML = innerHTML;
}
        return el;
    }


     function initLeaves() {
.wikitable {
        var leavesFragment = document.createDocumentFragment();
     border-color: rgba(179, 229, 252, 0.6) !important;
        var count = isMobile() ? config.mobileMaxLeaves : config.leavesCount;
    border-radius: 6px;
}


        for (var i = 0; i < count; i++) {
.wikitable th {
            var leaf = createElement('span', 'halloween-leaf', config.leafIcons[Math.floor(Math.random() * config.leafIcons.length)]);
    background: rgba(179, 229, 252, 0.1);
            leaf.style.left = random(0, 100) + '%';
}
            leaf.style.fontSize = random(config.leafSizes.min, config.leafSizes.max) + 'px';
            leaf.style.opacity = random(0.3, 1);
            leaf.style.animationDuration = config.leafAnimationDuration[i % config.leafAnimationDuration.length] + 's';
            leaf.style.animationDelay = random(0, 10) + 's';
            leavesFragment.appendChild(leaf);
        }
        var leavesContainer = createElement('div', 'halloween-leaves');
        leavesContainer.appendChild(leavesFragment);
        document.body.appendChild(leavesContainer);
    }


    function initPumpkins() {
.mw-page-title-main:before {
        var heading = document.getElementById('firstHeading');
    content: " ";
        if (!heading) return;
}


        for (var i = 0; i < config.pumpkinCount; i++) {
.mw-page-title-main:after {
            var pumpkin = createElement('span', 'halloween-pumpkin', '🎃');
     content: " ";
            pumpkin.style.margin = '0 2px';
}
            pumpkin.style.fontSize = random(config.pumpkinSizes.min, config.pumpkinSizes.max) + 'px';
            heading.appendChild(pumpkin);
            floatPumpkin(pumpkin);
        }
    }
 
    function floatPumpkin(el) {
        var pos = 0, dir = 1;
        setInterval(function() {
            pos += dir * 0.3;
            if(pos > 5 || pos < 0) dir *= -1;
            el.style.transform = 'translateY(' + pos + 'px)';
        }, 30);
    }
 
    function initLinks() {
        document.body.addEventListener('mouseover', function(e) {
            if (e.target.tagName.toLowerCase() === 'a') {
                e.target.style.color = '#ffa500';
                e.target.style.textShadow = '0 0 8px #ffa500, 0 0 15px #ff7518';
            }
        });
        document.body.addEventListener('mouseout', function(e) {
            if (e.target.tagName.toLowerCase() === 'a') {
                e.target.style.color = '';
                e.target.style.textShadow = '';
            }
        });
    }
 
    function initBats() {
        var batsFragment = document.createDocumentFragment();
        for (var i = 0; i < config.batsCount; i++) {
            var bat = createElement('div', 'halloween-bat');
            bat.style.top = random(0, 50) + 'vh';
            bat.style.left = (-50 + random(0, 100)) + 'px';
            bat.style.animationDuration = random(config.batAnimationDuration.min, config.batAnimationDuration.max) + 's';
            batsFragment.appendChild(bat);
        }
        document.body.appendChild(batsFragment);
    }
 
    function initWebs() {
        var websFragment = document.createDocumentFragment();
        for (var i = 0; i < config.websCount; i++) {
            var web = createElement('div', 'spider-web');
            web.style.top = random(0, 80) + 'vh';
            web.style.left = random(0, 90) + 'vw';
            web.style.transform = 'rotate(' + random(0, 360) + 'deg)';
            websFragment.appendChild(web);
        }
        document.body.appendChild(websFragment);
     }
 
    mw.hook('wikipage.content').add(function() {
        initLeaves();
        initPumpkins();
        initLinks();
        initBats();
        initWebs();
    });
 
})();

Текущая версия от 08:23, 13 ноября 2025

body:before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("https://upload.wikimedia.org/wikipedia/commons/3/36/Snowflakes_falling_transparent.gif");
    background-repeat: repeat;
    pointer-events: none;
    opacity: 0.35;
    z-index: 2;
    animation: snowmove 60s linear infinite;
}

@keyframes snowmove {
    from { background-position: 0 0; }
    to { background-position: 500px 1000px; }
}

h1, h2, h3, h4, h5 {
    text-shadow: 0 0 6px rgba(179, 229, 252, 0.7), 0 0 12px rgba(179, 229, 252, 0.4);
    transition: text-shadow 0.3s;
}

h1:hover, h2:hover, h3:hover, h4:hover, h5:hover {
    text-shadow: 0 0 12px rgba(179, 229, 252, 0.9), 0 0 20px rgba(179, 229, 252, 0.6);
}

a, a:visited {
    transition: color 0.3s, text-shadow 0.3s;
}

a:hover {
    color: #b3e5fc !important;
    text-shadow: 0 0 6px #b3e5fc;
}

.wikitable {
    border-color: rgba(179, 229, 252, 0.6) !important;
    border-radius: 6px;
}

.wikitable th {
    background: rgba(179, 229, 252, 0.1);
}

.mw-page-title-main:before {
    content: " ";
}

.mw-page-title-main:after {
    content: " ";
}