SkillAgentSearch skills...

Happybirthday

๐ŸŽ‚ A beautiful, config-driven birthday greeting animation. Customize everything from a single file โ€” no coding required! Built with GSAP & Vanilla JS.

Install / Use

/learn @fajarghifar/Happybirthday
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

๐ŸŽ‚ Happy Birthday Animation

A beautiful, animated birthday greeting page built with Vanilla JavaScript and GSAP. Fully customizable through a single config file โ€” no coding skills required!

โœจ Features

  • ๐ŸŽฌ Smooth GSAP animations (typing effect, floating balloons, confetti, fireworks, and more)
  • ๐Ÿงฉ Modular component system โ€” add, remove, or reorder sections by editing one file
  • ๐ŸŒ™ Dark / Light mode toggle
  • ๐Ÿ“ฑ Responsive and mobile-friendly
  • ๐ŸŽต Optional background music
  • โšก No build step, no framework, no server required

๐Ÿš€ Quick Start

  1. Download or clone this repository
  2. Edit config.js to customize the name, photo, message, and sections
  3. Right-click index.html โ†’ Open with Live Server (VS Code) or simply open it in your browser

Tip: If you use VS Code, install the Live Server extension. Then right-click index.html and select "Open with Live Server". That's it!


๐Ÿ“ How to Customize

Everything is controlled from one file: config.js.

1. Change the Recipient

name: "Irene",                        // Recipient's name
photo: "./img/irene.jpg",             // Photo in the img/ folder
music: "./music/hbd.mpeg",            // Music in the music/ folder

2. Choose a Theme

defaultMode: "dark",                   // "dark" or "light"
colors: {
  primary: "#f472b6",                  // Main accent (name, highlights)
  accent: "#60a5fa",                   // Secondary accent (buttons)
  dark:  { background: "#0f172a", text: "#f1f5f9" },
  light: { background: "#fafaf9", text: "#1e293b" },
},

The viewer can also toggle between dark and light mode using the โ˜€๏ธ/๐ŸŒ™ button.

3. Edit Sections

Sections are listed in an array. The display order matches the array order.

Remove a section โ€” delete the object:

sections: [
  { type: "greeting", title: "Hi", subtitle: "..." },
  // { type: "announcement", text: "..." },  โ† removed
  { type: "chatbox", message: "..." },
]

Duplicate a section โ€” copy-paste the object:

{ type: "balloons", count: 25 },
{ type: "balloons", count: 15 },      // shows balloons twice!

Reorder โ€” just move them up or down in the array.


๐Ÿงฉ Available Section Types

| Type | Description | Properties | |------|-------------|------------| | greeting | Opening greeting with name | title, subtitle | | countdown | Animated 3-2-1 countdown | from (start number), goText (finale emoji/text) | | announcement | Simple announcement text | text | | chatbox | Chat bubble with typing effect | message, buttonText | | ideas | Lines revealed one by one | lines[], bigLetters | | quote | Styled quote card | text, author (optional) | | stars | Twinkling stars background | count | | fireworks | Colorful spark burst | count | | balloons | Floating balloons | count | | profile | Profile photo + wish text | wishTitle, wishText | | confetti | Confetti circle burst | count | | closing | Closing message + replay | text, replayText |

Section Details

<details> <summary><strong>greeting</strong></summary>
{ type: "greeting", title: "Hi", subtitle: "I really like your name btw!" }

Shows the recipient's name (from top-level config) with a gradient effect.

</details> <details> <summary><strong>countdown</strong></summary>
{ type: "countdown", from: 3, goText: "๐ŸŽ‰" }

Animated countdown from from to 1, then shows goText. Great before announcements!

</details> <details> <summary><strong>chatbox</strong></summary>
{ type: "chatbox", message: "Happy birthday!!", buttonText: "Send" }

Simulates a chat with a typing animation that reveals the message character by character.

</details> <details> <summary><strong>ideas</strong></summary>
{
  type: "ideas",
  lines: [
    "A normal line.",
    "A line with <strong>bold highlight</strong>.",
    "Last line gets special animation <span>:)</span>",
  ],
  bigLetters: "SO",
}
  • Each line appears and disappears sequentially
  • Use <strong> for highlighted words
  • The last line automatically gets a dramatic animation
  • bigLetters (optional) โ€” large staggered characters after all lines
</details> <details> <summary><strong>quote</strong></summary>
{ type: "quote", text: "Every year is a gift.", author: "Unknown" }

Glassmorphism card with quotation mark, text, and optional author attribution.

</details> <details> <summary><strong>fireworks</strong></summary>
{ type: "fireworks", count: 24 }

Colorful sparks that burst and scatter in random directions. Overlays on top of other content.

</details>

๐Ÿ“ Project Structure

happybirthday/
โ”œโ”€โ”€ config.js                โ† โœจ EDIT THIS FILE ONLY
โ”œโ”€โ”€ index.html               โ† Page template (do not edit)
โ”œโ”€โ”€ script/
โ”‚   โ”œโ”€โ”€ main.js              โ† Engine (do not edit)
โ”‚   โ””โ”€โ”€ components/          โ† Section components
โ”‚       โ”œโ”€โ”€ greeting.js
โ”‚       โ”œโ”€โ”€ announcement.js
โ”‚       โ”œโ”€โ”€ chatbox.js
โ”‚       โ”œโ”€โ”€ countdown.js
โ”‚       โ”œโ”€โ”€ ideas.js
โ”‚       โ”œโ”€โ”€ quote.js
โ”‚       โ”œโ”€โ”€ stars.js
โ”‚       โ”œโ”€โ”€ fireworks.js
โ”‚       โ”œโ”€โ”€ balloons.js
โ”‚       โ”œโ”€โ”€ profile.js
โ”‚       โ”œโ”€โ”€ confetti.js
โ”‚       โ””โ”€โ”€ closing.js
โ”œโ”€โ”€ style/
โ”‚   โ””โ”€โ”€ main.css             โ† Styles (do not edit)
โ”œโ”€โ”€ img/                     โ† Put recipient's photo here
โ””โ”€โ”€ music/                   โ† Put background music here

๐Ÿ”ง Creating Your Own Component

Create a .js file in script/components/ following this template:

(function () {
  window.Components = window.Components || {};

  window.Components.mycomponent = {
    // overlay: true,  โ† Set true if it layers on top of other sections

    render(container, section, config) {
      const div = document.createElement("div");
      div.className = "section section-mycomponent";
      div.innerHTML = `<p>${section.text || "Hello!"}</p>`;
      container.appendChild(div);
      return div;
    },

    animate(tl, el, config) {
      tl.from(el, { duration: 0.7, opacity: 0, y: 20 })
        .to(el, { duration: 0.7, opacity: 0 }, "+=3");
    },

    // Optional: deferred exit (runs after overlays finish)
    // exit(tl, el) {
    //   tl.to(el, { duration: 0.5, opacity: 0 });
    // },
  };
})();

Then use it in config.js:

{ type: "mycomponent", text: "My custom section!" }

Don't forget to add CSS for .section-mycomponent in style/main.css.


๐Ÿ› ๏ธ Built With


๐Ÿค Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

๐Ÿ’– Support

If you find this project helpful, please consider giving it a โญ๏ธ star on GitHub or buying me a coffee!

<a href="https://buymeacoffee.com/fajarghifar" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>


๐Ÿ“„ License

Licensed under the MIT License.


Find me on GitHub ย ยทย  YouTube ย ยทย  Instagram ย ยทย  LinkedIn


View on GitHub
GitHub Stars449
CategoryDevelopment
Updated1d ago
Forks718

Languages

JavaScript

Security Score

100/100

Audited on Mar 23, 2026

No findings