@hortonstudio/main 1.1.23 → 1.1.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.
@@ -248,8 +248,11 @@ export async function init() {
248
248
  headingSplits = [];
249
249
 
250
250
  if (heading.length > 0) {
251
- headingSplitElements.forEach((parent, index) => {
252
- const textElement = heading[index];
251
+ // Fresh DOM selection like text.js does
252
+ const freshHeadings = document.querySelectorAll('[data-hs-hero="heading"] > *:first-child');
253
+
254
+ freshHeadings.forEach((textElement, index) => {
255
+ const parent = textElement.parentElement;
253
256
  const splitType = parent.getAttribute('data-hs-heroconfig') || 'word';
254
257
 
255
258
  let splitConfig = {};
@@ -278,19 +281,24 @@ export async function init() {
278
281
  elementsClass = 'words';
279
282
  }
280
283
 
284
+ // Match text.js element state exactly - set autoAlpha before splitting
285
+ gsap.set(textElement, { autoAlpha: 1 });
286
+
281
287
  const split = SplitText.create(textElement, splitConfig);
282
288
  split.elementsClass = elementsClass;
283
289
  headingSplits.push(split);
284
290
 
285
291
  gsap.set(split[elementsClass], { yPercent: config.headingSplit.yPercent });
286
- gsap.set(textElement, { autoAlpha: 1 });
287
292
  });
288
293
  }
289
294
 
290
295
  // Split text setup for subheadings
291
296
  if (subheading.length > 0) {
292
- subheadingSplitElements.forEach((parent, index) => {
293
- const textElement = subheading[index];
297
+ // Fresh DOM selection like text.js does
298
+ const freshSubheadings = document.querySelectorAll('[data-hs-hero="subheading"] > *:first-child');
299
+
300
+ freshSubheadings.forEach((textElement, index) => {
301
+ const parent = textElement.parentElement;
294
302
  const splitType = parent.getAttribute('data-hs-heroconfig') || 'word';
295
303
 
296
304
  let splitConfig = {};
@@ -319,12 +327,14 @@ export async function init() {
319
327
  elementsClass = 'words';
320
328
  }
321
329
 
330
+ // Match text.js element state exactly - set autoAlpha before splitting
331
+ gsap.set(textElement, { autoAlpha: 1 });
332
+
322
333
  const split = SplitText.create(textElement, splitConfig);
323
334
  split.elementsClass = elementsClass;
324
335
  subheadingSplits.push(split);
325
336
 
326
337
  gsap.set(split[elementsClass], { yPercent: config.subheadingSplit.yPercent });
327
- gsap.set(textElement, { autoAlpha: 1 });
328
338
  });
329
339
  }
330
340
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.1.23",
3
+ "version": "1.1.25",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
package/styles.css CHANGED
@@ -11,10 +11,6 @@ body .transition {display: block}
11
11
  margin-inline: -.1em;
12
12
  }
13
13
 
14
- /* safari line detection fix */
15
- [data-hs-hero="heading"] {
16
- text-wrap: wrap !important;
17
- }
18
14
 
19
15
  /* scroll cleanliness */
20
16
  html, body {