@hortonstudio/main 1.2.24 → 1.2.25

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.
@@ -33,7 +33,9 @@
33
33
  "Bash(ls:*)",
34
34
  "Bash(cp:*)",
35
35
  "Bash(git remote remove:*)",
36
- "Bash(tree:*)"
36
+ "Bash(tree:*)",
37
+ "Bash(grep:*)",
38
+ "Bash(git reset:*)"
37
39
  ],
38
40
  "deny": []
39
41
  }
@@ -174,45 +174,18 @@ 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
- console.log('🔄 Hero animations init - full API object:', api);
180
- console.log('🔄 Hero animations init - _persistentConfigs:', api._persistentConfigs);
181
- console.log('🔄 Hero animations init - checking persistent config:', api._persistentConfigs?.heroAnimations);
182
-
183
- // Ensure _persistentConfigs exists
184
- if (!api._persistentConfigs) {
185
- api._persistentConfigs = {};
186
- console.log('🏗️ Hero animations - created _persistentConfigs object');
187
- }
188
-
189
- if (api._persistentConfigs?.heroAnimations) {
190
- console.log('📝 Hero animations - applying persistent config:', api._persistentConfigs.heroAnimations);
191
- // Merge persistent config into current config
192
- updateConfig(api._persistentConfigs.heroAnimations);
193
- console.log('✅ Hero animations - config after merge:', config);
194
- }
195
-
196
177
  if (prefersReducedMotion()) {
197
178
  // For reduced motion, just show elements without animation
198
179
  showHeroElementsWithoutAnimation();
199
180
 
200
181
  // Still expose the API for consistency
201
- api.heroAnimations = {
182
+ window[API_NAME] = window[API_NAME] || {};
183
+ window[API_NAME].heroAnimations = {
202
184
  config: config,
203
- updateConfig: (newConfig) => {
204
- console.log('🔧 Hero animations - updateConfig called with:', newConfig);
205
- updateConfig(newConfig);
206
- // Store config in persistent storage for restart persistence
207
- api._persistentConfigs = api._persistentConfigs || {};
208
- api._persistentConfigs.heroAnimations = { ...config };
209
- console.log('💾 Hero animations - stored persistent config:', api._persistentConfigs.heroAnimations);
210
- console.log('💾 Hero animations - full _persistentConfigs after store:', api._persistentConfigs);
211
- },
185
+ updateConfig: updateConfig,
212
186
  start: startHeroAnimations,
213
187
  kill: killHeroAnimations,
214
188
  restart: () => {
215
- console.log('🔄 Hero animations - restart called');
216
189
  killHeroAnimations();
217
190
  startHeroAnimations();
218
191
  }
@@ -270,7 +243,7 @@ export async function init() {
270
243
  headingElements.forEach(el => {
271
244
  if (el.firstElementChild) {
272
245
  // Get the heroconfig attribute to determine animation type
273
- const heroConfig = el.getAttribute('data-hs-heroconfig') || 'word'; // default to word if not specified
246
+ const heroConfig = el.getAttribute('data-hs-heroconfig') || 'line'; // default to line if not specified
274
247
 
275
248
  if (heroConfig === 'appear') {
276
249
  headingAppearElements.push(el.firstElementChild);
@@ -346,7 +319,7 @@ export async function init() {
346
319
  if (heading.length > 0) {
347
320
  headingSplitElements.forEach((parent, index) => {
348
321
  const textElement = heading[index];
349
- const splitType = parent.getAttribute('data-hs-heroconfig') || 'word';
322
+ const splitType = parent.getAttribute('data-hs-heroconfig') || 'line';
350
323
 
351
324
  let splitConfig = {};
352
325
  let elementsClass = '';
@@ -610,21 +583,13 @@ export async function init() {
610
583
  });
611
584
 
612
585
  // API exposure
613
- api.heroAnimations = {
586
+ window[API_NAME] = window[API_NAME] || {};
587
+ window[API_NAME].heroAnimations = {
614
588
  config: config,
615
- updateConfig: (newConfig) => {
616
- console.log('🔧 Hero animations - updateConfig called with:', newConfig);
617
- updateConfig(newConfig);
618
- // Store config in persistent storage for restart persistence
619
- api._persistentConfigs = api._persistentConfigs || {};
620
- api._persistentConfigs.heroAnimations = { ...config };
621
- console.log('💾 Hero animations - stored persistent config:', api._persistentConfigs.heroAnimations);
622
- console.log('💾 Hero animations - full _persistentConfigs after store:', api._persistentConfigs);
623
- },
589
+ updateConfig: updateConfig,
624
590
  start: startHeroAnimations,
625
591
  kill: killHeroAnimations,
626
592
  restart: () => {
627
- console.log('🔄 Hero animations - restart called');
628
593
  killHeroAnimations();
629
594
  startHeroAnimations();
630
595
  }
@@ -11,7 +11,7 @@ const config = {
11
11
  },
12
12
  wordSplit: {
13
13
  duration: 1.5,
14
- stagger: 0.075,
14
+ stagger: 0.05,
15
15
  yPercent: 110,
16
16
  ease: "power4.out",
17
17
  start: "top 97%"
@@ -25,7 +25,7 @@ const config = {
25
25
  },
26
26
  charSplit: {
27
27
  duration: 1.2,
28
- stagger: 0.03,
28
+ stagger: 0.015,
29
29
  yPercent: 110,
30
30
  ease: "power4.out",
31
31
  start: "top 97%"
@@ -343,25 +343,6 @@ 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
- console.log('🔄 Text animations init - full API object:', api);
349
- console.log('🔄 Text animations init - _persistentConfigs:', api._persistentConfigs);
350
- console.log('🔄 Text animations init - checking persistent config:', api._persistentConfigs?.textAnimations);
351
-
352
- // Ensure _persistentConfigs exists
353
- if (!api._persistentConfigs) {
354
- api._persistentConfigs = {};
355
- console.log('🏗️ Text animations - created _persistentConfigs object');
356
- }
357
-
358
- if (api._persistentConfigs?.textAnimations) {
359
- console.log('📝 Text animations - applying persistent config:', api._persistentConfigs.textAnimations);
360
- // Merge persistent config into current config
361
- updateConfig(api._persistentConfigs.textAnimations);
362
- console.log('✅ Text animations - config after merge:', config);
363
- }
364
-
365
346
  if (prefersReducedMotion()) {
366
347
  // For reduced motion, just show elements without animation
367
348
  showElementsWithoutAnimation();
@@ -372,21 +353,13 @@ export async function init() {
372
353
 
373
354
  window.addEventListener('resize', ScrollTrigger.refresh());
374
355
 
356
+ const api = window[API_NAME] || {};
375
357
  api.textAnimations = {
376
358
  config: config,
377
- updateConfig: (newConfig) => {
378
- console.log('🔧 Text animations - updateConfig called with:', newConfig);
379
- updateConfig(newConfig);
380
- // Store config in persistent storage for restart persistence
381
- api._persistentConfigs = api._persistentConfigs || {};
382
- api._persistentConfigs.textAnimations = { ...config };
383
- console.log('💾 Text animations - stored persistent config:', api._persistentConfigs.textAnimations);
384
- console.log('💾 Text animations - full _persistentConfigs after store:', api._persistentConfigs);
385
- },
359
+ updateConfig: updateConfig,
386
360
  start: startTextAnimations,
387
361
  kill: killTextAnimations,
388
362
  restart: () => {
389
- console.log('🔄 Text animations - restart called');
390
363
  killTextAnimations();
391
364
  startTextAnimations();
392
365
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version: 1.2.24
1
+ // Version:1.2.25
2
2
 
3
3
  const API_NAME = 'hsmain';
4
4
 
@@ -109,18 +109,12 @@ const initializeHsMain = async () => {
109
109
 
110
110
  const readyCallbacks = [];
111
111
 
112
- // Initialize persistent config storage first, preserving any existing configs
113
- const existingConfigs = window[API_NAME]?._persistentConfigs || {};
114
- console.log('🏗️ Initializing main API - existing persistent configs:', existingConfigs);
115
-
116
112
  window[API_NAME] = {
117
113
  scripts,
118
114
  modules: {},
119
115
  process: new Set(),
120
116
  load: loadModule,
121
117
  loaded: false,
122
- // Persistent config storage
123
- _persistentConfigs: existingConfigs,
124
118
  push(...items) {
125
119
  for (const [moduleName, callback] of items) {
126
120
  if (typeof callback === 'function') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.2.24",
3
+ "version": "1.2.25",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",