@widelab-nc/widelab 1.1.39 → 1.1.41

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@widelab-nc/widelab",
3
- "version": "1.1.39",
3
+ "version": "1.1.41",
4
4
  "description": "Widelab starter template based on Finsweet template + add-ons.",
5
5
  "homepage": "https://widelab.co",
6
6
  "license": "ISC",
package/src/index.js CHANGED
@@ -481,56 +481,116 @@ window.customCursorTextUpdate = function(el) {
481
481
 
482
482
 
483
483
 
484
- // Hero animation on load
485
- window.heroAnimationOnLoad = function(e) {
486
- const videoMask = e.querySelector('.hero_headline_ract-mask');
487
- const heroAnimation = gsap.timeline({}),
488
- homeHeroHeading = new SplitText('#heroHeading', {
489
- type: 'lines',
490
- linesClass: 'hero-line',
491
- }),
492
- homeHeroHeadingMask = new SplitText('#heroHeading', {
493
- type: 'lines',
494
- linesClass: 'hero-line-mask',
495
- });
496
- heroAnimation.from('.navbar', {
497
- opacity: 0,
498
- duration: 0.6,
484
+ window.heroAnimationOnLoad = function(e) {
485
+ const videoMask = e.querySelector('.hero_headline_ract-mask');
486
+ const heroAnimation = gsap.timeline({}),
487
+ homeHeroHeading = new SplitText('#heroHeading', {
488
+ type: 'lines',
489
+ linesClass: 'hero-line',
490
+ }),
491
+ homeHeroHeadingMask = new SplitText('#heroHeading', {
492
+ type: 'lines',
493
+ linesClass: 'hero-line-mask',
494
+ });
495
+
496
+ heroAnimation.from('.navbar', {
497
+ opacity: 0,
498
+ duration: 0.6,
499
+ ease: 'loader2',
500
+ }, '>+0.4');
501
+
502
+ heroAnimation.from(
503
+ '.hero-line',
504
+ {
505
+ duration: 1.2,
506
+ y: '100%',
507
+ stagger: 0.2,
499
508
  ease: 'loader2',
500
509
  },
501
- '>+0.4');
502
- heroAnimation.from(
503
- '.hero-line',
504
- {
505
- duration: 1.2,
506
- y: '100%',
507
- stagger: 0.2,
508
- ease: 'loader2',
509
- },
510
- '>-0.5'
511
- );
512
- if (videoMask) {
513
- heroAnimation.to(
514
- '.hero_headline_ract-mask',
515
- {
516
- width: '0%',
517
- duration: 0.6,
518
- ease: 'loader2',
519
- },
520
- '>-0.6'
521
- );
522
- }
523
- heroAnimation.from(
524
- '#heroBottomWrapper',
510
+ '>-0.5'
511
+ );
512
+
513
+ if (videoMask) {
514
+ heroAnimation.to(
515
+ '.hero_headline_ract-mask',
525
516
  {
526
- opacity: 0,
527
- duration: 1,
517
+ width: '0%',
518
+ duration: 0.6,
528
519
  ease: 'loader2',
529
520
  },
530
- '>-0.4'
521
+ '>-0.6'
531
522
  );
532
523
  }
533
524
 
525
+ heroAnimation.from(
526
+ '#heroBottomWrapper',
527
+ {
528
+ opacity: 0,
529
+ duration: 1,
530
+ ease: 'loader2',
531
+ },
532
+ '>-0.4'
533
+ );
534
+
535
+ heroAnimation.call(() => {
536
+ const rotateEl = e.querySelector('[rotate-text]');
537
+ if (!rotateEl) return;
538
+
539
+ const attrValue = rotateEl.getAttribute('rotate-text') || '';
540
+ const extraPhrases = attrValue
541
+ .split(',')
542
+ .map(s => s.trim())
543
+ .filter(Boolean);
544
+
545
+ const defaultText = rotateEl.textContent.trim();
546
+ const phrases = [defaultText, ...extraPhrases];
547
+
548
+ if (phrases.length < 2) return;
549
+
550
+ rotateEl.style.display = 'inline-block';
551
+ rotateEl.style.overflow = 'hidden';
552
+ rotateEl.style.verticalAlign = 'bottom';
553
+ rotateEl.style.position = 'relative';
554
+
555
+ let currentSpan = document.createElement('span');
556
+ currentSpan.style.display = 'inline-block';
557
+ currentSpan.textContent = phrases[0];
558
+ rotateEl.textContent = '';
559
+ rotateEl.appendChild(currentSpan);
560
+
561
+ let current = 0;
562
+ const DURATION = 1.2;
563
+ const EASE = 'loader2';
564
+ const PAUSE = 2200;
565
+
566
+ function rotateTo(nextIndex) {
567
+ const incoming = document.createElement('span');
568
+ incoming.style.cssText = 'display:inline-block; position:absolute; left:0; top:0; white-space:nowrap;';
569
+ incoming.textContent = phrases[nextIndex];
570
+ rotateEl.appendChild(incoming);
571
+
572
+ const outgoing = currentSpan;
573
+
574
+ const tl = gsap.timeline({
575
+ onComplete: () => {
576
+ rotateEl.removeChild(outgoing);
577
+ incoming.style.position = 'static';
578
+ currentSpan = incoming;
579
+ current = nextIndex;
580
+ setTimeout(() => rotateTo((current + 1) % phrases.length), PAUSE);
581
+ }
582
+ });
583
+
584
+ tl.to(outgoing, { y: '-100%', duration: DURATION, ease: EASE }, 0);
585
+ tl.fromTo(incoming, { y: '100%' }, { y: '0%', duration: DURATION, ease: EASE }, 0);
586
+ }
587
+
588
+ setTimeout(() => rotateTo(1), PAUSE);
589
+ });
590
+ };
591
+
592
+
593
+
534
594
 
535
595
  // Case study mask animation + pill fade-in (full, iOS-safe, L->R reveal)
536
596
  window.caseStudyInteraction = function (e) {
@@ -836,7 +896,7 @@ window.partnerSlider = function (e) {
836
896
  // Initialize Splide with drag restored
837
897
  const splide = new Splide(e, {
838
898
  type: 'slide',
839
- fixedWidth: '31.5%',
899
+ fixedWidth: '23.5%',
840
900
  padding: { left: '2.5rem', right: 0 },
841
901
  focus: 0,
842
902
  gap: 0,