<section class="supt-section-text-big -innovation ">
<div class="supt-section-text-big__wrapper">
<span class="supt-section-text-big__line-wrapper">
<span class="supt-section-text-big__line -first">
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 130 389" fill="none" class="supt-section-text-big__line__glow">
<g filter="url(#supt-line-filter-glow)">
<path d="M65 0L65 325" stroke="white" stroke-width="2" vector-effect="non-scaling-stroke" />
</g>
</svg>
</span>
</span>
<div class="supt-section-text-big__inner">
<div class="container">
<div class="row justify-content-center">
<div class="col-12 col-md-8 col-lg-6">
<div class="supt-section-text-big__content">
<h2 class="supt-section-text-big__title">
We continue to invest in product and service innovation
</h2>
</div>
</div>
</div>
</div>
</div>
<span class="supt-section-text-big__line-wrapper">
<span class="supt-section-text-big__line -last">
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 130 389" fill="none" class="supt-section-text-big__line__glow">
<g filter=" url(#supt-line-filter-glow)">
<path d="M65 0L65 325" stroke="white" stroke-width="2" vector-effect="non-scaling-stroke" />
</g>
</svg>
</span>
</span>
</div>
</section>
No notes defined.
<section class="supt-section-text-big -innovation {{ modifiers|modifiersAttr }}" {{ attrs|attrs }}>
<div class="supt-section-text-big__wrapper">
<span class="supt-section-text-big__line-wrapper">
<span class="supt-section-text-big__line -first">
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 130 389" fill="none" class="supt-section-text-big__line__glow">
<g filter="url(#supt-line-filter-glow)">
<path d="M65 0L65 325" stroke="white" stroke-width="2" vector-effect="non-scaling-stroke"/>
</g>
</svg>
</span>
</span>
<div class="supt-section-text-big__inner">
<div class="container">
<div class="row justify-content-center">
<div class="col-12 col-md-8 col-lg-6">
<div class="supt-section-text-big__content">
<h2 class="supt-section-text-big__title">
{{ title }}
</h2>
</div>
</div>
</div>
</div>
</div>
<span class="supt-section-text-big__line-wrapper">
<span class="supt-section-text-big__line -last">
<svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 130 389" fill="none" class="supt-section-text-big__line__glow">
<g filter=" url(#supt-line-filter-glow)">
<path d="M65 0L65 325" stroke="white" stroke-width="2" vector-effect="non-scaling-stroke"/>
</g>
</svg>
</span>
</span>
</div>
</section>
{
"title": "We continue to invest in product and service innovation"
}
import { animate, onScroll, stagger } from 'animejs';
import { CONTAINER_WIDTH } from '@/js/constants';
import { Sizes } from '@/js/Sizes';
export class SectionTextBigInnovation {
$element: HTMLElement;
$container: HTMLElement;
$linesWrapper: HTMLElement;
$lines: NodeListOf<HTMLElement>;
$linesGlow: NodeListOf<HTMLElement>;
$title: HTMLElement;
$content: HTMLElement;
strokeLength: number = 0;
sizes: Sizes;
constructor($element: HTMLElement, $container: HTMLElement) {
this.$element = $element;
this.$container = $container;
this.$content = $element.querySelector('.supt-section-text-big__content') as HTMLElement;
this.$linesWrapper = $element.querySelector(
'.supt-section-text-big__line-wrapper'
) as HTMLElement;
this.$lines = $element.querySelectorAll(
'.supt-section-text-big__line'
) as NodeListOf<HTMLElement>;
this.$linesGlow = $element.querySelectorAll(
'.supt-section-text-big__line__glow'
) as NodeListOf<HTMLElement>;
this.$title = this.$element.querySelector('.supt-section-text-big__title') as HTMLElement;
this.sizes = new Sizes(); // Singleton
this.splitTitle();
this.setLineStrokeDashoffset();
this.handleScrollAnimation();
}
setLineStrokeDashoffset() {
this.strokeLength = Math.max(this.$linesWrapper.offsetHeight / 1.2, 250);
this.$linesGlow.forEach(line => {
line.style.strokeDasharray = `${this.strokeLength}`;
});
}
/**
* Split title into words and add glow class to each word
*/
splitTitle() {
const title = this.$title.textContent || '';
this.$title.innerHTML = title
.split(' ')
.map(
word =>
`<span class="supt-section-text-big__title__word"><span class="-is-default">${word}</span><span class="-is-glow" aria-hidden="true">${word}</span></span>`
)
.join(' ');
}
handleScrollAnimation() {
// Update container background on scroll
const $darkBackground = this.$container.querySelector(
'.supt-innovation-overview-page__background.-dark'
) as HTMLElement;
animate($darkBackground, {
opacity: [0, 1],
autoplay: onScroll({
container: document.body,
target: this.$element,
enter: 'bottom top',
leave: 'center top',
sync: true,
}),
});
// 1st line glow
animate(this.$linesGlow[0], {
strokeDashoffset: [this.strokeLength, 0],
ease: 'linear',
autoplay: onScroll({
container: document.body,
target: this.$element,
enter: this.$element.dataset.scrollStart || 'center top',
leave: 'center 15%',
sync: true,
}),
});
// title glow fadeIn (word by word)
const $glowWords = this.$title.querySelectorAll(
'.supt-section-text-big__title__word .-is-glow'
) as NodeListOf<HTMLElement>;
animate($glowWords, {
opacity: [0, 1],
duration: 500,
ease: 'linear',
delay: stagger(200),
autoplay: onScroll({
container: document.body,
target: this.$element,
enter: 'center 35%',
leave: 'center 58%',
sync: true,
}),
});
}
getLineTranslateX() {
const containerWidth =
this.sizes.currentWidth > CONTAINER_WIDTH ? CONTAINER_WIDTH : this.sizes.currentWidth;
const textCols = this.sizes.isDesktop ? 3 : 5;
return (
-window.innerWidth / 2 +
(window.innerWidth - containerWidth) / 2 +
(containerWidth * (textCols / 2)) / 12 +
50
);
}
}
.supt-section-text-big.-innovation {
.supt-section-text-big__line.-last {
display: none;
}
.supt-section-text-big__title {
color: $color-new;
}
}