Every theme publishes the individual traits it draws - Santa's sleigh, the steam train, the witches - and any of them can be switched off or thinned out. Changes apply straight away.
Dec 1 - Jan 1
32 DaysOct 26-31
6 DaysFeb 9-14
6 DaysNov 1-5
5 DaysMar 12-17 ⢠Ireland
6 DaysNov 25-30 ⢠Scotland
6 DaysFeb 24-Mar 1 ⢠Wales
6 DaysApr 18-23 ⢠England
6 Days
Celebrations are their own package - domma-celebrate - so they can be used on a
site with no Domma in it. Domma ships the build at dist/celebrate/ and the layout
system drives it for you.
The layout system detects the current date and offers the toggle only during a celebration period. Nothing else to write:
<!-- Include Domma -->
<script src="dist/domma.min.js"></script>
<!-- Include Layout System (handles celebrations automatically) -->
<script type="module" src="layouts/js/layout.js"></script>
For testing or manual control, drive an instance yourself:
import { Celebrations } from './dist/celebrate/domma-celebrate.esm.js';
const celebrations = new Celebrations({
theme: 'christmas', // or 'auto' for date detection
intensity: 'medium', // 'light', 'medium', or 'heavy'
enabled: true
});
// Returns false when there is nothing to show - no celebration in season,
// or a visitor who has asked for reduced motion. It never throws.
await celebrations.init();
// Change theme dynamically
await celebrations.setTheme('halloween');
// Change intensity
celebrations.setIntensity('heavy');
// Pause/resume
celebrations.pause();
celebrations.start();
// Cleanup
celebrations.destroy();
A theme is not one switch. You may want the snow and the trees but not a steam train crossing your header:
const celebrations = new Celebrations({
theme: 'christmas',
traits: {
train: false, // no steam train
elf: false, // no elves
tree: 0.5, // half as many trees
firework: 2 // twice as many fireworks
}
});
// Or at runtime
celebrations.setTrait('sleigh', false);
celebrations.setTraits({ robin: false, wreath: 0.5 });
// What can this theme switch?
celebrations.getTraits();
false is off and a number is a density multiplier - 0 is off,
1 is untouched, 2 is twice as many. The panel at the top of this
page is built from getTraits().
The same package works on any site, from a single script tag:
<script src="domma-celebrate.min.js" data-celebrate></script>
That mounts the canvas and a control disc of its own, and remembers whether the visitor
turned it off. See npm install domma-celebrate.
When theme is set to 'auto', the system automatically:
null if no celebration is currently active