{
  "registryVersion": 1,
  "id": "backgrounds/festive-hanging-garland",
  "slug": "festive-hanging-garland",
  "category": "backgrounds",
  "title": "Festive Hanging Garland",
  "description": "A seasonal promo banner (Imlek, Ramadan, 17 Agustus, Halloween) with a garland of ornaments that swing on their strings, get knocked by the pointer, and shed drifting pieces.",
  "tags": [
    "holiday",
    "background",
    "decoration",
    "physics",
    "loop",
    "cursor"
  ],
  "useCases": [
    "Imlek, Ramadan, 17 Agustus, or Halloween sale banner at the top of an e-commerce home page",
    "Seasonal hero background for a restaurant or hampers shop during holidays",
    "Festive backdrop for a holiday greeting, event, or coupon CTA section"
  ],
  "placement": [
    "promo",
    "background",
    "hero"
  ],
  "style": [
    "playful",
    "elegant"
  ],
  "intensity": "medium",
  "stack": {
    "framework": "react",
    "styling": "tailwindcss"
  },
  "dependencies": {
    "npm": {
      "gsap": "^3.13.0",
      "@gsap/react": "^2.1.0"
    },
    "gsapPlugins": []
  },
  "variants": [
    {
      "id": "imlek",
      "label": "Imlek",
      "sprinkles": [
        "sprinkle/seasonal/imlek-lantern@v2",
        "sprinkle/seasonal/imlek-lantern-pair@v2",
        "sprinkle/seasonal/imlek-knot@v2",
        "sprinkle/seasonal/imlek-fan@v2",
        "sprinkle/seasonal/imlek-plum-blossom@v2"
      ]
    },
    {
      "id": "ramadan",
      "label": "Ramadan",
      "sprinkles": [
        "sprinkle/seasonal/ramadan-bedug@v2",
        "sprinkle/seasonal/ramadan-money-envelope@v2",
        "sprinkle/seasonal/ramadan-dates@v2",
        "sprinkle/seasonal/ramadan-gift@v2"
      ]
    },
    {
      "id": "merdeka",
      "label": "17 Agustus",
      "sprinkles": [
        "sprinkle/seasonal/merdeka-party-hat@v2",
        "sprinkle/seasonal/merdeka-rosette@v2",
        "sprinkle/seasonal/merdeka-medal@v2",
        "sprinkle/seasonal/merdeka-bunting@v2"
      ]
    },
    {
      "id": "halloween",
      "label": "Halloween",
      "sprinkles": [
        "sprinkle/seasonal/halloween-pumpkin@v2",
        "sprinkle/seasonal/halloween-ghost@v2",
        "sprinkle/seasonal/halloween-bat@v2",
        "sprinkle/seasonal/halloween-spider@v2",
        "sprinkle/seasonal/halloween-candy-corn@v2"
      ]
    }
  ],
  "version": "1.1.1",
  "updatedAt": "2026-10-07",
  "design": {
    "motion": "smooth",
    "pace": "moderate",
    "radius": "round",
    "scheme": "both",
    "palette": "multicolor",
    "hues": [
      "red",
      "yellow",
      "amber",
      "orange",
      "purple",
      "teal",
      "rose",
      "emerald"
    ],
    "triggers": [
      "load",
      "hover",
      "click",
      "loop"
    ]
  },
  "adapt": {
    "colors": [
      {
        "hue": "red",
        "classes": 0,
        "literals": 23
      },
      {
        "hue": "yellow",
        "classes": 0,
        "literals": 18
      },
      {
        "hue": "amber",
        "classes": 0,
        "literals": 13
      },
      {
        "hue": "orange",
        "classes": 0,
        "literals": 10
      },
      {
        "hue": "purple",
        "classes": 0,
        "literals": 4
      },
      {
        "hue": "teal",
        "classes": 0,
        "literals": 2
      },
      {
        "hue": "rose",
        "classes": 0,
        "literals": 2
      },
      {
        "hue": "emerald",
        "classes": 0,
        "literals": 1
      }
    ],
    "radiusClasses": [
      "rounded-3xl",
      "rounded-[1.5px]",
      "rounded-full"
    ],
    "eases": [
      "back",
      "elastic",
      "none",
      "power1",
      "power2",
      "sine"
    ],
    "durations": [
      0.14,
      3.6
    ]
  },
  "photoSlots": [],
  "sprinkles": [
    {
      "id": "sprinkle/seasonal/imlek-lantern@v2",
      "file": "sprinkles/v2/seasonal/imlek-lantern.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/imlek-lantern.webp",
      "description": "Round red lantern with gold tassels (paper-cut Lunar New Year)."
    },
    {
      "id": "sprinkle/seasonal/imlek-lantern-pair@v2",
      "file": "sprinkles/v2/seasonal/imlek-lantern-pair.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/imlek-lantern-pair.webp",
      "description": "Two hanging lanterns, red and gold (paper-cut Lunar New Year).",
      "fixed": true
    },
    {
      "id": "sprinkle/seasonal/imlek-knot@v2",
      "file": "sprinkles/v2/seasonal/imlek-knot.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/imlek-knot.webp",
      "description": "Solid decorative Chinese knot with tassels, red (paper-cut Lunar New Year)."
    },
    {
      "id": "sprinkle/seasonal/imlek-fan@v2",
      "file": "sprinkles/v2/seasonal/imlek-fan.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/imlek-fan.webp",
      "description": "Open folding fan, red and gold (paper-cut Lunar New Year)."
    },
    {
      "id": "sprinkle/seasonal/imlek-plum-blossom@v2",
      "file": "sprinkles/v2/seasonal/imlek-plum-blossom.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/imlek-plum-blossom.webp",
      "description": "Plum blossom branch, pink flowers (paper-cut Lunar New Year)."
    },
    {
      "id": "sprinkle/seasonal/ramadan-bedug@v2",
      "file": "sprinkles/v2/seasonal/ramadan-bedug.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/ramadan-bedug.webp",
      "description": "Large bedug drum on a wooden stand, warm brown and gold (flat Ramadan)."
    },
    {
      "id": "sprinkle/seasonal/ramadan-money-envelope@v2",
      "file": "sprinkles/v2/seasonal/ramadan-money-envelope.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/ramadan-money-envelope.webp",
      "description": "Blank money envelope with a gold geometric pattern, emerald (flat Ramadan)."
    },
    {
      "id": "sprinkle/seasonal/ramadan-dates@v2",
      "file": "sprinkles/v2/seasonal/ramadan-dates.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/ramadan-dates.webp",
      "description": "Small bowl of dates, emerald bowl (flat Ramadan)."
    },
    {
      "id": "sprinkle/seasonal/ramadan-gift@v2",
      "file": "sprinkles/v2/seasonal/ramadan-gift.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/ramadan-gift.webp",
      "description": "Gift box with a ribbon, emerald and gold (flat Ramadan)."
    },
    {
      "id": "sprinkle/seasonal/merdeka-party-hat@v2",
      "file": "sprinkles/v2/seasonal/merdeka-party-hat.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/merdeka-party-hat.webp",
      "description": "Red and white striped party hat (flat 17 Agustus)."
    },
    {
      "id": "sprinkle/seasonal/merdeka-rosette@v2",
      "file": "sprinkles/v2/seasonal/merdeka-rosette.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/merdeka-rosette.webp",
      "description": "Red and white ribbon rosette (flat 17 Agustus)."
    },
    {
      "id": "sprinkle/seasonal/merdeka-medal@v2",
      "file": "sprinkles/v2/seasonal/merdeka-medal.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/merdeka-medal.webp",
      "description": "Gold medal on a red and white ribbon (flat 17 Agustus).",
      "fixed": true
    },
    {
      "id": "sprinkle/seasonal/merdeka-bunting@v2",
      "file": "sprinkles/v2/seasonal/merdeka-bunting.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/merdeka-bunting.webp",
      "description": "String of red and white triangle pennants (flat 17 Agustus)."
    },
    {
      "id": "sprinkle/seasonal/halloween-pumpkin@v2",
      "file": "sprinkles/v2/seasonal/halloween-pumpkin.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/halloween-pumpkin.webp",
      "description": "Carved jack-o'-lantern pumpkin (cartoon Halloween)."
    },
    {
      "id": "sprinkle/seasonal/halloween-ghost@v2",
      "file": "sprinkles/v2/seasonal/halloween-ghost.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/halloween-ghost.webp",
      "description": "Friendly ghost, white (cartoon Halloween)."
    },
    {
      "id": "sprinkle/seasonal/halloween-bat@v2",
      "file": "sprinkles/v2/seasonal/halloween-bat.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/halloween-bat.webp",
      "description": "Bat with spread wings, purple (cartoon Halloween)."
    },
    {
      "id": "sprinkle/seasonal/halloween-spider@v2",
      "file": "sprinkles/v2/seasonal/halloween-spider.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/halloween-spider.webp",
      "description": "Cute spider hanging from a thread, purple (cartoon Halloween)."
    },
    {
      "id": "sprinkle/seasonal/halloween-candy-corn@v2",
      "file": "sprinkles/v2/seasonal/halloween-candy-corn.webp",
      "publicUrl": "https://inassetweb-cdn.inwebsite.online/sprinkles/v2/seasonal/halloween-candy-corn.webp",
      "description": "Candy corn (cartoon Halloween)."
    }
  ],
  "page": "/snippets/backgrounds/festive-hanging-garland",
  "preview": "/preview/backgrounds/festive-hanging-garland",
  "registryPath": "/registry/snippets/backgrounds/festive-hanging-garland.json",
  "install": "npm i gsap @gsap/react",
  "codeLines": 716,
  "readme": "# Festive Hanging Garland\r\n\r\n`backgrounds/festive-hanging-garland`\r\n\r\nA seasonal promo banner with a garland of ornaments strung across the top. Each one swings on its own string, the fairy lights chase along the line, and small pieces drift down. Sweep the pointer through the garland (or tap it) and the ornaments get knocked aside, settle back with a springy wobble, and shed a piece or two. Four holiday looks are built in: Imlek (paper-cut lanterns on lacquer red), Ramadan (bedug, THR envelopes, and hampers on emerald), 17 Agustus (striped party hats hung by their pompoms, rosettes, medals, and bunting on cream), and Halloween (pumpkins, ghosts, bats, and a spider that climbs its thread).\r\n\r\n## When to use\r\n\r\n- Imlek, Ramadan, 17 Agustus, or Halloween sale banner at the top of an e-commerce home page.\r\n- Seasonal hero background for a restaurant or hampers shop during holidays.\r\n- Festive backdrop for a holiday greeting, event, or coupon CTA section.\r\n\r\n## Install\r\n\r\n1. `npm i gsap @gsap/react`\r\n2. Copy the code with the **Copy** button on the snippet page and save it as a React component.\r\n3. Use it with the sample copy: `<FestiveHangingGarland theme=\"ramadan\" />`\r\n4. Or with your own content (it sits above the garland, centered toward the bottom works best):\r\n\r\n```tsx\r\n<FestiveHangingGarland theme=\"merdeka\">\r\n  <div className=\"flex h-full flex-col items-center justify-end pb-10 text-center\">\r\n    <h2 className=\"text-4xl font-black\">Promo 17 Agustus</h2>\r\n  </div>\r\n</FestiveHangingGarland>\r\n```\r\n\r\nThe banner is `h-[420px]` on phones and `h-[400px]` from `sm` up, full width up to `max-w-5xl`. Change the height with `className`, setting both breakpoints with the important modifier so it beats the built-in heights (for example `className=\"h-[480px]! sm:h-[460px]!\"`); the garland always takes the top 30% and re-measures itself on resize, so the ornaments stay on the string at any width. On phones the edge strings are shortened so the ornaments end above the middle of the banner and stay clear of the copy.\r\n\r\n## Props\r\n\r\n| Prop | Type | Default | Description |\r\n| --- | --- | --- | --- |\r\n| `theme` | `\"imlek\" \\| \"ramadan\" \\| \"merdeka\" \\| \"halloween\"` | `\"imlek\"` | Holiday look: background, string and light colors, ornaments, drifting pieces, and sample copy. |\r\n| `density` | `\"full\" \\| \"few\"` | `\"full\"` | 10 ornaments or 6. Banners narrower than 540px always use 6. |\r\n| `speed` | `number` | `1` | Multiplier for the swing, light chase, and drift speed. |\r\n| `autoPlay` | `boolean` | `false` | Idle self-demo: a gust sweeps through the garland every 5 seconds. Stops for good as soon as the pointer enters the banner or anything inside it gets keyboard focus. |\r\n| `children` | `ReactNode` | sample copy | Your own content, shown above the garland. |\r\n| `className` | `string` | `\"\"` | Extra classes for the wrapper (height, margin, rounding). |\r\n\r\n## Photos\r\n\r\nNo photos. Every image is a sprinkle you can use directly from its public URL, and each one can be swapped for another sprinkle from the same family (for example another Imlek piece for an Imlek piece). The lantern pair and the medal are the exception: they hang from two threads drawn to points on that exact artwork, so another image would not line up.\r\n\r\n- `sprinkle/seasonal/imlek-lantern@v2`\r\n- `sprinkle/seasonal/imlek-lantern-pair@v2`\r\n- `sprinkle/seasonal/imlek-knot@v2`\r\n- `sprinkle/seasonal/imlek-fan@v2`\r\n- `sprinkle/seasonal/imlek-plum-blossom@v2` (drifting piece)\r\n- `sprinkle/seasonal/ramadan-bedug@v2`\r\n- `sprinkle/seasonal/ramadan-money-envelope@v2`\r\n- `sprinkle/seasonal/ramadan-dates@v2`\r\n- `sprinkle/seasonal/ramadan-gift@v2`\r\n- `sprinkle/seasonal/merdeka-party-hat@v2`\r\n- `sprinkle/seasonal/merdeka-rosette@v2`\r\n- `sprinkle/seasonal/merdeka-medal@v2`\r\n- `sprinkle/seasonal/merdeka-bunting@v2` (corner swags)\r\n- `sprinkle/seasonal/halloween-pumpkin@v2`\r\n- `sprinkle/seasonal/halloween-ghost@v2`\r\n- `sprinkle/seasonal/halloween-bat@v2`\r\n- `sprinkle/seasonal/halloween-spider@v2`\r\n- `sprinkle/seasonal/halloween-candy-corn@v2` (drifting piece)\r\n\r\nOnly the active theme's images are rendered. Ramadan uses small gold stars and 17 Agustus uses red and white confetti as drifting pieces; both are drawn in code.\r\n\r\n## Customization\r\n\r\n- Each theme is one entry in the `THEMES` record: colors, sample copy, the `ornaments` list, and `order` (which ornament hangs on each of the 10 slots). Add a theme by copying an entry.\r\n- An ornament's `ax` / `ay` is where its string meets the art (as a fraction of the image box), so the string ends exactly on the lantern's loop or the medal's ribbon. `split` hangs a piece from two points (the lantern pair, the medal), `stretch` lengthens its string (the spider), and `bob` makes it climb and drop (the spider).\r\n- Slot positions, string lengths, and ornament sizes live in `SLOTS`; the string shape is the `PATH` swag in a 1000x200 viewBox.\r\n- The pointer kick strength is `-vx * 0.08` (clamped to 25 degrees) and the reach is `KICK_RADIUS`.\r\n- 17 Agustus follows the site theme: cream with a red string in light mode, near black with a white string under `.dark`. The other three are dark scenes in both modes.\r\n- Users with `prefers-reduced-motion` see the ornaments hanging still at small varied angles and steady lights, with no drift and no kicks.\r\n",
  "sourceDir": "snippets/backgrounds/festive-hanging-garland",
  "thumbnail": "/registry/thumbnails/backgrounds/festive-hanging-garland.webp",
  "thumbnailDark": "/registry/thumbnails/backgrounds/festive-hanging-garland.dark.webp",
  "codeAccess": "The code is not in this file. Get it with the MCP tool get_snippet and an InWebAsset API key (header Authorization: Bearer aw_...; sign in at /agents to create one), or with the Copy button on the snippet page after signing in. Free accounts can take snippet code 5 times per day (every fetch counts, also of a snippet fetched before); Pro accounts have no limit."
}
