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

Страница интерфейса MediaWiki
Нет описания правки
Метка: отменено
Нет описания правки
 
(не показаны 3 промежуточные версии этого же участника)
Строка 1: Строка 1:
(function() {
.ss14-rules {
     var today = new Date();
     width: 100%;
     var month = today.getMonth() + 1;
    border-collapse: separate;
     if (month !== 10 && month !== 11) return;
    border-spacing: 0 8px; /* Расстояние между строками */
    background-color: transparent;
     color: #cecece;
     font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}


     mw.loader.load('/w/index.php?title=MediaWiki:Test.css&action=raw&ctype=text/css');
.ss14-rules th {
    background: #1a1a1e;
    color: #7daeff;
    padding: 12px;
    text-transform: uppercase;
     font-size: 0.9em;
    letter-spacing: 1px;
    border-bottom: 2px solid #3a3a42;
}


    var config = {
.ss14-rules td:first-child,  
        leavesCount: 50,
.ss14-rules td:nth-child(2) {
        batsCount: 8,
    background: #25252b;
        websCount: 5,
    font-weight: bold;
        pumpkinCount: 3,
    color: #ffffff;
        leafIcons: ['🍂','🍁','🦇','🕸️'],
    vertical-align: top;
        leafSizes: {min: 14, max: 42},
    border-left: 4px solid #5a5a66; /* Акцентная полоса слева */
        pumpkinSizes: {min: 24, max: 36},
}
        batAnimationDuration: {min: 8, max: 14},
        leafAnimationDuration: [8, 10, 12],
        mobileMaxLeaves: 25
    };


    function isMobile() {
.ss14-rules td:first-child {
        return window.innerWidth <= 768;
     white-space: nowrap;
     }
     color: #ffca28; /* Золотистый цвет для номера */
 
     width: 10%;
    function random(min, max) {
}
        return min + Math.random() * (max - min);
     }
 
     function createElement(tag, className, innerHTML) {
        var el = document.createElement(tag);
        if (className) el.className = className;
        if (innerHTML) el.innerHTML = innerHTML;
        return el;
    }


    function initLeaves() {
/* Описание правила (третья колонка) */
        var leavesFragment = document.createDocumentFragment();
.ss14-rules td:last-child {
        var count = isMobile() ? config.mobileMaxLeaves : config.leavesCount;
    background: #1e1e22;
    padding: 15px;
    line-height: 1.6;
    border-right: 1px solid #3a3a42;
}


        for (var i = 0; i < count; i++) {
.ss14-rules td big {
            var leaf = createElement('span', 'halloween-leaf', config.leafIcons[Math.floor(Math.random() * config.leafIcons.length)]);
    display: block;
            leaf.style.left = random(0, 100) + '%';
    color: #7daeff; /* Голубой акцент */
            leaf.style.fontSize = random(config.leafSizes.min, config.leafSizes.max) + 'px';
    font-size: 1.1em;
            leaf.style.opacity = random(0.3, 1);
    margin-bottom: 10px;
            leaf.style.animationDuration = config.leafAnimationDuration[i % config.leafAnimationDuration.length] + 's';
    border-bottom: 1px solid #333;
            leaf.style.animationDelay = random(0, 10) + 's';
    padding-bottom: 5px;
            leavesFragment.appendChild(leaf);
}
        }
        var leavesContainer = createElement('div', 'halloween-leaves');
        leavesContainer.appendChild(leavesFragment);
        document.body.appendChild(leavesContainer);
    }


    function initPumpkins() {
.ss14-rules ul {
        var heading = document.getElementById('firstHeading');
    margin-top: 10px;
        if (!heading) return;
    list-style-type: square;
}


        for (var i = 0; i < config.pumpkinCount; i++) {
.ss14-rules li {
            var pumpkin = createElement('span', 'halloween-pumpkin', '🎃');
    margin-bottom: 8px;
            pumpkin.style.margin = '0 2px';
}
            pumpkin.style.fontSize = random(config.pumpkinSizes.min, config.pumpkinSizes.max) + 'px';
            heading.appendChild(pumpkin);
            floatPumpkin(pumpkin);
        }
    }


    function floatPumpkin(el) {
.ss14-rules tr:hover td {
        var pos = 0, dir = 1;
    background-color: #2d2d35 !important;
        setInterval(function() {
    transition: background 0.2s ease;
            pos += dir * 0.3;
}
            if(pos > 5 || pos < 0) dir *= -1;
            el.style.transform = 'translateY(' + pos + 'px)';
        }, 30);
    }


    function initLinks() {
@media screen and (max-width: 720px) {
        document.body.addEventListener('mouseover', function(e) {
    .ss14-rules, .ss14-rules tbody, .ss14-rules tr, .ss14-rules td {
            if (e.target.tagName.toLowerCase() === 'a') {
        display: block;
                e.target.style.color = '#ffa500';
         width: 100%;
                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 = '';
            }
         });
     }
     }
 
     .ss14-rules td {
     function initBats() {
         box-sizing: border-box;
         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);
     }
     }
 
     .ss14-rules td:first-child {
     function initWebs() {
         border-bottom: none;
         var websFragment = document.createDocumentFragment();
         padding-bottom: 5px;
         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();
    });
 
})();

Текущая версия от 14:16, 25 февраля 2026

.ss14-rules {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px; /* Расстояние между строками */
    background-color: transparent;
    color: #cecece;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.ss14-rules th {
    background: #1a1a1e;
    color: #7daeff;
    padding: 12px;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1px;
    border-bottom: 2px solid #3a3a42;
}

.ss14-rules td:first-child, 
.ss14-rules td:nth-child(2) {
    background: #25252b;
    font-weight: bold;
    color: #ffffff;
    vertical-align: top;
    border-left: 4px solid #5a5a66; /* Акцентная полоса слева */
}

.ss14-rules td:first-child {
    white-space: nowrap;
    color: #ffca28; /* Золотистый цвет для номера */
    width: 10%;
}

/* Описание правила (третья колонка) */
.ss14-rules td:last-child {
    background: #1e1e22;
    padding: 15px;
    line-height: 1.6;
    border-right: 1px solid #3a3a42;
}

.ss14-rules td big {
    display: block;
    color: #7daeff; /* Голубой акцент */
    font-size: 1.1em;
    margin-bottom: 10px;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
}

.ss14-rules ul {
    margin-top: 10px;
    list-style-type: square;
}

.ss14-rules li {
    margin-bottom: 8px;
}

.ss14-rules tr:hover td {
    background-color: #2d2d35 !important;
    transition: background 0.2s ease;
}

@media screen and (max-width: 720px) {
    .ss14-rules, .ss14-rules tbody, .ss14-rules tr, .ss14-rules td {
        display: block;
        width: 100%;
    }
    .ss14-rules td {
        box-sizing: border-box;
    }
    .ss14-rules td:first-child {
        border-bottom: none;
        padding-bottom: 5px;
    }
}