FestiveLayer

සංවර්ධක ලේඛන

තත්පර 60ක් ඇතුළත ඕනෑම වෙබ් අඩවියකට හෝ CMS එකකට FestiveLayer එක් කරන්න. බාහිර පුස්තකාල අවශ්‍ය නොවේ.

1 · තත්පර 60 ක්ෂණික ආරම්භය

ඔබගේ වෙබ් පිටුවේ </body> ටැගයට පෙර මෙම තනි script එක එක් කරන්න:

Quick-Start HTML
<script src="https://cdn.example.com/v1/festive.js"
        data-festival="auto" async></script>

2 · Declarative Configuration (data- Attributes)

Configure the engine declaratively directly on the script element without writing JavaScript:

AttributeTypeDefaultDescription
data-festival string "auto" Festival ID (e.g. "christmas", "new-year", "sinhala-tamil-new-year") or "auto".
data-intensity string | number "medium" Particle density multiplier: "low", "medium", "high".
data-z number 999999 CSS z-index applied to the canvas overlay.
data-base URL (Auto) Custom CDN directory path for lazy-loaded packs.

3 · Platform Installation Guides

Shopify

In Shopify Admin, go to Online Store > Themes > Edit code. Open layout/theme.liquid, find </body>, and paste before it:

theme.liquid
<!-- Paste immediately above </body> in layout/theme.liquid -->
<script src="https://cdn.example.com/v1/festive.js"
        data-festival="auto"
        data-intensity="medium"
        async></script>

WordPress

Use our standalone single-file plugin or paste this hook into your active theme's functions.php:

functions.php
// Add to functions.php or active child theme
add_action('wp_footer', function() {
    echo '<script src="https://cdn.example.com/v1/festive.js" data-festival="auto" data-intensity="medium" async><\/script>';
});

React & Next.js

Use Next.js Script component with strategy="lazyOnload" in your root layout:

app/layout.tsx
// Next.js App Router (app/layout.tsx)
import Script from "next/script";

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>
        {children}
        <Script
          src="https://cdn.example.com/v1/festive.js"
          strategy="lazyOnload"
          data-festival="auto"
          data-intensity="medium"
        />
      </body>
    </html>
  );
}

Google Tag Manager (GTM)

Create a Custom HTML Tag with a trigger set to Window Loaded:

GTM Custom HTML
<!-- Google Tag Manager: Custom HTML Tag triggered on Window Loaded -->
<script src="https://cdn.example.com/v1/festive.js"
        data-festival="auto"
        data-intensity="medium"
        async></script>