Torn Snowfall Overlay

Adds falling snow over Torn's background but behind UI elements

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

You will need to install an extension such as Tampermonkey to install this script.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Torn Snowfall Overlay
// @namespace    https://torn.com/
// @version      1.0
// @description  Adds falling snow over Torn's background but behind UI elements
// @author       2115907
// @match        https://www.torn.com/*
// @grant        none
// ==/UserScript==

(function () {
    'use strict';

    // Prevent duplicate injection
    if (document.getElementById("torn-snow-container")) return;

    // Create snow container
    const snowContainer = document.createElement("div");
    snowContainer.id = "torn-snow-container";

    // Style container
    Object.assign(snowContainer.style, {
        position: "fixed",
        top: "0",
        left: "0",
        width: "100%",
        height: "100%",
        pointerEvents: "none",
        zIndex: "2", // above background, below UI
        overflow: "hidden"
    });

    document.body.appendChild(snowContainer);

    // Inject CSS
    const style = document.createElement("style");
    style.textContent = `
        .snowflake {
            position: absolute;
            top: -10px;
            color: white;
            font-size: var(--size);
            opacity: var(--opacity);
            animation: fall linear infinite;
            filter: drop-shadow(0 0 2px rgba(255,255,255,0.5));
        }

        @keyframes fall {
            0% {
                transform: translateX(0) translateY(-10px);
            }
            100% {
                transform: translateX(var(--drift)) translateY(110vh);
            }
        }
    `;
    document.head.appendChild(style);

    // Create snowflakes
    const snowflakeCount = 45;

    for (let i = 0; i < snowflakeCount; i++) {
        const flake = document.createElement("div");
        flake.className = "snowflake";
        flake.innerHTML = "❄";

        const size = Math.random() * 10 + 8;
        const duration = Math.random() * 10 + 10;
        const delay = Math.random() * 10;
        const drift = (Math.random() * 200 - 100) + "px";
        const opacity = Math.random() * 0.6 + 0.3;

        flake.style.left = Math.random() * 100 + "vw";
        flake.style.setProperty("--size", size + "px");
        flake.style.setProperty("--drift", drift);
        flake.style.setProperty("--opacity", opacity);
        flake.style.animationDuration = `${duration}s`;
        flake.style.animationDelay = `${delay}s`;

        snowContainer.appendChild(flake);
    }

})();