domma-js 0.56.0 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/assets/types/generated/public/assets/flags/africa.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/americas.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/asia.d.ts +6 -0
- package/assets/types/generated/public/assets/flags/europe.d.ts +9 -0
- package/assets/types/generated/public/assets/flags/index.d.ts +11 -0
- package/assets/types/generated/public/assets/flags/oceania.d.ts +2 -0
- package/assets/types/generated/public/assets/icons/buildings.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/code.d.ts +2 -0
- package/assets/types/generated/public/assets/icons/commerce.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/communication.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/devices.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/emojis.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/files.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/finance.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/forms.d.ts +5 -0
- package/assets/types/generated/public/assets/icons/health.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/index.d.ts +24 -0
- package/assets/types/generated/public/assets/icons/media.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/navigation.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/seasonal.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/social.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/sport.d.ts +6 -0
- package/assets/types/generated/public/assets/icons/status.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/transport.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/ui.d.ts +7 -0
- package/assets/types/generated/public/assets/icons/weather.d.ts +6 -0
- package/assets/types/generated/src/auth.d.ts +424 -0
- package/assets/types/generated/src/avatar.d.ts +270 -0
- package/assets/types/generated/src/binding-source.d.ts +58 -0
- package/assets/types/generated/src/butterfly-drawing.d.ts +2 -0
- package/assets/types/generated/src/component-factory.d.ts +150 -0
- package/assets/types/generated/src/component.d.ts +162 -0
- package/assets/types/generated/src/components/back-to-top.d.ts +150 -0
- package/assets/types/generated/src/components/badge.d.ts +208 -0
- package/assets/types/generated/src/components/card.d.ts +189 -0
- package/assets/types/generated/src/components/command-palette.d.ts +352 -0
- package/assets/types/generated/src/components/dropzone.d.ts +342 -0
- package/assets/types/generated/src/components/focus-trap.d.ts +238 -0
- package/assets/types/generated/src/components/loader.d.ts +133 -0
- package/assets/types/generated/src/components/modal.d.ts +339 -0
- package/assets/types/generated/src/components/range-slider.d.ts +267 -0
- package/assets/types/generated/src/components/shared.d.ts +91 -0
- package/assets/types/generated/src/components/split-pane.d.ts +239 -0
- package/assets/types/generated/src/components/toast.d.ts +284 -0
- package/assets/types/generated/src/components/tooltip.d.ts +200 -0
- package/assets/types/generated/src/components/virtual-list.d.ts +340 -0
- package/assets/types/generated/src/config.d.ts +193 -0
- package/assets/types/generated/src/context-cursor.d.ts +69 -0
- package/assets/types/generated/src/context-menu.d.ts +596 -0
- package/assets/types/generated/src/dates.d.ts +367 -0
- package/assets/types/generated/src/dom.d.ts +1221 -0
- package/assets/types/generated/src/effects.d.ts +1281 -0
- package/assets/types/generated/src/elements.d.ts +4994 -0
- package/assets/types/generated/src/escape.d.ts +5 -0
- package/assets/types/generated/src/flags-bundle.d.ts +4 -0
- package/assets/types/generated/src/flags.d.ts +338 -0
- package/assets/types/generated/src/forms.d.ts +1060 -0
- package/assets/types/generated/src/globals.d.ts +45 -0
- package/assets/types/generated/src/http.d.ts +131 -0
- package/assets/types/generated/src/i18n.d.ts +261 -0
- package/assets/types/generated/src/icons.d.ts +213 -0
- package/assets/types/generated/src/index.d.ts +249 -0
- package/assets/types/generated/src/input-group.d.ts +135 -0
- package/assets/types/generated/src/models.d.ts +968 -0
- package/assets/types/generated/src/popover.d.ts +413 -0
- package/assets/types/generated/src/router.d.ts +344 -0
- package/assets/types/generated/src/safe-url.d.ts +10 -0
- package/assets/types/generated/src/sanitize.d.ts +97 -0
- package/assets/types/generated/src/schema-builder.d.ts +420 -0
- package/assets/types/generated/src/skeleton.d.ts +135 -0
- package/assets/types/generated/src/smooth-caret.d.ts +61 -0
- package/assets/types/generated/src/sortable.d.ts +368 -0
- package/assets/types/generated/src/storage.d.ts +93 -0
- package/assets/types/generated/src/tables.d.ts +901 -0
- package/assets/types/generated/src/theme.d.ts +262 -0
- package/assets/types/generated/src/ticker-tape-drawing.d.ts +2 -0
- package/assets/types/generated/src/treeview.d.ts +504 -0
- package/assets/types/generated/src/utils.d.ts +1667 -0
- package/assets/types/generated/src/web-components/base/domma-element.d.ts +134 -0
- package/assets/types/generated/src/web-components/index.d.ts +14 -0
- package/assets/types/generated/vendor/domma-reactive.d.ts +587 -0
- package/assets/types/index.d.ts +104 -226
- package/package.json +5 -2
- package/public/dist/bundles/domma-complete.css +20 -14
- package/public/dist/bundles/domma-data-focused.css +20 -14
- package/public/dist/bundles/domma-essentials.css +20 -14
- package/public/dist/bundles/domma-full.css +20 -14
- package/public/dist/bundles/domma-minimal.css +8 -8
- package/public/dist/domma-flags.esm.js +3 -3
- package/public/dist/domma-flags.esm.js.map +1 -1
- package/public/dist/domma-flags.min.js +3 -3
- package/public/dist/domma-flags.min.js.map +1 -1
- package/public/dist/domma-syntax.min.js +3 -3
- package/public/dist/domma.css +3 -3
- package/public/dist/domma.esm.js +5 -5
- package/public/dist/domma.esm.js.map +1 -1
- package/public/dist/domma.min.js +5 -5
- package/public/dist/domma.min.js.map +1 -1
- package/public/dist/elements.css +9 -3
- package/public/dist/grid.css +3 -3
- package/public/dist/syntax.css +3 -3
- package/public/dist/themes/domma-themes.css +3 -3
- package/templates/kickstart/.claude/snippets.md +1 -1
- package/templates/kickstart/CLAUDE.md +1 -1
- package/templates/kickstart/frontend/types/domma.d.ts +7 -4
- package/templates/kickstart-spa/.claude/snippets.md +1 -1
- package/assets/types/config.d.ts +0 -136
- package/assets/types/dates.d.ts +0 -209
- package/assets/types/dom.d.ts +0 -448
- package/assets/types/elements.d.ts +0 -1168
- package/assets/types/flags.d.ts +0 -130
- package/assets/types/http.d.ts +0 -97
- package/assets/types/i18n.d.ts +0 -99
- package/assets/types/icons.d.ts +0 -147
- package/assets/types/models.d.ts +0 -260
- package/assets/types/smooth-caret.d.ts +0 -12
- package/assets/types/storage.d.ts +0 -93
- package/assets/types/tables.d.ts +0 -327
- package/assets/types/theme.d.ts +0 -137
- package/assets/types/utils.d.ts +0 -675
|
@@ -0,0 +1,1281 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domma Effects Module
|
|
3
|
+
* Visual effects and animations for UI elements
|
|
4
|
+
*
|
|
5
|
+
* @module effects
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* What an effect is applied to: a CSS selector, an element, a NodeList or an array of elements.
|
|
9
|
+
* @typedef {string|Element|NodeList|HTMLElement[]} Selector
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The control object every effect returns. Effects without a running state (reveal, ripple)
|
|
13
|
+
* implement pause/resume as no-ops.
|
|
14
|
+
* @typedef {object} EffectControl
|
|
15
|
+
* @property {() => void} pause - Pause the effect
|
|
16
|
+
* @property {() => void} resume - Resume the effect
|
|
17
|
+
* @property {() => void} stop - Stop the effect
|
|
18
|
+
* @property {() => void} restart - Restart the effect from the beginning
|
|
19
|
+
* @property {() => void} destroy - Destroy the effect and clean up all resources
|
|
20
|
+
* @property {() => boolean} isRunning - Check if the effect is currently running
|
|
21
|
+
* @property {() => boolean} isPaused - Check if the effect is paused
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* One step of a scribe action queue: render text, wait, or delete what was rendered.
|
|
25
|
+
* @typedef {object} ScribeAction
|
|
26
|
+
* @property {string} [render] - Text to type
|
|
27
|
+
* @property {'none'|'fade'|'bounce'|'glow'} [effect] - Entrance effect for each rendered unit (default: 'none')
|
|
28
|
+
* @property {string|number} [wait] - Pause: '2s', '500ms' or a number of milliseconds
|
|
29
|
+
* @property {boolean|number|'all'} [undoRender] - Delete text: true = the last render, a number = that many units, 'all' = everything
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* A palette name (see EFFECT_PALETTES; 'theme' reads the active Domma theme's colours) or an
|
|
33
|
+
* array of CSS colour strings.
|
|
34
|
+
* @typedef {'theme'|'rainbow'|'festive'|'gold'|'silver'|'pastel'|'mono'|'sunset'|'ocean'|'forest'|'bridal'|'meadow'|'firefly'|'aqua'|'autumn'|string[]} TickerTapePalette
|
|
35
|
+
*/
|
|
36
|
+
/**
|
|
37
|
+
* Options for `Domma.effects.breathe()`.
|
|
38
|
+
* @typedef {object} BreatheOptions
|
|
39
|
+
* @property {number} [amplitude] - Vertical movement distance in pixels (default: 6)
|
|
40
|
+
* @property {number} [duration] - Complete animation cycle time in milliseconds (default: 3000)
|
|
41
|
+
* @property {string} [easing] - CSS easing function (default: 'ease-in-out')
|
|
42
|
+
* @property {number} [delay] - Initial delay before animation starts in milliseconds (default: 0)
|
|
43
|
+
* @property {number} [stagger] - Delay between multiple elements in milliseconds (default: 0)
|
|
44
|
+
* @property {number|'infinite'} [iterations] - Number of cycles or 'infinite' (default: 'infinite')
|
|
45
|
+
* @property {boolean} [pauseOnHover] - Pause animation when hovering (default: false)
|
|
46
|
+
* @property {boolean} [autoStart] - Start animation immediately (default: true)
|
|
47
|
+
* @property {boolean} [respectMotionPreference] - Honor prefers-reduced-motion (default: true)
|
|
48
|
+
* @property {() => void} [onStart] - Callback when animation starts
|
|
49
|
+
* @property {() => void} [onComplete] - Callback when animation completes
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* Options for `Domma.effects.pulse()`.
|
|
53
|
+
* @typedef {object} PulseOptions
|
|
54
|
+
* @property {number} [scale] - Scale factor (e.g., 1.05 = 5% larger) (default: 1.05)
|
|
55
|
+
* @property {number} [duration] - Complete animation cycle time in milliseconds (default: 2000)
|
|
56
|
+
* @property {string} [easing] - CSS easing function (default: 'ease-in-out')
|
|
57
|
+
* @property {number} [delay] - Initial delay before animation starts (default: 0)
|
|
58
|
+
* @property {number} [stagger] - Delay between multiple elements (default: 0)
|
|
59
|
+
* @property {number|'infinite'} [iterations] - Number of cycles or 'infinite' (default: 'infinite')
|
|
60
|
+
* @property {boolean} [pauseOnHover] - Pause animation when hovering (default: false)
|
|
61
|
+
* @property {boolean} [respectMotionPreference] - Honor prefers-reduced-motion (default: true)
|
|
62
|
+
*/
|
|
63
|
+
/**
|
|
64
|
+
* Options for `Domma.effects.scribe()`.
|
|
65
|
+
* @typedef {object} ScribeOptions
|
|
66
|
+
* @property {'typewriter'|'word'|'sentence'} [mode] - Rendering granularity: 'typewriter' (char-by-char), 'word', or 'sentence' (default: 'typewriter')
|
|
67
|
+
* @property {number} [speed] - Milliseconds per unit when typing (default: 50)
|
|
68
|
+
* @property {number} [deleteSpeed] - Milliseconds per unit when deleting (default: 30)
|
|
69
|
+
* @property {boolean} [cursor] - Show blinking cursor (default: true)
|
|
70
|
+
* @property {string} [cursorChar] - Cursor character (default: '|')
|
|
71
|
+
* @property {boolean} [cursorBlink] - Animate cursor blink (default: true)
|
|
72
|
+
* @property {'caret'|'block'|'underline'} [cursorType] - Cursor style (default: 'caret')
|
|
73
|
+
* @property {boolean|number} [loop] - Loop count: true = infinite, number = specific count (default: false)
|
|
74
|
+
* @property {number} [loopDelay] - Delay between loops in milliseconds (default: 1000)
|
|
75
|
+
* @property {boolean} [pauseOnHover] - Pause animation when hovering (default: false)
|
|
76
|
+
* @property {boolean} [autoStart] - Start animation immediately (default: true)
|
|
77
|
+
* @property {boolean} [respectMotionPreference] - Honor prefers-reduced-motion (default: true)
|
|
78
|
+
* @property {ScribeAction[]} [actions] - Action queue to execute
|
|
79
|
+
* @property {() => void} [onStart] - Callback when animation starts
|
|
80
|
+
* @property {() => void} [onComplete] - Callback when animation completes
|
|
81
|
+
* @property {(unit: string, index: number) => void} [onCharacter] - Callback for each unit rendered (unit, index) - unit can be char/word/sentence depending on mode
|
|
82
|
+
* @property {(text: string) => void} [onRender] - Callback when render action completes (text)
|
|
83
|
+
* @property {(deletedText: string) => void} [onUndoRender] - Callback when undoRender action completes (deletedText)
|
|
84
|
+
* @property {(loopCount: number) => void} [onLoop] - Callback on each loop iteration (loopCount)
|
|
85
|
+
*/
|
|
86
|
+
/**
|
|
87
|
+
* Options for `Domma.effects.reveal()`.
|
|
88
|
+
* @typedef {object} RevealOptions
|
|
89
|
+
* @property {'fade'|'slide-up'|'slide-down'|'slide-left'|'slide-right'|'zoom'|'flip'} [animation] - Animation type: 'fade', 'slide-up', 'slide-down', 'slide-left', 'slide-right', 'zoom', 'flip' (default: 'fade')
|
|
90
|
+
* @property {number} [duration] - Animation duration in ms (default: 600)
|
|
91
|
+
* @property {string} [easing] - CSS easing function (default: 'ease-out')
|
|
92
|
+
* @property {number} [delay] - Delay before animation in ms (default: 0)
|
|
93
|
+
* @property {number} [stagger] - Delay between multiple elements in ms (default: 0)
|
|
94
|
+
* @property {number} [threshold] - IntersectionObserver threshold 0-1 (default: 0.1)
|
|
95
|
+
* @property {string} [rootMargin] - Observer root margin (default: '0px')
|
|
96
|
+
* @property {boolean} [once] - Only animate once (default: true)
|
|
97
|
+
* @property {boolean} [respectMotionPreference] - Honour prefers-reduced-motion (default: true)
|
|
98
|
+
* @property {(element: Element) => void} [onReveal] - Callback per element when revealed
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* Options for `Domma.effects.scramble()`.
|
|
102
|
+
* @typedef {object} ScrambleOptions
|
|
103
|
+
* @property {number} [speed] - Ms per character resolve (default: 50)
|
|
104
|
+
* @property {number} [scrambleSpeed] - Ms between scramble frame updates (default: 30)
|
|
105
|
+
* @property {string} [characters] - Character pool for scramble (default: alphanumeric + symbols)
|
|
106
|
+
* @property {'left-to-right'|'right-to-left'|'random'|'center-out'} [revealOrder] - 'left-to-right', 'right-to-left', 'random', 'center-out' (default: 'left-to-right')
|
|
107
|
+
* @property {number} [scrambleDuration] - How long each char scrambles before resolving in ms (default: 800)
|
|
108
|
+
* @property {number} [stagger] - Delay between multiple elements in ms (default: 0)
|
|
109
|
+
* @property {boolean|number} [loop] - false, true (infinite), or number of loops (default: false)
|
|
110
|
+
* @property {number} [loopDelay] - Ms between loops (default: 2000)
|
|
111
|
+
* @property {boolean} [respectMotionPreference] - Honour prefers-reduced-motion (default: true)
|
|
112
|
+
* @property {() => void} [onComplete] - Callback when animation completes
|
|
113
|
+
* @property {(char: string, index: number) => void} [onCharacter] - Callback per character resolved (char, index)
|
|
114
|
+
*/
|
|
115
|
+
/**
|
|
116
|
+
* Options for `Domma.effects.counter()`.
|
|
117
|
+
* @typedef {object} CounterOptions
|
|
118
|
+
* @property {number} [from] - Start value (default: 0)
|
|
119
|
+
* @property {number|null} [to] - End value (required, or reads from element textContent)
|
|
120
|
+
* @property {number} [duration] - Total count duration in ms (default: 2000)
|
|
121
|
+
* @property {'linear'|'ease-out'|'ease-in-out'} [easing] - 'linear', 'ease-out', 'ease-in-out' (default: 'ease-out')
|
|
122
|
+
* @property {number} [decimals] - Decimal places (default: 0)
|
|
123
|
+
* @property {string} [separator] - Thousands separator (default: ',')
|
|
124
|
+
* @property {string} [prefix] - Text before number (default: '')
|
|
125
|
+
* @property {string} [suffix] - Text after number (default: '')
|
|
126
|
+
* @property {number} [stagger] - Delay between multiple elements in ms (default: 0)
|
|
127
|
+
* @property {'immediate'|'scroll'} [trigger] - 'immediate' or 'scroll' (default: 'immediate')
|
|
128
|
+
* @property {number} [threshold] - Observer threshold when trigger is scroll (default: 0.5)
|
|
129
|
+
* @property {boolean} [respectMotionPreference] - Honour prefers-reduced-motion (default: true)
|
|
130
|
+
* @property {(currentValue: number) => void} [onUpdate] - Callback on each frame (currentValue)
|
|
131
|
+
* @property {() => void} [onComplete] - Callback when counting completes
|
|
132
|
+
*/
|
|
133
|
+
/**
|
|
134
|
+
* Options for `Domma.effects.ripple()`.
|
|
135
|
+
* @typedef {object} RippleOptions
|
|
136
|
+
* @property {string} [colour] - Ripple colour (default: 'rgba(255, 255, 255, 0.35)')
|
|
137
|
+
* @property {number} [duration] - Ripple animation duration in ms (default: 600)
|
|
138
|
+
* @property {number} [opacity] - Starting opacity (default: 0.35)
|
|
139
|
+
* @property {boolean} [unbounded] - Allow ripple to overflow element (default: false)
|
|
140
|
+
* @property {boolean} [centered] - Always ripple from centre (default: false)
|
|
141
|
+
* @property {'click'|'mousedown'|'pointerdown'} [trigger] - 'click', 'mousedown', 'pointerdown' (default: 'pointerdown')
|
|
142
|
+
* @property {boolean} [respectMotionPreference] - Honour prefers-reduced-motion (default: true)
|
|
143
|
+
*/
|
|
144
|
+
/**
|
|
145
|
+
* Options for `Domma.effects.shake()`.
|
|
146
|
+
* @typedef {object} ShakeOptions
|
|
147
|
+
* @property {number} [intensity] - Shake distance in px (default: 6)
|
|
148
|
+
* @property {number} [duration] - Total shake duration in ms (default: 500)
|
|
149
|
+
* @property {'horizontal'|'vertical'|'both'} [direction] - 'horizontal', 'vertical', 'both' (default: 'horizontal')
|
|
150
|
+
* @property {string} [easing] - CSS easing function (default: 'ease-in-out')
|
|
151
|
+
* @property {number} [iterations] - Number of shake cycles (default: 1)
|
|
152
|
+
* @property {number} [stagger] - Delay between elements in ms (default: 0)
|
|
153
|
+
* @property {boolean} [respectMotionPreference] - Honour prefers-reduced-motion (default: true)
|
|
154
|
+
* @property {() => void} [onComplete] - Callback when shake completes
|
|
155
|
+
*/
|
|
156
|
+
/**
|
|
157
|
+
* Options for `Domma.effects.twinkle()`.
|
|
158
|
+
* @typedef {object} TwinkleOptions
|
|
159
|
+
* @property {number} [count] - Number of stars (default: 100)
|
|
160
|
+
* @property {number} [minSize] - Minimum star size in pixels (default: 1)
|
|
161
|
+
* @property {number} [maxSize] - Maximum star size in pixels (default: 3)
|
|
162
|
+
* @property {number} [twinkleSpeed] - Base oscillation speed (default: 0.003)
|
|
163
|
+
* @property {string} [colour] - Star colour (default: 'rgba(255, 240, 200, 1)')
|
|
164
|
+
* @property {number} [zIndex] - Canvas z-index (default: 1)
|
|
165
|
+
* @property {'star'|'circle'} [shape] - Star shape; 'star' draws a 4-pointed star, 'circle' draws a dot (default: 'star')
|
|
166
|
+
* @property {boolean} [respectMotionPreference] - Honour prefers-reduced-motion (default: true)
|
|
167
|
+
*/
|
|
168
|
+
/**
|
|
169
|
+
* Options for `Domma.effects.tickerTape()`.
|
|
170
|
+
* @typedef {object} TickerTapeOptions
|
|
171
|
+
* @property {TickerTapePalette} [palette] - Named theme palette (e.g. 'theme', 'rainbow', 'gold', 'silver', 'festive', 'pastel', 'mono') or a custom array of CSS colour strings (default: 'theme')
|
|
172
|
+
* @property {number} [density] - Average strips on screen at any moment (default: 50)
|
|
173
|
+
* @property {number} [speed] - Fall speed multiplier (1 = default) (default: 1)
|
|
174
|
+
* @property {number} [sway] - Horizontal sway amplitude in pixels (default: 60)
|
|
175
|
+
* @property {number} [rotationSpeed] - Max rotation degrees per frame (default: 6)
|
|
176
|
+
* @property {number} [minWidth] - Minimum strip width in pixels (default: 5)
|
|
177
|
+
* @property {number} [maxWidth] - Maximum strip width in pixels (default: 9)
|
|
178
|
+
* @property {number} [minHeight] - Minimum strip height in pixels (default: 12)
|
|
179
|
+
* @property {number} [maxHeight] - Maximum strip height in pixels (default: 22)
|
|
180
|
+
* @property {number} [fadeStart] - Fraction of fall (0-1) before fade begins (default: 0.55)
|
|
181
|
+
* @property {boolean} [burst] - If true, drops a single batch and stops respawning (default: false)
|
|
182
|
+
* @property {number} [burstCount] - Strips emitted in burst mode (default: 150)
|
|
183
|
+
* @property {number} [zIndex] - Canvas stacking order (default: 1)
|
|
184
|
+
* @property {boolean} [respectMotionPreference] - Honour prefers-reduced-motion (default: true)
|
|
185
|
+
*/
|
|
186
|
+
/**
|
|
187
|
+
* Options for `Domma.effects.butterflies()`.
|
|
188
|
+
* @typedef {object} ButterfliesOptions
|
|
189
|
+
* @property {TickerTapePalette} [palette] - Named palette (e.g. 'meadow', 'firefly', 'aqua', 'autumn' or any ticker-tape palette) or a custom array of CSS colour strings (default: 'meadow')
|
|
190
|
+
* @property {number} [density] - Target butterflies on screen at once (default: 18)
|
|
191
|
+
* @property {number} [speed] - Global speed multiplier (default: 1)
|
|
192
|
+
* @property {number} [wander] - Steering erraticness (default: 1)
|
|
193
|
+
* @property {number} [riseSpeed] - Upward drift bias (default: 0.4)
|
|
194
|
+
* @property {number} [flapSpeed] - Wingbeat rate multiplier (default: 1)
|
|
195
|
+
* @property {number} [minSize] - Minimum wingspan in pixels (default: 14)
|
|
196
|
+
* @property {number} [maxSize] - Maximum wingspan in pixels (default: 26)
|
|
197
|
+
* @property {boolean} [twoTone] - Use two palette colours per butterfly (default: true)
|
|
198
|
+
* @property {boolean} [burst] - Release one batch then settle (default: false)
|
|
199
|
+
* @property {number} [burstCount] - Butterflies released in burst mode (default: 40)
|
|
200
|
+
* @property {number} [zIndex] - Canvas stacking order (default: 1)
|
|
201
|
+
* @property {boolean} [respectMotionPreference] - Honour prefers-reduced-motion (default: true)
|
|
202
|
+
*/
|
|
203
|
+
/**
|
|
204
|
+
* Options for `Domma.effects.strobe()`.
|
|
205
|
+
* @typedef {object} StrobeOptions
|
|
206
|
+
* @property {'club'|'concert'|'police'|'searchlight'|'scanner'|'mood'} [preset] - Named preset (club|concert|police|searchlight|scanner|mood). Individual options override the preset. (default: 'club')
|
|
207
|
+
* @property {Array<'tl'|'tr'|'bl'|'br'>} [origins] - Corners beams emit from: any of 'tl','tr','bl','br'
|
|
208
|
+
* @property {'sweep'|'rotate'} [motion] - 'sweep' (fan back and forth) or 'rotate' (full circle)
|
|
209
|
+
* @property {number} [sweepArc] - Degrees a beam fans across in sweep mode
|
|
210
|
+
* @property {number} [speed] - Sweep/rotation speed multiplier
|
|
211
|
+
* @property {number} [beamWidth] - Angular width of each beam cone in degrees
|
|
212
|
+
* @property {boolean} [flicker] - Blink beams on/off (the strobe character)
|
|
213
|
+
* @property {number} [hz] - Flicker rate in flashes/sec (warns above 5)
|
|
214
|
+
* @property {string[]} [colours] - Beam colours, assigned per beam in order
|
|
215
|
+
* @property {number} [intensity] - Beam brightness 0-1
|
|
216
|
+
* @property {number|null} [duration] - Auto-stop after N ms (default: null)
|
|
217
|
+
* @property {number} [zIndex] - Canvas stacking order (default: 9999)
|
|
218
|
+
* @property {boolean} [respectMotionPreference] - Honour prefers-reduced-motion (default: true)
|
|
219
|
+
*/
|
|
220
|
+
/**
|
|
221
|
+
* The effects module (`Domma.effects`).
|
|
222
|
+
* @typedef {object} Effects
|
|
223
|
+
* @property {typeof breathe} breathe - Sinusoidal floating animation
|
|
224
|
+
* @property {typeof pulse} pulse - Pulsing scale animation
|
|
225
|
+
* @property {typeof scribe} scribe - Text animation with configurable granularity (characters, words, or sentences) and action queue
|
|
226
|
+
* @property {typeof reveal} reveal - Scroll-triggered entrance animations using IntersectionObserver
|
|
227
|
+
* @property {typeof scramble} scramble - Text cipher/decode animation
|
|
228
|
+
* @property {typeof counter} counter - Animated number counting with easing and formatting
|
|
229
|
+
* @property {typeof ripple} ripple - Material Design click ripple effect
|
|
230
|
+
* @property {typeof shake} shake - Attention/error shake animation
|
|
231
|
+
* @property {typeof twinkle} twinkle - Canvas-based twinkling stars animation
|
|
232
|
+
* @property {typeof tickerTape} tickerTape - Canvas-based ticker-tape parade - colourful rectangles fall, sway, rotate, and fade
|
|
233
|
+
* @property {typeof butterflies} butterflies - Canvas-based fluttering butterflies
|
|
234
|
+
* @property {typeof strobe} strobe - Stage-lighting beams sweeping from the corners
|
|
235
|
+
*/
|
|
236
|
+
/**
|
|
237
|
+
* Apply a sinusoidal breathing animation to elements
|
|
238
|
+
* Creates a gentle up-and-down floating motion
|
|
239
|
+
*
|
|
240
|
+
* @param {Selector} selector - Element(s) to animate
|
|
241
|
+
* @param {BreatheOptions} [options] - Configuration options
|
|
242
|
+
* @returns {EffectControl|null} Control object with pause(), resume(), stop(), restart(), destroy() methods
|
|
243
|
+
*
|
|
244
|
+
* @example
|
|
245
|
+
* // Simple usage
|
|
246
|
+
* Domma.effects.breathe('.stat-card');
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* // With configuration
|
|
250
|
+
* const breathe = Domma.effects.breathe('.notification', {
|
|
251
|
+
* amplitude: 8,
|
|
252
|
+
* duration: 2000,
|
|
253
|
+
* pauseOnHover: true,
|
|
254
|
+
* stagger: 100
|
|
255
|
+
* });
|
|
256
|
+
*
|
|
257
|
+
* // Control the animation
|
|
258
|
+
* breathe.pause();
|
|
259
|
+
* breathe.resume();
|
|
260
|
+
* breathe.stop();
|
|
261
|
+
*/
|
|
262
|
+
export function breathe(selector: Selector, options?: BreatheOptions): EffectControl | null;
|
|
263
|
+
/**
|
|
264
|
+
* Apply a pulsing scale animation to elements
|
|
265
|
+
* Creates a grow-and-shrink breathing effect
|
|
266
|
+
*
|
|
267
|
+
* @param {Selector} selector - Element(s) to animate
|
|
268
|
+
* @param {PulseOptions} [options] - Configuration options
|
|
269
|
+
* @returns {EffectControl|null} Control object with pause(), resume(), stop(), restart(), destroy() methods
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* // Simple usage
|
|
273
|
+
* Domma.effects.pulse('.badge');
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* // With configuration
|
|
277
|
+
* Domma.effects.pulse('.notification-dot', {
|
|
278
|
+
* scale: 1.2,
|
|
279
|
+
* duration: 1500
|
|
280
|
+
* });
|
|
281
|
+
*/
|
|
282
|
+
export function pulse(selector: Selector, options?: PulseOptions): EffectControl | null;
|
|
283
|
+
/**
|
|
284
|
+
* Parse a wait duration for a scribe action: '2s', '500ms', or a raw number
|
|
285
|
+
* of milliseconds. Anything unreadable is 0.
|
|
286
|
+
*
|
|
287
|
+
* 'ms' MUST be tested before 's', because 'ms' also ends with 's'. Checking
|
|
288
|
+
* 's' first makes the 'ms' branch unreachable and multiplies every
|
|
289
|
+
* millisecond value by 1000 - a '300ms' wait became five minutes.
|
|
290
|
+
*
|
|
291
|
+
* @param {string|number} value
|
|
292
|
+
* @returns {number} milliseconds
|
|
293
|
+
*/
|
|
294
|
+
export function parseWait(value: string | number): number;
|
|
295
|
+
/**
|
|
296
|
+
* Apply a scribe effect to elements
|
|
297
|
+
* Types text with configurable granularity (characters, words, or sentences) and optional entrance effects
|
|
298
|
+
*
|
|
299
|
+
* @param {Selector} selector - Element(s) to animate
|
|
300
|
+
* @param {ScribeOptions} [options] - Configuration options
|
|
301
|
+
* @returns {EffectControl|null} Control object with pause(), resume(), stop(), restart(), destroy() methods
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* // Simple usage (character mode)
|
|
305
|
+
* Domma.effects.scribe('.hero-title', {
|
|
306
|
+
* mode: 'typewriter',
|
|
307
|
+
* actions: [
|
|
308
|
+
* { render: 'Hello, World!', effect: 'bounce' }
|
|
309
|
+
* ]
|
|
310
|
+
* });
|
|
311
|
+
*
|
|
312
|
+
* @example
|
|
313
|
+
* // Word-by-word rendering
|
|
314
|
+
* Domma.effects.scribe('.demo', {
|
|
315
|
+
* mode: 'word',
|
|
316
|
+
* actions: [
|
|
317
|
+
* { render: 'Welcome to Domma', effect: 'fade' }
|
|
318
|
+
* ]
|
|
319
|
+
* });
|
|
320
|
+
*
|
|
321
|
+
* @example
|
|
322
|
+
* // Complex sequence with undo
|
|
323
|
+
* const scribe = Domma.effects.scribe('.demo', {
|
|
324
|
+
* mode: 'typewriter',
|
|
325
|
+
* speed: 50,
|
|
326
|
+
* actions: [
|
|
327
|
+
* { render: 'Hello', effect: 'fade' },
|
|
328
|
+
* { wait: '2s' },
|
|
329
|
+
* { undoRender: true },
|
|
330
|
+
* { render: 'Welcome to Domma', effect: 'bounce' },
|
|
331
|
+
* { wait: '3s' }
|
|
332
|
+
* ],
|
|
333
|
+
* loop: true
|
|
334
|
+
* });
|
|
335
|
+
*/
|
|
336
|
+
export function scribe(selector: Selector, options?: ScribeOptions): EffectControl | null;
|
|
337
|
+
/**
|
|
338
|
+
* Scroll-triggered entrance animations using IntersectionObserver
|
|
339
|
+
* Elements animate into view when they enter the viewport.
|
|
340
|
+
*
|
|
341
|
+
* @param {Selector} selector - Element(s) to animate
|
|
342
|
+
* @param {RevealOptions} [options] - Configuration options
|
|
343
|
+
* @returns {EffectControl|null} Control object with destroy() method
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* // Simple fade-in on scroll
|
|
347
|
+
* Domma.effects.reveal('.card');
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* // Slide up with stagger
|
|
351
|
+
* Domma.effects.reveal('.feature', {
|
|
352
|
+
* animation: 'slide-up',
|
|
353
|
+
* duration: 800,
|
|
354
|
+
* stagger: 100
|
|
355
|
+
* });
|
|
356
|
+
*/
|
|
357
|
+
export function reveal(selector: Selector, options?: RevealOptions): EffectControl | null;
|
|
358
|
+
/**
|
|
359
|
+
* Text cipher/decode animation
|
|
360
|
+
* Characters cycle through random glyphs before settling on the correct character.
|
|
361
|
+
*
|
|
362
|
+
* @param {Selector} selector - Element(s) to animate
|
|
363
|
+
* @param {ScrambleOptions} [options] - Configuration options
|
|
364
|
+
* @returns {EffectControl|null} Control object with pause(), resume(), stop(), restart(), destroy() methods
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* Domma.effects.scramble('.hero-title');
|
|
368
|
+
*
|
|
369
|
+
* @example
|
|
370
|
+
* Domma.effects.scramble('.heading', {
|
|
371
|
+
* scrambleDuration: 1200,
|
|
372
|
+
* revealOrder: 'random',
|
|
373
|
+
* loop: true,
|
|
374
|
+
* loopDelay: 3000
|
|
375
|
+
* });
|
|
376
|
+
*/
|
|
377
|
+
export function scramble(selector: Selector, options?: ScrambleOptions): EffectControl | null;
|
|
378
|
+
/**
|
|
379
|
+
* Animated number counting effect
|
|
380
|
+
* Smoothly counts from one number to another with easing.
|
|
381
|
+
*
|
|
382
|
+
* @param {Selector} selector - Element(s) to animate
|
|
383
|
+
* @param {CounterOptions} [options] - Configuration options
|
|
384
|
+
* @returns {EffectControl|null} Control object with pause(), resume(), stop(), restart(), destroy() methods
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* // Count from 0 to value in element
|
|
388
|
+
* Domma.effects.counter('.stat-number');
|
|
389
|
+
*
|
|
390
|
+
* @example
|
|
391
|
+
* // Count with formatting
|
|
392
|
+
* Domma.effects.counter('.revenue', {
|
|
393
|
+
* from: 0,
|
|
394
|
+
* to: 1250000,
|
|
395
|
+
* duration: 3000,
|
|
396
|
+
* separator: ',',
|
|
397
|
+
* prefix: '$',
|
|
398
|
+
* decimals: 2
|
|
399
|
+
* });
|
|
400
|
+
*/
|
|
401
|
+
export function counter(selector: Selector, options?: CounterOptions): EffectControl | null;
|
|
402
|
+
/**
|
|
403
|
+
* Material Design click ripple effect
|
|
404
|
+
* Adds a circular wave effect emanating from click/touch point.
|
|
405
|
+
*
|
|
406
|
+
* @param {Selector} selector - Element(s) to add ripple to
|
|
407
|
+
* @param {RippleOptions} [options] - Configuration options
|
|
408
|
+
* @returns {EffectControl|null} Control object with destroy() method
|
|
409
|
+
*
|
|
410
|
+
* @example
|
|
411
|
+
* // Add ripple to buttons
|
|
412
|
+
* Domma.effects.ripple('.btn');
|
|
413
|
+
*
|
|
414
|
+
* @example
|
|
415
|
+
* // Custom colour ripple
|
|
416
|
+
* Domma.effects.ripple('.card', {
|
|
417
|
+
* colour: 'rgba(59, 130, 246, 0.3)',
|
|
418
|
+
* duration: 800
|
|
419
|
+
* });
|
|
420
|
+
*/
|
|
421
|
+
export function ripple(selector: Selector, options?: RippleOptions): EffectControl | null;
|
|
422
|
+
/**
|
|
423
|
+
* Attention/error shake animation
|
|
424
|
+
* Quick shake animation for invalid inputs or attention-grabbing.
|
|
425
|
+
*
|
|
426
|
+
* @param {Selector} selector - Element(s) to shake
|
|
427
|
+
* @param {ShakeOptions} [options] - Configuration options
|
|
428
|
+
* @returns {EffectControl|null} Control object with stop(), restart(), destroy() methods
|
|
429
|
+
*
|
|
430
|
+
* @example
|
|
431
|
+
* // Shake an invalid input
|
|
432
|
+
* Domma.effects.shake('#email-input');
|
|
433
|
+
*
|
|
434
|
+
* @example
|
|
435
|
+
* // Vertical shake with multiple iterations
|
|
436
|
+
* Domma.effects.shake('.alert', {
|
|
437
|
+
* direction: 'vertical',
|
|
438
|
+
* intensity: 4,
|
|
439
|
+
* iterations: 2,
|
|
440
|
+
* onComplete: () => console.log('Shake done')
|
|
441
|
+
* });
|
|
442
|
+
*/
|
|
443
|
+
export function shake(selector: Selector, options?: ShakeOptions): EffectControl | null;
|
|
444
|
+
/**
|
|
445
|
+
* Canvas-based twinkling stars animation
|
|
446
|
+
* Creates an ambient starfield effect, either as a full-page fixed overlay or scoped to a container element
|
|
447
|
+
*
|
|
448
|
+
* @param {Selector|null} selector - CSS selector, Element, or null/'body' for full-page mode
|
|
449
|
+
* @param {TwinkleOptions} [options] - Configuration options
|
|
450
|
+
* @returns {EffectControl|null} Control object with pause(), resume(), stop(), restart(), destroy(), isRunning(), isPaused()
|
|
451
|
+
*
|
|
452
|
+
* @example
|
|
453
|
+
* // Full-page overlay (matches splash page behaviour)
|
|
454
|
+
* const stars = Domma.effects.twinkle(null);
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* // Container-scoped stars
|
|
458
|
+
* const stars = Domma.effects.twinkle('#hero-section', {
|
|
459
|
+
* count: 60,
|
|
460
|
+
* colour: 'rgba(200, 230, 255, 0.9)',
|
|
461
|
+
* shape: 'circle'
|
|
462
|
+
* });
|
|
463
|
+
*
|
|
464
|
+
* // Control methods
|
|
465
|
+
* stars.pause();
|
|
466
|
+
* stars.resume();
|
|
467
|
+
* stars.destroy();
|
|
468
|
+
*/
|
|
469
|
+
export function twinkle(selector: Selector | null, options?: TwinkleOptions): EffectControl | null;
|
|
470
|
+
/**
|
|
471
|
+
* Ticker tape effect - colourful rectangular strips drop from the top of a
|
|
472
|
+
* container (or the viewport), spinning, swaying, and fading as they fall.
|
|
473
|
+
* Reminiscent of a ticker-tape parade. Pass `null` (or omit the selector)
|
|
474
|
+
* for a full-page fixed overlay, or provide a selector to scope strips
|
|
475
|
+
* inside a specific container.
|
|
476
|
+
*
|
|
477
|
+
* @param {Selector|null} selector
|
|
478
|
+
* @param {TickerTapeOptions} [options] - Configuration options
|
|
479
|
+
* @returns {EffectControl|null} Control object with pause(), resume(), stop(), restart(), destroy(), isRunning(), isPaused()
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* // Full-page overlay using current theme colours
|
|
483
|
+
* Domma.effects.tickerTape(null);
|
|
484
|
+
*
|
|
485
|
+
* @example
|
|
486
|
+
* // Container-scoped, festive palette, slower fall
|
|
487
|
+
* Domma.effects.tickerTape('#celebration', {
|
|
488
|
+
* palette: 'festive',
|
|
489
|
+
* density: 60,
|
|
490
|
+
* speed: 0.7
|
|
491
|
+
* });
|
|
492
|
+
*
|
|
493
|
+
* @example
|
|
494
|
+
* // One-shot burst (parade arrives, then settles)
|
|
495
|
+
* Domma.effects.tickerTape('#stage', { burst: true, burstCount: 200 });
|
|
496
|
+
*/
|
|
497
|
+
export function tickerTape(selector: Selector | null, options?: TickerTapeOptions): EffectControl | null;
|
|
498
|
+
/**
|
|
499
|
+
* Butterflies effect - procedurally drawn butterflies wander and rise with
|
|
500
|
+
* flapping wings. Pass `null` (or omit the selector) for a full-page fixed
|
|
501
|
+
* overlay, or a selector to scope them inside a container.
|
|
502
|
+
*
|
|
503
|
+
* @param {Selector|null} selector
|
|
504
|
+
* @param {ButterfliesOptions} [options] - Configuration options
|
|
505
|
+
* @returns {EffectControl|null} Control object with pause(), resume(), stop(), restart(), destroy(), isRunning(), isPaused()
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* Domma.effects.butterflies(null); // full-page meadow
|
|
509
|
+
* Domma.effects.butterflies('#hero', { palette: 'pastel', density: 24 });
|
|
510
|
+
* Domma.effects.butterflies('#card', { burst: true, burstCount: 30 });
|
|
511
|
+
*/
|
|
512
|
+
export function butterflies(selector: Selector | null, options?: ButterfliesOptions): EffectControl | null;
|
|
513
|
+
/**
|
|
514
|
+
* Resolve a strobe-lighting preset name to its option bundle.
|
|
515
|
+
* Unknown names warn and fall back to 'club'.
|
|
516
|
+
* @param {string} name
|
|
517
|
+
* @returns {StrobeOptions}
|
|
518
|
+
*/
|
|
519
|
+
export function resolveStrobePreset(name: string): StrobeOptions;
|
|
520
|
+
/**
|
|
521
|
+
* Strobe lighting effect - light beams emanate from the chosen corners, sweep
|
|
522
|
+
* (or rotate), and brighten where they cross (additive blending). Pass `null`
|
|
523
|
+
* for a full-page overlay, or a selector for a container-scoped rig.
|
|
524
|
+
*
|
|
525
|
+
* Safety: disabled entirely under prefers-reduced-motion. The `flicker` rate
|
|
526
|
+
* (`hz`) is not clamped, but a console warning fires above 5 Hz since rapid
|
|
527
|
+
* flashing can trigger photosensitive seizures.
|
|
528
|
+
*
|
|
529
|
+
* @param {Selector|null} selector
|
|
530
|
+
* @param {StrobeOptions} [options] - Configuration options
|
|
531
|
+
* @returns {EffectControl|null} Control object with pause(), resume(), stop(), restart(), destroy(), isRunning(), isPaused()
|
|
532
|
+
*
|
|
533
|
+
* @example
|
|
534
|
+
* Domma.effects.strobe(null); // full-page club lighting
|
|
535
|
+
* Domma.effects.strobe('#stage', { preset: 'police' });
|
|
536
|
+
* Domma.effects.strobe(null, { preset: 'club', flicker: false, colours: ['#fff'] });
|
|
537
|
+
*/
|
|
538
|
+
export function strobe(selector: Selector | null, options?: StrobeOptions): EffectControl | null;
|
|
539
|
+
/**
|
|
540
|
+
* Resolve a palette specifier into an array of CSS colour strings.
|
|
541
|
+
* - Named keys ('meadow', 'rainbow', …) → preset palette.
|
|
542
|
+
* - 'theme' → reads CSS custom properties from the active Domma theme.
|
|
543
|
+
* - Array → returned as-is.
|
|
544
|
+
*
|
|
545
|
+
* @param {string|string[]} spec
|
|
546
|
+
* @returns {string[]}
|
|
547
|
+
*/
|
|
548
|
+
export function resolvePalette(spec: string | string[]): string[];
|
|
549
|
+
/**
|
|
550
|
+
* Strobe-lighting presets: name -> option bundle.
|
|
551
|
+
* @type {Record<'club'|'concert'|'police'|'searchlight'|'scanner'|'mood', StrobeOptions>}
|
|
552
|
+
*/
|
|
553
|
+
export const STROBE_PRESETS: Record<"club" | "concert" | "police" | "searchlight" | "scanner" | "mood", StrobeOptions>;
|
|
554
|
+
/**
|
|
555
|
+
* Named colour palettes for tickerTape and butterflies: name -> CSS colours.
|
|
556
|
+
* @type {Record<string, string[]>}
|
|
557
|
+
*/
|
|
558
|
+
export const EFFECT_PALETTES: Record<string, string[]>;
|
|
559
|
+
declare const _default: Effects;
|
|
560
|
+
export default _default;
|
|
561
|
+
/**
|
|
562
|
+
* What an effect is applied to: a CSS selector, an element, a NodeList or an array of elements.
|
|
563
|
+
*/
|
|
564
|
+
export type Selector = string | Element | NodeList | HTMLElement[];
|
|
565
|
+
/**
|
|
566
|
+
* The control object every effect returns. Effects without a running state (reveal, ripple)
|
|
567
|
+
* implement pause/resume as no-ops.
|
|
568
|
+
*/
|
|
569
|
+
export type EffectControl = {
|
|
570
|
+
/**
|
|
571
|
+
* - Pause the effect
|
|
572
|
+
*/
|
|
573
|
+
pause: () => void;
|
|
574
|
+
/**
|
|
575
|
+
* - Resume the effect
|
|
576
|
+
*/
|
|
577
|
+
resume: () => void;
|
|
578
|
+
/**
|
|
579
|
+
* - Stop the effect
|
|
580
|
+
*/
|
|
581
|
+
stop: () => void;
|
|
582
|
+
/**
|
|
583
|
+
* - Restart the effect from the beginning
|
|
584
|
+
*/
|
|
585
|
+
restart: () => void;
|
|
586
|
+
/**
|
|
587
|
+
* - Destroy the effect and clean up all resources
|
|
588
|
+
*/
|
|
589
|
+
destroy: () => void;
|
|
590
|
+
/**
|
|
591
|
+
* - Check if the effect is currently running
|
|
592
|
+
*/
|
|
593
|
+
isRunning: () => boolean;
|
|
594
|
+
/**
|
|
595
|
+
* - Check if the effect is paused
|
|
596
|
+
*/
|
|
597
|
+
isPaused: () => boolean;
|
|
598
|
+
};
|
|
599
|
+
/**
|
|
600
|
+
* One step of a scribe action queue: render text, wait, or delete what was rendered.
|
|
601
|
+
*/
|
|
602
|
+
export type ScribeAction = {
|
|
603
|
+
/**
|
|
604
|
+
* - Text to type
|
|
605
|
+
*/
|
|
606
|
+
render?: string;
|
|
607
|
+
/**
|
|
608
|
+
* - Entrance effect for each rendered unit (default: 'none')
|
|
609
|
+
*/
|
|
610
|
+
effect?: "none" | "fade" | "bounce" | "glow";
|
|
611
|
+
/**
|
|
612
|
+
* - Pause: '2s', '500ms' or a number of milliseconds
|
|
613
|
+
*/
|
|
614
|
+
wait?: string | number;
|
|
615
|
+
/**
|
|
616
|
+
* - Delete text: true = the last render, a number = that many units, 'all' = everything
|
|
617
|
+
*/
|
|
618
|
+
undoRender?: boolean | number | "all";
|
|
619
|
+
};
|
|
620
|
+
/**
|
|
621
|
+
* A palette name (see EFFECT_PALETTES; 'theme' reads the active Domma theme's colours) or an
|
|
622
|
+
* array of CSS colour strings.
|
|
623
|
+
*/
|
|
624
|
+
export type TickerTapePalette = "theme" | "rainbow" | "festive" | "gold" | "silver" | "pastel" | "mono" | "sunset" | "ocean" | "forest" | "bridal" | "meadow" | "firefly" | "aqua" | "autumn" | string[];
|
|
625
|
+
/**
|
|
626
|
+
* Options for `Domma.effects.breathe()`.
|
|
627
|
+
*/
|
|
628
|
+
export type BreatheOptions = {
|
|
629
|
+
/**
|
|
630
|
+
* - Vertical movement distance in pixels (default: 6)
|
|
631
|
+
*/
|
|
632
|
+
amplitude?: number;
|
|
633
|
+
/**
|
|
634
|
+
* - Complete animation cycle time in milliseconds (default: 3000)
|
|
635
|
+
*/
|
|
636
|
+
duration?: number;
|
|
637
|
+
/**
|
|
638
|
+
* - CSS easing function (default: 'ease-in-out')
|
|
639
|
+
*/
|
|
640
|
+
easing?: string;
|
|
641
|
+
/**
|
|
642
|
+
* - Initial delay before animation starts in milliseconds (default: 0)
|
|
643
|
+
*/
|
|
644
|
+
delay?: number;
|
|
645
|
+
/**
|
|
646
|
+
* - Delay between multiple elements in milliseconds (default: 0)
|
|
647
|
+
*/
|
|
648
|
+
stagger?: number;
|
|
649
|
+
/**
|
|
650
|
+
* - Number of cycles or 'infinite' (default: 'infinite')
|
|
651
|
+
*/
|
|
652
|
+
iterations?: number | "infinite";
|
|
653
|
+
/**
|
|
654
|
+
* - Pause animation when hovering (default: false)
|
|
655
|
+
*/
|
|
656
|
+
pauseOnHover?: boolean;
|
|
657
|
+
/**
|
|
658
|
+
* - Start animation immediately (default: true)
|
|
659
|
+
*/
|
|
660
|
+
autoStart?: boolean;
|
|
661
|
+
/**
|
|
662
|
+
* - Honor prefers-reduced-motion (default: true)
|
|
663
|
+
*/
|
|
664
|
+
respectMotionPreference?: boolean;
|
|
665
|
+
/**
|
|
666
|
+
* - Callback when animation starts
|
|
667
|
+
*/
|
|
668
|
+
onStart?: () => void;
|
|
669
|
+
/**
|
|
670
|
+
* - Callback when animation completes
|
|
671
|
+
*/
|
|
672
|
+
onComplete?: () => void;
|
|
673
|
+
};
|
|
674
|
+
/**
|
|
675
|
+
* Options for `Domma.effects.pulse()`.
|
|
676
|
+
*/
|
|
677
|
+
export type PulseOptions = {
|
|
678
|
+
/**
|
|
679
|
+
* - Scale factor (e.g., 1.05 = 5% larger) (default: 1.05)
|
|
680
|
+
*/
|
|
681
|
+
scale?: number;
|
|
682
|
+
/**
|
|
683
|
+
* - Complete animation cycle time in milliseconds (default: 2000)
|
|
684
|
+
*/
|
|
685
|
+
duration?: number;
|
|
686
|
+
/**
|
|
687
|
+
* - CSS easing function (default: 'ease-in-out')
|
|
688
|
+
*/
|
|
689
|
+
easing?: string;
|
|
690
|
+
/**
|
|
691
|
+
* - Initial delay before animation starts (default: 0)
|
|
692
|
+
*/
|
|
693
|
+
delay?: number;
|
|
694
|
+
/**
|
|
695
|
+
* - Delay between multiple elements (default: 0)
|
|
696
|
+
*/
|
|
697
|
+
stagger?: number;
|
|
698
|
+
/**
|
|
699
|
+
* - Number of cycles or 'infinite' (default: 'infinite')
|
|
700
|
+
*/
|
|
701
|
+
iterations?: number | "infinite";
|
|
702
|
+
/**
|
|
703
|
+
* - Pause animation when hovering (default: false)
|
|
704
|
+
*/
|
|
705
|
+
pauseOnHover?: boolean;
|
|
706
|
+
/**
|
|
707
|
+
* - Honor prefers-reduced-motion (default: true)
|
|
708
|
+
*/
|
|
709
|
+
respectMotionPreference?: boolean;
|
|
710
|
+
};
|
|
711
|
+
/**
|
|
712
|
+
* Options for `Domma.effects.scribe()`.
|
|
713
|
+
*/
|
|
714
|
+
export type ScribeOptions = {
|
|
715
|
+
/**
|
|
716
|
+
* - Rendering granularity: 'typewriter' (char-by-char), 'word', or 'sentence' (default: 'typewriter')
|
|
717
|
+
*/
|
|
718
|
+
mode?: "typewriter" | "word" | "sentence";
|
|
719
|
+
/**
|
|
720
|
+
* - Milliseconds per unit when typing (default: 50)
|
|
721
|
+
*/
|
|
722
|
+
speed?: number;
|
|
723
|
+
/**
|
|
724
|
+
* - Milliseconds per unit when deleting (default: 30)
|
|
725
|
+
*/
|
|
726
|
+
deleteSpeed?: number;
|
|
727
|
+
/**
|
|
728
|
+
* - Show blinking cursor (default: true)
|
|
729
|
+
*/
|
|
730
|
+
cursor?: boolean;
|
|
731
|
+
/**
|
|
732
|
+
* - Cursor character (default: '|')
|
|
733
|
+
*/
|
|
734
|
+
cursorChar?: string;
|
|
735
|
+
/**
|
|
736
|
+
* - Animate cursor blink (default: true)
|
|
737
|
+
*/
|
|
738
|
+
cursorBlink?: boolean;
|
|
739
|
+
/**
|
|
740
|
+
* - Cursor style (default: 'caret')
|
|
741
|
+
*/
|
|
742
|
+
cursorType?: "caret" | "block" | "underline";
|
|
743
|
+
/**
|
|
744
|
+
* - Loop count: true = infinite, number = specific count (default: false)
|
|
745
|
+
*/
|
|
746
|
+
loop?: boolean | number;
|
|
747
|
+
/**
|
|
748
|
+
* - Delay between loops in milliseconds (default: 1000)
|
|
749
|
+
*/
|
|
750
|
+
loopDelay?: number;
|
|
751
|
+
/**
|
|
752
|
+
* - Pause animation when hovering (default: false)
|
|
753
|
+
*/
|
|
754
|
+
pauseOnHover?: boolean;
|
|
755
|
+
/**
|
|
756
|
+
* - Start animation immediately (default: true)
|
|
757
|
+
*/
|
|
758
|
+
autoStart?: boolean;
|
|
759
|
+
/**
|
|
760
|
+
* - Honor prefers-reduced-motion (default: true)
|
|
761
|
+
*/
|
|
762
|
+
respectMotionPreference?: boolean;
|
|
763
|
+
/**
|
|
764
|
+
* - Action queue to execute
|
|
765
|
+
*/
|
|
766
|
+
actions?: ScribeAction[];
|
|
767
|
+
/**
|
|
768
|
+
* - Callback when animation starts
|
|
769
|
+
*/
|
|
770
|
+
onStart?: () => void;
|
|
771
|
+
/**
|
|
772
|
+
* - Callback when animation completes
|
|
773
|
+
*/
|
|
774
|
+
onComplete?: () => void;
|
|
775
|
+
/**
|
|
776
|
+
* - Callback for each unit rendered (unit, index) - unit can be char/word/sentence depending on mode
|
|
777
|
+
*/
|
|
778
|
+
onCharacter?: (unit: string, index: number) => void;
|
|
779
|
+
/**
|
|
780
|
+
* - Callback when render action completes (text)
|
|
781
|
+
*/
|
|
782
|
+
onRender?: (text: string) => void;
|
|
783
|
+
/**
|
|
784
|
+
* - Callback when undoRender action completes (deletedText)
|
|
785
|
+
*/
|
|
786
|
+
onUndoRender?: (deletedText: string) => void;
|
|
787
|
+
/**
|
|
788
|
+
* - Callback on each loop iteration (loopCount)
|
|
789
|
+
*/
|
|
790
|
+
onLoop?: (loopCount: number) => void;
|
|
791
|
+
};
|
|
792
|
+
/**
|
|
793
|
+
* Options for `Domma.effects.reveal()`.
|
|
794
|
+
*/
|
|
795
|
+
export type RevealOptions = {
|
|
796
|
+
/**
|
|
797
|
+
* - Animation type: 'fade', 'slide-up', 'slide-down', 'slide-left', 'slide-right', 'zoom', 'flip' (default: 'fade')
|
|
798
|
+
*/
|
|
799
|
+
animation?: "fade" | "slide-up" | "slide-down" | "slide-left" | "slide-right" | "zoom" | "flip";
|
|
800
|
+
/**
|
|
801
|
+
* - Animation duration in ms (default: 600)
|
|
802
|
+
*/
|
|
803
|
+
duration?: number;
|
|
804
|
+
/**
|
|
805
|
+
* - CSS easing function (default: 'ease-out')
|
|
806
|
+
*/
|
|
807
|
+
easing?: string;
|
|
808
|
+
/**
|
|
809
|
+
* - Delay before animation in ms (default: 0)
|
|
810
|
+
*/
|
|
811
|
+
delay?: number;
|
|
812
|
+
/**
|
|
813
|
+
* - Delay between multiple elements in ms (default: 0)
|
|
814
|
+
*/
|
|
815
|
+
stagger?: number;
|
|
816
|
+
/**
|
|
817
|
+
* - IntersectionObserver threshold 0-1 (default: 0.1)
|
|
818
|
+
*/
|
|
819
|
+
threshold?: number;
|
|
820
|
+
/**
|
|
821
|
+
* - Observer root margin (default: '0px')
|
|
822
|
+
*/
|
|
823
|
+
rootMargin?: string;
|
|
824
|
+
/**
|
|
825
|
+
* - Only animate once (default: true)
|
|
826
|
+
*/
|
|
827
|
+
once?: boolean;
|
|
828
|
+
/**
|
|
829
|
+
* - Honour prefers-reduced-motion (default: true)
|
|
830
|
+
*/
|
|
831
|
+
respectMotionPreference?: boolean;
|
|
832
|
+
/**
|
|
833
|
+
* - Callback per element when revealed
|
|
834
|
+
*/
|
|
835
|
+
onReveal?: (element: Element) => void;
|
|
836
|
+
};
|
|
837
|
+
/**
|
|
838
|
+
* Options for `Domma.effects.scramble()`.
|
|
839
|
+
*/
|
|
840
|
+
export type ScrambleOptions = {
|
|
841
|
+
/**
|
|
842
|
+
* - Ms per character resolve (default: 50)
|
|
843
|
+
*/
|
|
844
|
+
speed?: number;
|
|
845
|
+
/**
|
|
846
|
+
* - Ms between scramble frame updates (default: 30)
|
|
847
|
+
*/
|
|
848
|
+
scrambleSpeed?: number;
|
|
849
|
+
/**
|
|
850
|
+
* - Character pool for scramble (default: alphanumeric + symbols)
|
|
851
|
+
*/
|
|
852
|
+
characters?: string;
|
|
853
|
+
/**
|
|
854
|
+
* - 'left-to-right', 'right-to-left', 'random', 'center-out' (default: 'left-to-right')
|
|
855
|
+
*/
|
|
856
|
+
revealOrder?: "left-to-right" | "right-to-left" | "random" | "center-out";
|
|
857
|
+
/**
|
|
858
|
+
* - How long each char scrambles before resolving in ms (default: 800)
|
|
859
|
+
*/
|
|
860
|
+
scrambleDuration?: number;
|
|
861
|
+
/**
|
|
862
|
+
* - Delay between multiple elements in ms (default: 0)
|
|
863
|
+
*/
|
|
864
|
+
stagger?: number;
|
|
865
|
+
/**
|
|
866
|
+
* - false, true (infinite), or number of loops (default: false)
|
|
867
|
+
*/
|
|
868
|
+
loop?: boolean | number;
|
|
869
|
+
/**
|
|
870
|
+
* - Ms between loops (default: 2000)
|
|
871
|
+
*/
|
|
872
|
+
loopDelay?: number;
|
|
873
|
+
/**
|
|
874
|
+
* - Honour prefers-reduced-motion (default: true)
|
|
875
|
+
*/
|
|
876
|
+
respectMotionPreference?: boolean;
|
|
877
|
+
/**
|
|
878
|
+
* - Callback when animation completes
|
|
879
|
+
*/
|
|
880
|
+
onComplete?: () => void;
|
|
881
|
+
/**
|
|
882
|
+
* - Callback per character resolved (char, index)
|
|
883
|
+
*/
|
|
884
|
+
onCharacter?: (char: string, index: number) => void;
|
|
885
|
+
};
|
|
886
|
+
/**
|
|
887
|
+
* Options for `Domma.effects.counter()`.
|
|
888
|
+
*/
|
|
889
|
+
export type CounterOptions = {
|
|
890
|
+
/**
|
|
891
|
+
* - Start value (default: 0)
|
|
892
|
+
*/
|
|
893
|
+
from?: number;
|
|
894
|
+
/**
|
|
895
|
+
* - End value (required, or reads from element textContent)
|
|
896
|
+
*/
|
|
897
|
+
to?: number | null;
|
|
898
|
+
/**
|
|
899
|
+
* - Total count duration in ms (default: 2000)
|
|
900
|
+
*/
|
|
901
|
+
duration?: number;
|
|
902
|
+
/**
|
|
903
|
+
* - 'linear', 'ease-out', 'ease-in-out' (default: 'ease-out')
|
|
904
|
+
*/
|
|
905
|
+
easing?: "linear" | "ease-out" | "ease-in-out";
|
|
906
|
+
/**
|
|
907
|
+
* - Decimal places (default: 0)
|
|
908
|
+
*/
|
|
909
|
+
decimals?: number;
|
|
910
|
+
/**
|
|
911
|
+
* - Thousands separator (default: ',')
|
|
912
|
+
*/
|
|
913
|
+
separator?: string;
|
|
914
|
+
/**
|
|
915
|
+
* - Text before number (default: '')
|
|
916
|
+
*/
|
|
917
|
+
prefix?: string;
|
|
918
|
+
/**
|
|
919
|
+
* - Text after number (default: '')
|
|
920
|
+
*/
|
|
921
|
+
suffix?: string;
|
|
922
|
+
/**
|
|
923
|
+
* - Delay between multiple elements in ms (default: 0)
|
|
924
|
+
*/
|
|
925
|
+
stagger?: number;
|
|
926
|
+
/**
|
|
927
|
+
* - 'immediate' or 'scroll' (default: 'immediate')
|
|
928
|
+
*/
|
|
929
|
+
trigger?: "immediate" | "scroll";
|
|
930
|
+
/**
|
|
931
|
+
* - Observer threshold when trigger is scroll (default: 0.5)
|
|
932
|
+
*/
|
|
933
|
+
threshold?: number;
|
|
934
|
+
/**
|
|
935
|
+
* - Honour prefers-reduced-motion (default: true)
|
|
936
|
+
*/
|
|
937
|
+
respectMotionPreference?: boolean;
|
|
938
|
+
/**
|
|
939
|
+
* - Callback on each frame (currentValue)
|
|
940
|
+
*/
|
|
941
|
+
onUpdate?: (currentValue: number) => void;
|
|
942
|
+
/**
|
|
943
|
+
* - Callback when counting completes
|
|
944
|
+
*/
|
|
945
|
+
onComplete?: () => void;
|
|
946
|
+
};
|
|
947
|
+
/**
|
|
948
|
+
* Options for `Domma.effects.ripple()`.
|
|
949
|
+
*/
|
|
950
|
+
export type RippleOptions = {
|
|
951
|
+
/**
|
|
952
|
+
* - Ripple colour (default: 'rgba(255, 255, 255, 0.35)')
|
|
953
|
+
*/
|
|
954
|
+
colour?: string;
|
|
955
|
+
/**
|
|
956
|
+
* - Ripple animation duration in ms (default: 600)
|
|
957
|
+
*/
|
|
958
|
+
duration?: number;
|
|
959
|
+
/**
|
|
960
|
+
* - Starting opacity (default: 0.35)
|
|
961
|
+
*/
|
|
962
|
+
opacity?: number;
|
|
963
|
+
/**
|
|
964
|
+
* - Allow ripple to overflow element (default: false)
|
|
965
|
+
*/
|
|
966
|
+
unbounded?: boolean;
|
|
967
|
+
/**
|
|
968
|
+
* - Always ripple from centre (default: false)
|
|
969
|
+
*/
|
|
970
|
+
centered?: boolean;
|
|
971
|
+
/**
|
|
972
|
+
* - 'click', 'mousedown', 'pointerdown' (default: 'pointerdown')
|
|
973
|
+
*/
|
|
974
|
+
trigger?: "click" | "mousedown" | "pointerdown";
|
|
975
|
+
/**
|
|
976
|
+
* - Honour prefers-reduced-motion (default: true)
|
|
977
|
+
*/
|
|
978
|
+
respectMotionPreference?: boolean;
|
|
979
|
+
};
|
|
980
|
+
/**
|
|
981
|
+
* Options for `Domma.effects.shake()`.
|
|
982
|
+
*/
|
|
983
|
+
export type ShakeOptions = {
|
|
984
|
+
/**
|
|
985
|
+
* - Shake distance in px (default: 6)
|
|
986
|
+
*/
|
|
987
|
+
intensity?: number;
|
|
988
|
+
/**
|
|
989
|
+
* - Total shake duration in ms (default: 500)
|
|
990
|
+
*/
|
|
991
|
+
duration?: number;
|
|
992
|
+
/**
|
|
993
|
+
* - 'horizontal', 'vertical', 'both' (default: 'horizontal')
|
|
994
|
+
*/
|
|
995
|
+
direction?: "horizontal" | "vertical" | "both";
|
|
996
|
+
/**
|
|
997
|
+
* - CSS easing function (default: 'ease-in-out')
|
|
998
|
+
*/
|
|
999
|
+
easing?: string;
|
|
1000
|
+
/**
|
|
1001
|
+
* - Number of shake cycles (default: 1)
|
|
1002
|
+
*/
|
|
1003
|
+
iterations?: number;
|
|
1004
|
+
/**
|
|
1005
|
+
* - Delay between elements in ms (default: 0)
|
|
1006
|
+
*/
|
|
1007
|
+
stagger?: number;
|
|
1008
|
+
/**
|
|
1009
|
+
* - Honour prefers-reduced-motion (default: true)
|
|
1010
|
+
*/
|
|
1011
|
+
respectMotionPreference?: boolean;
|
|
1012
|
+
/**
|
|
1013
|
+
* - Callback when shake completes
|
|
1014
|
+
*/
|
|
1015
|
+
onComplete?: () => void;
|
|
1016
|
+
};
|
|
1017
|
+
/**
|
|
1018
|
+
* Options for `Domma.effects.twinkle()`.
|
|
1019
|
+
*/
|
|
1020
|
+
export type TwinkleOptions = {
|
|
1021
|
+
/**
|
|
1022
|
+
* - Number of stars (default: 100)
|
|
1023
|
+
*/
|
|
1024
|
+
count?: number;
|
|
1025
|
+
/**
|
|
1026
|
+
* - Minimum star size in pixels (default: 1)
|
|
1027
|
+
*/
|
|
1028
|
+
minSize?: number;
|
|
1029
|
+
/**
|
|
1030
|
+
* - Maximum star size in pixels (default: 3)
|
|
1031
|
+
*/
|
|
1032
|
+
maxSize?: number;
|
|
1033
|
+
/**
|
|
1034
|
+
* - Base oscillation speed (default: 0.003)
|
|
1035
|
+
*/
|
|
1036
|
+
twinkleSpeed?: number;
|
|
1037
|
+
/**
|
|
1038
|
+
* - Star colour (default: 'rgba(255, 240, 200, 1)')
|
|
1039
|
+
*/
|
|
1040
|
+
colour?: string;
|
|
1041
|
+
/**
|
|
1042
|
+
* - Canvas z-index (default: 1)
|
|
1043
|
+
*/
|
|
1044
|
+
zIndex?: number;
|
|
1045
|
+
/**
|
|
1046
|
+
* - Star shape; 'star' draws a 4-pointed star, 'circle' draws a dot (default: 'star')
|
|
1047
|
+
*/
|
|
1048
|
+
shape?: "star" | "circle";
|
|
1049
|
+
/**
|
|
1050
|
+
* - Honour prefers-reduced-motion (default: true)
|
|
1051
|
+
*/
|
|
1052
|
+
respectMotionPreference?: boolean;
|
|
1053
|
+
};
|
|
1054
|
+
/**
|
|
1055
|
+
* Options for `Domma.effects.tickerTape()`.
|
|
1056
|
+
*/
|
|
1057
|
+
export type TickerTapeOptions = {
|
|
1058
|
+
/**
|
|
1059
|
+
* - Named theme palette (e.g. 'theme', 'rainbow', 'gold', 'silver', 'festive', 'pastel', 'mono') or a custom array of CSS colour strings (default: 'theme')
|
|
1060
|
+
*/
|
|
1061
|
+
palette?: TickerTapePalette;
|
|
1062
|
+
/**
|
|
1063
|
+
* - Average strips on screen at any moment (default: 50)
|
|
1064
|
+
*/
|
|
1065
|
+
density?: number;
|
|
1066
|
+
/**
|
|
1067
|
+
* - Fall speed multiplier (1 = default) (default: 1)
|
|
1068
|
+
*/
|
|
1069
|
+
speed?: number;
|
|
1070
|
+
/**
|
|
1071
|
+
* - Horizontal sway amplitude in pixels (default: 60)
|
|
1072
|
+
*/
|
|
1073
|
+
sway?: number;
|
|
1074
|
+
/**
|
|
1075
|
+
* - Max rotation degrees per frame (default: 6)
|
|
1076
|
+
*/
|
|
1077
|
+
rotationSpeed?: number;
|
|
1078
|
+
/**
|
|
1079
|
+
* - Minimum strip width in pixels (default: 5)
|
|
1080
|
+
*/
|
|
1081
|
+
minWidth?: number;
|
|
1082
|
+
/**
|
|
1083
|
+
* - Maximum strip width in pixels (default: 9)
|
|
1084
|
+
*/
|
|
1085
|
+
maxWidth?: number;
|
|
1086
|
+
/**
|
|
1087
|
+
* - Minimum strip height in pixels (default: 12)
|
|
1088
|
+
*/
|
|
1089
|
+
minHeight?: number;
|
|
1090
|
+
/**
|
|
1091
|
+
* - Maximum strip height in pixels (default: 22)
|
|
1092
|
+
*/
|
|
1093
|
+
maxHeight?: number;
|
|
1094
|
+
/**
|
|
1095
|
+
* - Fraction of fall (0-1) before fade begins (default: 0.55)
|
|
1096
|
+
*/
|
|
1097
|
+
fadeStart?: number;
|
|
1098
|
+
/**
|
|
1099
|
+
* - If true, drops a single batch and stops respawning (default: false)
|
|
1100
|
+
*/
|
|
1101
|
+
burst?: boolean;
|
|
1102
|
+
/**
|
|
1103
|
+
* - Strips emitted in burst mode (default: 150)
|
|
1104
|
+
*/
|
|
1105
|
+
burstCount?: number;
|
|
1106
|
+
/**
|
|
1107
|
+
* - Canvas stacking order (default: 1)
|
|
1108
|
+
*/
|
|
1109
|
+
zIndex?: number;
|
|
1110
|
+
/**
|
|
1111
|
+
* - Honour prefers-reduced-motion (default: true)
|
|
1112
|
+
*/
|
|
1113
|
+
respectMotionPreference?: boolean;
|
|
1114
|
+
};
|
|
1115
|
+
/**
|
|
1116
|
+
* Options for `Domma.effects.butterflies()`.
|
|
1117
|
+
*/
|
|
1118
|
+
export type ButterfliesOptions = {
|
|
1119
|
+
/**
|
|
1120
|
+
* - Named palette (e.g. 'meadow', 'firefly', 'aqua', 'autumn' or any ticker-tape palette) or a custom array of CSS colour strings (default: 'meadow')
|
|
1121
|
+
*/
|
|
1122
|
+
palette?: TickerTapePalette;
|
|
1123
|
+
/**
|
|
1124
|
+
* - Target butterflies on screen at once (default: 18)
|
|
1125
|
+
*/
|
|
1126
|
+
density?: number;
|
|
1127
|
+
/**
|
|
1128
|
+
* - Global speed multiplier (default: 1)
|
|
1129
|
+
*/
|
|
1130
|
+
speed?: number;
|
|
1131
|
+
/**
|
|
1132
|
+
* - Steering erraticness (default: 1)
|
|
1133
|
+
*/
|
|
1134
|
+
wander?: number;
|
|
1135
|
+
/**
|
|
1136
|
+
* - Upward drift bias (default: 0.4)
|
|
1137
|
+
*/
|
|
1138
|
+
riseSpeed?: number;
|
|
1139
|
+
/**
|
|
1140
|
+
* - Wingbeat rate multiplier (default: 1)
|
|
1141
|
+
*/
|
|
1142
|
+
flapSpeed?: number;
|
|
1143
|
+
/**
|
|
1144
|
+
* - Minimum wingspan in pixels (default: 14)
|
|
1145
|
+
*/
|
|
1146
|
+
minSize?: number;
|
|
1147
|
+
/**
|
|
1148
|
+
* - Maximum wingspan in pixels (default: 26)
|
|
1149
|
+
*/
|
|
1150
|
+
maxSize?: number;
|
|
1151
|
+
/**
|
|
1152
|
+
* - Use two palette colours per butterfly (default: true)
|
|
1153
|
+
*/
|
|
1154
|
+
twoTone?: boolean;
|
|
1155
|
+
/**
|
|
1156
|
+
* - Release one batch then settle (default: false)
|
|
1157
|
+
*/
|
|
1158
|
+
burst?: boolean;
|
|
1159
|
+
/**
|
|
1160
|
+
* - Butterflies released in burst mode (default: 40)
|
|
1161
|
+
*/
|
|
1162
|
+
burstCount?: number;
|
|
1163
|
+
/**
|
|
1164
|
+
* - Canvas stacking order (default: 1)
|
|
1165
|
+
*/
|
|
1166
|
+
zIndex?: number;
|
|
1167
|
+
/**
|
|
1168
|
+
* - Honour prefers-reduced-motion (default: true)
|
|
1169
|
+
*/
|
|
1170
|
+
respectMotionPreference?: boolean;
|
|
1171
|
+
};
|
|
1172
|
+
/**
|
|
1173
|
+
* Options for `Domma.effects.strobe()`.
|
|
1174
|
+
*/
|
|
1175
|
+
export type StrobeOptions = {
|
|
1176
|
+
/**
|
|
1177
|
+
* - Named preset (club|concert|police|searchlight|scanner|mood). Individual options override the preset. (default: 'club')
|
|
1178
|
+
*/
|
|
1179
|
+
preset?: "club" | "concert" | "police" | "searchlight" | "scanner" | "mood";
|
|
1180
|
+
/**
|
|
1181
|
+
* - Corners beams emit from: any of 'tl','tr','bl','br'
|
|
1182
|
+
*/
|
|
1183
|
+
origins?: Array<"tl" | "tr" | "bl" | "br">;
|
|
1184
|
+
/**
|
|
1185
|
+
* - 'sweep' (fan back and forth) or 'rotate' (full circle)
|
|
1186
|
+
*/
|
|
1187
|
+
motion?: "sweep" | "rotate";
|
|
1188
|
+
/**
|
|
1189
|
+
* - Degrees a beam fans across in sweep mode
|
|
1190
|
+
*/
|
|
1191
|
+
sweepArc?: number;
|
|
1192
|
+
/**
|
|
1193
|
+
* - Sweep/rotation speed multiplier
|
|
1194
|
+
*/
|
|
1195
|
+
speed?: number;
|
|
1196
|
+
/**
|
|
1197
|
+
* - Angular width of each beam cone in degrees
|
|
1198
|
+
*/
|
|
1199
|
+
beamWidth?: number;
|
|
1200
|
+
/**
|
|
1201
|
+
* - Blink beams on/off (the strobe character)
|
|
1202
|
+
*/
|
|
1203
|
+
flicker?: boolean;
|
|
1204
|
+
/**
|
|
1205
|
+
* - Flicker rate in flashes/sec (warns above 5)
|
|
1206
|
+
*/
|
|
1207
|
+
hz?: number;
|
|
1208
|
+
/**
|
|
1209
|
+
* - Beam colours, assigned per beam in order
|
|
1210
|
+
*/
|
|
1211
|
+
colours?: string[];
|
|
1212
|
+
/**
|
|
1213
|
+
* - Beam brightness 0-1
|
|
1214
|
+
*/
|
|
1215
|
+
intensity?: number;
|
|
1216
|
+
/**
|
|
1217
|
+
* - Auto-stop after N ms (default: null)
|
|
1218
|
+
*/
|
|
1219
|
+
duration?: number | null;
|
|
1220
|
+
/**
|
|
1221
|
+
* - Canvas stacking order (default: 9999)
|
|
1222
|
+
*/
|
|
1223
|
+
zIndex?: number;
|
|
1224
|
+
/**
|
|
1225
|
+
* - Honour prefers-reduced-motion (default: true)
|
|
1226
|
+
*/
|
|
1227
|
+
respectMotionPreference?: boolean;
|
|
1228
|
+
};
|
|
1229
|
+
/**
|
|
1230
|
+
* The effects module (`Domma.effects`).
|
|
1231
|
+
*/
|
|
1232
|
+
export type Effects = {
|
|
1233
|
+
/**
|
|
1234
|
+
* - Sinusoidal floating animation
|
|
1235
|
+
*/
|
|
1236
|
+
breathe: typeof breathe;
|
|
1237
|
+
/**
|
|
1238
|
+
* - Pulsing scale animation
|
|
1239
|
+
*/
|
|
1240
|
+
pulse: typeof pulse;
|
|
1241
|
+
/**
|
|
1242
|
+
* - Text animation with configurable granularity (characters, words, or sentences) and action queue
|
|
1243
|
+
*/
|
|
1244
|
+
scribe: typeof scribe;
|
|
1245
|
+
/**
|
|
1246
|
+
* - Scroll-triggered entrance animations using IntersectionObserver
|
|
1247
|
+
*/
|
|
1248
|
+
reveal: typeof reveal;
|
|
1249
|
+
/**
|
|
1250
|
+
* - Text cipher/decode animation
|
|
1251
|
+
*/
|
|
1252
|
+
scramble: typeof scramble;
|
|
1253
|
+
/**
|
|
1254
|
+
* - Animated number counting with easing and formatting
|
|
1255
|
+
*/
|
|
1256
|
+
counter: typeof counter;
|
|
1257
|
+
/**
|
|
1258
|
+
* - Material Design click ripple effect
|
|
1259
|
+
*/
|
|
1260
|
+
ripple: typeof ripple;
|
|
1261
|
+
/**
|
|
1262
|
+
* - Attention/error shake animation
|
|
1263
|
+
*/
|
|
1264
|
+
shake: typeof shake;
|
|
1265
|
+
/**
|
|
1266
|
+
* - Canvas-based twinkling stars animation
|
|
1267
|
+
*/
|
|
1268
|
+
twinkle: typeof twinkle;
|
|
1269
|
+
/**
|
|
1270
|
+
* - Canvas-based ticker-tape parade - colourful rectangles fall, sway, rotate, and fade
|
|
1271
|
+
*/
|
|
1272
|
+
tickerTape: typeof tickerTape;
|
|
1273
|
+
/**
|
|
1274
|
+
* - Canvas-based fluttering butterflies
|
|
1275
|
+
*/
|
|
1276
|
+
butterflies: typeof butterflies;
|
|
1277
|
+
/**
|
|
1278
|
+
* - Stage-lighting beams sweeping from the corners
|
|
1279
|
+
*/
|
|
1280
|
+
strobe: typeof strobe;
|
|
1281
|
+
};
|