{
  "format": "putcode/playground@1",
  "id": "464eb525-1639-4968-a0fb-09d74f578d8d",
  "url": "https://putcode.dev/u/mighil/s/ni9etjwbcc",
  "title": "Falling Snow Effect",
  "description": "A lightweight, full-screen snowfall overlay with responsive CSS styling and JavaScript-generated snowflakes. The effect is pointer-safe and can be layered over existing page content.",
  "category": "animations",
  "tags": [
    "snow",
    "snowfall",
    "animation",
    "css",
    "javascript"
  ],
  "visibility": "public",
  "status": "published",
  "revision": 1,
  "author": "mighil",
  "forked_from": null,
  "created_at": "2026-12-02T18:49:16.243Z",
  "updated_at": "2026-12-02T18:52:34.815Z",
  "published_at": "2026-12-02T18:50:07.457Z",
  "source": {
    "html": "<main class=\"winter-scene\">\n  <section class=\"winter-content\">\n    <h1>Winter Wonderland</h1>\n    <p>A little snowfall for your page.</p>\n  </section>\n\n  <div class=\"snow-container\" aria-hidden=\"true\"></div>\n</main>",
    "css": "/* Demo scene. Remove this block to use the effect on an existing page. */\n.winter-scene {\n  position: relative;\n  min-height: 100vh;\n  overflow: hidden;\n  isolation: isolate;\n  color: #fff;\n  background: linear-gradient(180deg, #07152e 0%, #183b5b 100%);\n  font-family: Arial, sans-serif;\n}\n\n.winter-content {\n  position: relative;\n  z-index: 1;\n  padding: 20vh 1.5rem 2rem;\n  text-align: center;\n}\n\n.winter-content h1 {\n  margin: 0 0 0.75rem;\n  font-size: clamp(2rem, 6vw, 3.5rem);\n}\n\n.winter-content p {\n  margin: 0;\n  color: rgba(255, 255, 255, 0.8);\n}\n\n/* Snow overlay */\n.snow-container {\n  position: absolute;\n  z-index: 2;\n  inset: 0;\n  overflow: hidden;\n  pointer-events: none;\n}\n\n.snowflake {\n  position: absolute;\n  top: -2rem;\n  left: var(--snow-left);\n  color: #fff;\n  font-size: var(--snow-size);\n  line-height: 1;\n  opacity: var(--snow-opacity);\n  text-shadow: 0 0 0.4rem rgba(255, 255, 255, 0.7);\n  user-select: none;\n  will-change: transform;\n  animation: snow-fall var(--snow-duration) var(--snow-delay) linear infinite;\n}\n\n@keyframes snow-fall {\n  from {\n    transform: translate3d(0, -5vh, 0) rotate(0deg);\n  }\n  to {\n    transform: translate3d(var(--snow-drift), 110vh, 0) rotate(360deg);\n  }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .snowflake {\n    animation: none;\n    display: none;\n  }\n}",
    "js": "(() => {\n  const container = document.querySelector(\".snow-container\");\n  if (!container || container.dataset.snowReady === \"true\") return;\n\n  container.dataset.snowReady = \"true\";\n\n  const count = 90;\n  const fragment = document.createDocumentFragment();\n\n  for (let i = 0; i < count; i += 1) {\n    const flake = document.createElement(\"span\");\n    flake.className = \"snowflake\";\n    flake.textContent = Math.random() > 0.5 ? \"❄\" : \"•\";\n\n    flake.style.setProperty(\"--snow-left\", Math.random() * 100 + \"%\");\n    flake.style.setProperty(\"--snow-size\", (Math.random() * 13 + 6) + \"px\");\n    flake.style.setProperty(\"--snow-opacity\", (Math.random() * 0.65 + 0.25).toFixed(2));\n    flake.style.setProperty(\"--snow-duration\", (Math.random() * 8 + 7) + \"s\");\n    flake.style.setProperty(\"--snow-delay\", (Math.random() * -15) + \"s\");\n    flake.style.setProperty(\"--snow-drift\", (Math.random() * 140 - 70) + \"px\");\n\n    fragment.appendChild(flake);\n  }\n\n  container.appendChild(fragment);\n})();"
  }
}