@hortonstudio/main 1.1.26 → 1.1.27
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 +13 -30
- package/package.json +1 -1
package/animations/hero.js
CHANGED
@@ -24,7 +24,7 @@ let heroTimeout = null; // Track the setTimeout
|
|
24
24
|
|
25
25
|
const config = {
|
26
26
|
global: {
|
27
|
-
animationDelay: 0.
|
27
|
+
animationDelay: 0.2
|
28
28
|
},
|
29
29
|
headingSplit: {
|
30
30
|
duration: 1.5,
|
@@ -248,11 +248,8 @@ export async function init() {
|
|
248
248
|
headingSplits = [];
|
249
249
|
|
250
250
|
if (heading.length > 0) {
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
freshHeadings.forEach((textElement, index) => {
|
255
|
-
const parent = textElement.parentElement;
|
251
|
+
headingSplitElements.forEach((parent, index) => {
|
252
|
+
const textElement = heading[index];
|
256
253
|
const splitType = parent.getAttribute('data-hs-heroconfig') || 'word';
|
257
254
|
|
258
255
|
let splitConfig = {};
|
@@ -281,31 +278,19 @@ export async function init() {
|
|
281
278
|
elementsClass = 'words';
|
282
279
|
}
|
283
280
|
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
const split = SplitText.create(textElement, splitConfig);
|
291
|
-
split.elementsClass = elementsClass;
|
292
|
-
headingSplits.push(split);
|
293
|
-
textElement.splitTextInstance = split;
|
294
|
-
|
295
|
-
gsap.set(split[elementsClass], { yPercent: config.headingSplit.yPercent });
|
296
|
-
gsap.set(textElement, { autoAlpha: 1 });
|
297
|
-
}
|
298
|
-
});
|
281
|
+
const split = new SplitText(textElement, splitConfig);
|
282
|
+
split.elementsClass = elementsClass;
|
283
|
+
headingSplits.push(split);
|
284
|
+
|
285
|
+
gsap.set(split[elementsClass], { yPercent: config.headingSplit.yPercent });
|
286
|
+
gsap.set(textElement, { autoAlpha: 1 });
|
299
287
|
});
|
300
288
|
}
|
301
289
|
|
302
290
|
// Split text setup for subheadings
|
303
291
|
if (subheading.length > 0) {
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
freshSubheadings.forEach((textElement, index) => {
|
308
|
-
const parent = textElement.parentElement;
|
292
|
+
subheadingSplitElements.forEach((parent, index) => {
|
293
|
+
const textElement = subheading[index];
|
309
294
|
const splitType = parent.getAttribute('data-hs-heroconfig') || 'word';
|
310
295
|
|
311
296
|
let splitConfig = {};
|
@@ -334,14 +319,12 @@ export async function init() {
|
|
334
319
|
elementsClass = 'words';
|
335
320
|
}
|
336
321
|
|
337
|
-
|
338
|
-
gsap.set(textElement, { autoAlpha: 1 });
|
339
|
-
|
340
|
-
const split = SplitText.create(textElement, splitConfig);
|
322
|
+
const split = new SplitText(textElement, splitConfig);
|
341
323
|
split.elementsClass = elementsClass;
|
342
324
|
subheadingSplits.push(split);
|
343
325
|
|
344
326
|
gsap.set(split[elementsClass], { yPercent: config.subheadingSplit.yPercent });
|
327
|
+
gsap.set(textElement, { autoAlpha: 1 });
|
345
328
|
});
|
346
329
|
}
|
347
330
|
|