@hortonstudio/main 1.2.23 → 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,44 +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
- },
185
+ updateConfig: updateConfig,
211
186
  start: startHeroAnimations,
212
187
  kill: killHeroAnimations,
213
188
  restart: () => {
214
- console.log('🔄 Hero animations - restart called');
215
189
  killHeroAnimations();
216
190
  startHeroAnimations();
217
191
  }
@@ -269,7 +243,7 @@ export async function init() {
269
243
  headingElements.forEach(el => {
270
244
  if (el.firstElementChild) {
271
245
  // Get the heroconfig attribute to determine animation type
272
- 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
273
247
 
274
248
  if (heroConfig === 'appear') {
275
249
  headingAppearElements.push(el.firstElementChild);
@@ -345,7 +319,7 @@ export async function init() {
345
319
  if (heading.length > 0) {
346
320
  headingSplitElements.forEach((parent, index) => {
347
321
  const textElement = heading[index];
348
- const splitType = parent.getAttribute('data-hs-heroconfig') || 'word';
322
+ const splitType = parent.getAttribute('data-hs-heroconfig') || 'line';
349
323
 
350
324
  let splitConfig = {};
351
325
  let elementsClass = '';
@@ -609,20 +583,13 @@ export async function init() {
609
583
  });
610
584
 
611
585
  // API exposure
612
- api.heroAnimations = {
586
+ window[API_NAME] = window[API_NAME] || {};
587
+ window[API_NAME].heroAnimations = {
613
588
  config: config,
614
- updateConfig: (newConfig) => {
615
- console.log('🔧 Hero animations - updateConfig called with:', newConfig);
616
- updateConfig(newConfig);
617
- // Store config in persistent storage for restart persistence
618
- api._persistentConfigs = api._persistentConfigs || {};
619
- api._persistentConfigs.heroAnimations = { ...config };
620
- console.log('💾 Hero animations - stored persistent config:', api._persistentConfigs.heroAnimations);
621
- },
589
+ updateConfig: updateConfig,
622
590
  start: startHeroAnimations,
623
591
  kill: killHeroAnimations,
624
592
  restart: () => {
625
- console.log('🔄 Hero animations - restart called');
626
593
  killHeroAnimations();
627
594
  startHeroAnimations();
628
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,20 +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
- },
359
+ updateConfig: updateConfig,
385
360
  start: startTextAnimations,
386
361
  kill: killTextAnimations,
387
362
  restart: () => {
388
- console.log('🔄 Text animations - restart called');
389
363
  killTextAnimations();
390
364
  startTextAnimations();
391
365
  }
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version: 1.2.23
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.23",
3
+ "version": "1.2.25",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "index.js",
6
6
  "type": "module",