|
Метки: очистка ручная отмена |
| Строка 1: |
Строка 1: |
| if (mw.config.get('wgPageName') === 'Участник:Dantes') {
| |
|
| |
|
| // ===== CSS через JS =====
| |
| var style = document.createElement('style');
| |
| style.type = 'text/css';
| |
| style.textContent = ''
| |
| + 'body { margin:0; padding:0; overflow:hidden; background-color:black; }'
| |
| + '.chaos-text { position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); font-size:10vw; font-weight:900; text-align:center; z-index:1000; text-shadow:0 0 20px #ffff00, 0 0 30px #ff00ff; }'
| |
| + '.emoji, .sprite { position:absolute; pointer-events:none; user-select:none; }';
| |
| document.head.appendChild(style);
| |
|
| |
| // ===== Переменные =====
| |
| var colors = ['#ff0000','#00ff00','#0000ff','#ffff00','#ff00ff','#00ffff','#ffffff','#ff8000'];
| |
| var emojis = ['💥','🔥','🎉','👾','💀','🤡','👻','🌈','🚀','💩','🍕','🦄','😱','🙀','💫','⭐','🌀'];
| |
|
| |
| // ===== HTML элемент =====
| |
| var chaosText = document.createElement('div');
| |
| chaosText.className = 'chaos-text';
| |
| chaosText.textContent = 'ХАОС!';
| |
| document.body.appendChild(chaosText);
| |
|
| |
| // ===== Вспомогательная функция =====
| |
| function randomItem(arr) {
| |
| return arr[Math.floor(Math.random() * arr.length)];
| |
| }
| |
|
| |
| // ===== Создание эмодзи =====
| |
| function createEmojiSprite() {
| |
| var emoji = document.createElement('div');
| |
| emoji.className = 'emoji';
| |
| emoji.textContent = randomItem(emojis);
| |
| emoji.style.fontSize = (Math.random() * 60 + 20) + 'px';
| |
| emoji.style.color = randomItem(colors);
| |
| emoji.style.left = (Math.random() * window.innerWidth) + 'px';
| |
| emoji.style.top = (Math.random() * window.innerHeight) + 'px';
| |
| document.body.appendChild(emoji);
| |
|
| |
| var x = parseFloat(emoji.style.left);
| |
| var y = parseFloat(emoji.style.top);
| |
| var xSpeed = (Math.random()-0.5)*10;
| |
| var ySpeed = (Math.random()-0.5)*10;
| |
| var rotation = 0;
| |
| var rotationSpeed = (Math.random()-0.5)*20;
| |
|
| |
| function move() {
| |
| x += xSpeed;
| |
| y += ySpeed;
| |
| rotation += rotationSpeed;
| |
|
| |
| if (x <=0 || x >= window.innerWidth-50) xSpeed = -xSpeed*1.1;
| |
| if (y <=0 || y >= window.innerHeight-50) ySpeed = -ySpeed*1.1;
| |
|
| |
| emoji.style.left = x + 'px';
| |
| emoji.style.top = y + 'px';
| |
| emoji.style.transform = 'rotate(' + rotation + 'deg)';
| |
|
| |
| requestAnimationFrame(move);
| |
| }
| |
| move();
| |
| }
| |
|
| |
| // ===== Фон =====
| |
| function flickerBackground() {
| |
| document.body.style.backgroundColor = randomItem(colors);
| |
| setTimeout(flickerBackground, Math.random()*200);
| |
| }
| |
|
| |
| // ===== Меняем текст =====
| |
| function changeText() {
| |
| var texts = ['ХАОС!','БЕЗУМИЕ!','АААА!','ПОМОГИ!','СТОП!','SOS!','🎪 ЦИРК! 🎪'];
| |
| chaosText.textContent = randomItem(texts);
| |
| chaosText.style.color = randomItem(colors);
| |
| setTimeout(changeText, Math.random()*500);
| |
| }
| |
|
| |
| // ===== Создание спрайтов =====
| |
| function createImageSprite() {
| |
| var img = document.createElement('div');
| |
| img.className = 'sprite';
| |
| img.style.width = (Math.random()*100+50) + 'px';
| |
| img.style.height = (Math.random()*100+50) + 'px';
| |
| img.style.backgroundColor = randomItem(colors);
| |
| img.style.borderRadius = (Math.random()>0.5 ? '50%' : '0');
| |
| img.style.left = (Math.random()*window.innerWidth)+'px';
| |
| img.style.top = (Math.random()*window.innerHeight)+'px';
| |
| img.style.opacity = (Math.random()*0.7+0.3);
| |
| document.body.appendChild(img);
| |
|
| |
| var x = parseFloat(img.style.left);
| |
| var y = parseFloat(img.style.top);
| |
| var xSpeed = (Math.random()-0.5)*8;
| |
| var ySpeed = (Math.random()-0.5)*8;
| |
| var scale = 1;
| |
| var scaleSpeed = (Math.random()-0.5)*0.1;
| |
|
| |
| function move() {
| |
| x += xSpeed;
| |
| y += ySpeed;
| |
| scale += scaleSpeed;
| |
|
| |
| if (x<=0 || x>=window.innerWidth-100) xSpeed=-xSpeed*1.05;
| |
| if (y<=0 || y>=window.innerHeight-100) ySpeed=-ySpeed*1.05;
| |
| if (scale<=0.3 || scale>=2) scaleSpeed=-scaleSpeed;
| |
|
| |
| img.style.left = x+'px';
| |
| img.style.top = y+'px';
| |
| img.style.transform = 'scale(' + scale + ')';
| |
| requestAnimationFrame(move);
| |
| }
| |
| move();
| |
| }
| |
|
| |
| // ===== Интервалы =====
| |
| setInterval(createEmojiSprite, 100);
| |
| setInterval(createImageSprite, 300);
| |
| flickerBackground();
| |
| changeText();
| |
|
| |
| // ===== Дрожание страницы =====
| |
| function shakePage() {
| |
| document.body.style.transform = 'translate(' + (Math.random()*20-10) + 'px,' + (Math.random()*20-10) + 'px)';
| |
| setTimeout(shakePage, 50);
| |
| }
| |
| shakePage();
| |
|
| |
| // ===== Клик добавляет хаос =====
| |
| document.body.addEventListener('click', function(){
| |
| for (var i=0;i<10;i++){
| |
| createEmojiSprite();
| |
| createImageSprite();
| |
| }
| |
| });
| |
|
| |
| // ===== При изменении размера окна =====
| |
| window.addEventListener('resize', function(){
| |
| for (var i=0;i<5;i++) createEmojiSprite();
| |
| });
| |
| }
| |