GabedanParty Script

Скрипт для Tampermonkey, дабы разнообразить скучное пребывание в Свежем и чтении очередного нытья наносека из популярного. Ниже демонстрация работы.

Код для вставки

// ==UserScript== // @name GabedanParty Script // @namespace http://tampermonkey.net/ // @version 1.2 // @description Beer bottles with color effect // @author Tom Zein // @match https://dtf.ru/* // @grant GM_addStyle // ==/UserScript== (function() { 'use strict'; const beerImage = 'https://i.postimg.cc/jjcqBWTN/beer.png'; const bottleWidth = 100; const bottleHeight = 147; const bottlesPerSide = 3; const verticalSpacing = 250; const horizontalOffset = 50; GM_addStyle(` .beer-bottle { position: fixed; width: ${bottleWidth}px; height: ${bottleHeight}px; background: url('${beerImage}') center/contain no-repeat; z-index: 2147483647; pointer-events: none; animation: pulse 0.8s infinite alternate, rotate 8s infinite linear, hueShift 4s infinite; filter: brightness(1.2); } @keyframes pulse { from { transform: scale(0.9); } to { transform: scale(1.1); } } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } @keyframes hueShift { 0% { filter: hue-rotate(0deg) saturate(1.5); } 50% { filter: hue-rotate(180deg) saturate(2); } 100% { filter: hue-rotate(360deg) saturate(1.5); } } `); function createBeerBottles() { document.querySelectorAll('.beer-bottle').forEach(b => b.remove()); const screenWidth = window.innerWidth; for (let side = 0; side < 2; side++) { for (let i = 0; i < bottlesPerSide; i++) { const bottle = document.createElement('div'); bottle.className = 'beer-bottle'; bottle.style.left = side === 0 ? `${horizontalOffset}px` : `${screenWidth - horizontalOffset - bottleWidth}px`; // Изменено: 100 → 70 (поднято на 30px) bottle.style.top = `${70 + i * verticalSpacing}px`; bottle.style.animationDelay = `${Math.random() * 2}s`; document.body.appendChild(bottle); } } } window.addEventListener('load', createBeerBottles); window.addEventListener('resize', createBeerBottles); })();
6
2
5 комментариев