@hortonstudio/main 1.2.18 → 1.2.19
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/animations/hero.js +18 -4
- package/animations/text.js +12 -2
- package/package.json +1 -1
package/animations/hero.js
CHANGED
@@ -174,6 +174,13 @@ export async function init() {
|
|
174
174
|
return;
|
175
175
|
}
|
176
176
|
|
177
|
+
// Check if there's a persistent config stored globally
|
178
|
+
const api = window[API_NAME] || {};
|
179
|
+
if (api.heroAnimations?.config && api.heroAnimations.config !== config) {
|
180
|
+
// Merge persistent config into current config
|
181
|
+
updateConfig(api.heroAnimations.config);
|
182
|
+
}
|
183
|
+
|
177
184
|
if (prefersReducedMotion()) {
|
178
185
|
// For reduced motion, just show elements without animation
|
179
186
|
showHeroElementsWithoutAnimation();
|
@@ -182,7 +189,11 @@ export async function init() {
|
|
182
189
|
window[API_NAME] = window[API_NAME] || {};
|
183
190
|
window[API_NAME].heroAnimations = {
|
184
191
|
config: config,
|
185
|
-
updateConfig:
|
192
|
+
updateConfig: (newConfig) => {
|
193
|
+
updateConfig(newConfig);
|
194
|
+
// Store config reference for persistence across restarts
|
195
|
+
api.heroAnimations.config = config;
|
196
|
+
},
|
186
197
|
start: startHeroAnimations,
|
187
198
|
kill: killHeroAnimations,
|
188
199
|
restart: () => {
|
@@ -583,10 +594,13 @@ export async function init() {
|
|
583
594
|
});
|
584
595
|
|
585
596
|
// API exposure
|
586
|
-
|
587
|
-
window[API_NAME].heroAnimations = {
|
597
|
+
api.heroAnimations = {
|
588
598
|
config: config,
|
589
|
-
updateConfig:
|
599
|
+
updateConfig: (newConfig) => {
|
600
|
+
updateConfig(newConfig);
|
601
|
+
// Store config reference for persistence across restarts
|
602
|
+
api.heroAnimations.config = config;
|
603
|
+
},
|
590
604
|
start: startHeroAnimations,
|
591
605
|
kill: killHeroAnimations,
|
592
606
|
restart: () => {
|
package/animations/text.js
CHANGED
@@ -343,6 +343,13 @@ async function initAnimations() {
|
|
343
343
|
}
|
344
344
|
|
345
345
|
export async function init() {
|
346
|
+
// Check if there's a persistent config stored globally
|
347
|
+
const api = window[API_NAME] || {};
|
348
|
+
if (api.textAnimations?.config && api.textAnimations.config !== config) {
|
349
|
+
// Merge persistent config into current config
|
350
|
+
updateConfig(api.textAnimations.config);
|
351
|
+
}
|
352
|
+
|
346
353
|
if (prefersReducedMotion()) {
|
347
354
|
// For reduced motion, just show elements without animation
|
348
355
|
showElementsWithoutAnimation();
|
@@ -353,10 +360,13 @@ export async function init() {
|
|
353
360
|
|
354
361
|
window.addEventListener('resize', ScrollTrigger.refresh());
|
355
362
|
|
356
|
-
const api = window[API_NAME] || {};
|
357
363
|
api.textAnimations = {
|
358
364
|
config: config,
|
359
|
-
updateConfig:
|
365
|
+
updateConfig: (newConfig) => {
|
366
|
+
updateConfig(newConfig);
|
367
|
+
// Store config reference for persistence across restarts
|
368
|
+
api.textAnimations.config = config;
|
369
|
+
},
|
360
370
|
start: startTextAnimations,
|
361
371
|
kill: killTextAnimations,
|
362
372
|
restart: () => {
|