🎉 my-holiday-emoji : Celebrate with your users: Automatically inject holiday-themed emojis based on the user's local calendar.
A GeoIP-free solution for injecting regional holiday emojis into your login UI — powered entirely by client-side locale detection. Privacy-aware : No servers. No IP lookups. Just the browser's timezone → country → holidays → emojis. User happiness goes up. 😊
For years, we’ve celebrated the holiday season by adding subtle snow emojis to our interface in the weeks leading up to the New Year.
The response was incredible—users felt more connected to the platform and engagement spiked.
Inspired by this success, we are expanding this initiative to celebrate a diverse range of global holidays and cultural events throughout the year.
browser timezone → country code → public holidays → matched emojis → draw on page
- Detects the user's country from
Intl.DateTimeFormattimezone (no GeoIP needed) - Fetches all national holidays for that country via
date-holidays - Finds holidays today (or in the next N days)
- Matches relevant emojis using regex rules in
my-holiday-emoji.re.js - Draws the emojis on the page — as background, falling snow, or drifting animation
<script type="module">
import MyHolidayEmoji from "https://raw.githack.com/ZacSadan/my-holiday-emoji/main/my-holiday-emoji.js";
const mhe = new MyHolidayEmoji();
mhe.draw("snow");
</script>That's it. The library auto-detects the country and today's date and holiday.
import MyHolidayEmoji from "https://raw.githack.com/ZacSadan/my-holiday-emoji/main/my-holiday-emoji.js";
const mhe = new MyHolidayEmoji(["public", "bank"]);
mhe.setDaysAhead(7);
// Start showing Christmas decorations 2 weeks early
mhe.setHolidayDaysAhread(/\bchristmas\b/i, 14);
mhe.setHolidayDaysAhread(/\bnew year'?s\b/i, 14);
// Custom emoji override
mhe.setEmoji(/\bchristmas\b/i, "🎄");
// Draw as falling snow
mhe.draw("snow");Creates a new instance. Optionally filter which holiday types to consider.
// All holiday types (default)
const mhe = new MyHolidayEmoji();
// Only specific types
const mhe = new MyHolidayEmoji(["public", "bank", "optional", "school", "observance"]);Renders emojis on the page. Calling draw() again with a different mode replaces the previous one.
| Mode | Effect |
|---|---|
"bg" |
Scattered emojis behind the page at low opacity |
"snow" |
Emojis fall from the top of the page |
"pacman" |
1–2 emojis drift horizontally across the screen |
"hideall" |
Removes all drawn emojis |
Hover over any emoji to see the holiday name as a tooltip.
mhe.draw("bg");
mhe.draw("snow");
mhe.draw("pacman");
mhe.draw("hideall");Returns the matched holidays and their emojis for the current country/date window.
const results = mhe.getEmojis();
// [{ name: "Christmas Day", date: "2025-12-25", emojis: ["🎅"] }, ...]Returns the detected (or overridden) country code.
const country = mhe.getCountry(); // e.g. "US", "DE", "IL"Look ahead N days from today when searching for holidays. Default is 0 (today only).
mhe.setDaysAhead(3); // match holidays in the next 3 daysOverride the lookahead window for a specific holiday matched by regex.
mhe.setHolidayDaysAhread(/\bchristmas\b/i, 14); // show 🎅 starting 14 days before Christmas
mhe.setHolidayDaysAhread(/\bnew year'?s\b/i, 14);Override the emoji for any holiday matched by regex.
mhe.setEmoji(/\bchristmas\b/i, "🎄"); // replace default 🎅 with 🎄Override the auto-detected country.
mhe.setCountry("DE"); // GermanyOverride today's date (useful for testing).
mhe.setDate("2025-12-25");const { default: MyHolidayEmoji } = await import("https://raw.githack.com/ZacSadan/my-holiday-emoji/main/my-holiday-emoji.js");
const mhe = new MyHolidayEmoji();
mhe.setDaysAhead(14);
mhe.setCountry("US");
mhe.setDate("2025-12-20");
mhe.draw("snow");
Emojis are matched by regex rules in my-holiday-emoji.re.js. Currently covers:
| Region | Holidays |
|---|---|
| Universal | New Year's, Christmas, Easter, Valentine's Day, Mother's/Father's Day, Labour Day, Thanksgiving |
| 🇺🇸 United States | MLK Day, Presidents' Day, Memorial Day, Juneteenth, Veterans Day |
| 🇨🇦 Canada | Canada Day, Victoria Day, Remembrance Day |
| 🇬🇧 United Kingdom | Boxing Day, Bank Holidays |
| 🇩🇪 Germany | German Unity Day, Reformation Day |
| 🇺🇦 Ukraine | Constitution Day, Defender's Day |
| 🇮🇳 India | Republic Day, Gandhi Jayanti, Diwali, Holi |
| 🇮🇱 Israel | Rosh Hashanah, Yom Kippur, Hanukkah, Passover, Purim, and more |
Adding new rules is as simple as adding a line to my-holiday-emoji.re.js.
| File | Purpose |
|---|---|
my-holiday-emoji.js |
Main library — MyHolidayEmoji class |
my-holiday-emoji.re.js |
Holiday → emoji regex rules |
test.html |
Interactive debug/test page |
Loaded automatically via CDN — no install needed.
date-holidays— holiday data for 200+ countriescountries-and-timezones— timezone → country mapping

