<section class="supt-section-text-big -default ">
<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 -default {{ 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 SectionTextBig {
$element: HTMLElement;
$linesWrapper: HTMLElement;
$lines: NodeListOf<HTMLElement>;
$linesGlow: NodeListOf<HTMLElement>;
$title: HTMLElement;
$content: HTMLElement;
strokeLength: number = 0;
sizes: Sizes;
constructor($element: HTMLElement) {
this.$element = $element;
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() {
// 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,
}),
});
// 2nd line glow
animate(this.$linesGlow[1], {
strokeDashoffset: [this.strokeLength, 0],
ease: 'linear',
autoplay: onScroll({
container: document.body,
target: this.$element,
enter: 'center 58%',
leave: 'bottom bottom',
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 {
height: 200vh;
&__wrapper {
height: 100vh;
position: sticky;
top: 0;
display: flex;
flex-direction: column;
align-items: center;
overflow: hidden;
}
&__inner {
width: 100%;
padding: $spacing-12 0;
}
&__content {
position: relative;
}
&__title {
@extend %t-h2;
color: $color-new;
text-align: center;
margin: 0;
padding-top: 8px;
&__word {
position: relative;
display: inline-block;
.-is-default {
display: block;
opacity: 0.5;
}
.-is-glow {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
color: $color-white;
text-shadow: $text-shadow-glow;
}
}
}
&__line-wrapper {
position: relative;
width: 100%;
height: 100%;
}
&__line {
position: relative;
display: block;
width: 1px;
height: 100%;
background-color: $color-new;
left: 50%;
transform: translateX(-50%);
&__glow {
position: absolute;
top: 0;
left: calc(-50% + 1px);
width: auto;
height: 100%;
transform-origin: top;
overflow: visible;
transform: scaleY(1.2) translateX(-50%);
stroke-dasharray: 280;
}
&.-first {
transform-origin: top;
}
&.-last {
transform-origin: bottom;
}
}
/* Hide the glow of the bottom line overflowing behind the next section */
& + * {
position: relative;
z-index: 1;
}
}