HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<header id="masthead" class="header container-fluid position-fixed py-3 vw-100">
<div class="row g-0 align-items-center">
<div class="header__left header__col col-4">
playlist
</div>
<div class="header__center header__col text-center col">
<div class="header__logo" aria-label="Belle Époque">
Logo
</div>
</div>
<div class="header__right header__col col-4 d-flex align-items-center justify-content-end">
<a href="#playlists" class="me-2">Playlists</a>
<a href="#references" class="me-2">References</a>
</div>
</div>
<nav id="site-navigation" class="main-navigation d-none">
<div id="menu-main" class="menu"><ul>
<li class="page_item page-item-2 current_page_item"><a href="https://dev.local/belleepoque/" aria-current="page">Accueil</a></li>
</ul></div>
</nav><!-- #site-navigation -->
</header>
<section id="playlists" class="playlists position-relative d-flex justify-content-center">
<div class="playlists__inner position-sticky vh-100 d-flex justify-content-center align-items-center">
<div class="playlists__vinyle position-relative">
<svg class="star star--1" width="40" height="40" viewBox="0 0 43 43" fill="none" xmlns="http://www.w3.org/2000/svg" style="--star-color:var(--darkblue)">
<path fill="var(--star-color)" stroke="#281F4C" d="M21.5 4.68294C23.3203 13.0714 29.9286 19.6797 38.3171 21.5C29.9286 23.3203 23.3203 29.9286 21.5 38.3171C19.6797 29.9286 13.0714 23.3203 4.68294 21.5C13.0714 19.6797 19.6797 13.0714 21.5 4.68294Z"/>
</svg>
<svg class="star star--2" width="40" height="40" viewBox="0 0 43 43" fill="none" xmlns="http://www.w3.org/2000/svg" style="--star-color:var(--darkblue)">
<path fill="var(--star-color)" stroke="#281F4C" d="M21.5 4.68294C23.3203 13.0714 29.9286 19.6797 38.3171 21.5C29.9286 23.3203 23.3203 29.9286 21.5 38.3171C19.6797 29.9286 13.0714 23.3203 4.68294 21.5C13.0714 19.6797 19.6797 13.0714 21.5 4.68294Z"/>
</svg>
<div class="playlists__item playlists__item--1 h-100 w-100 position-absolute">
<div class="playlists__vinyle__content h-100 w-100 d-flex flex-column align-items-center">
<div class="playlists__vinyle__top position-relative">
<p class="playlists__suptitle fw-semibold mb-0">Avec</p>
<h3 class="playlists__title">La Dolce Vita</h3>
</div>
<div class="playlists__vinyle__bottom fw-semibold mt-auto mb-0">
<div class="playlists__subtitle mb-3">L’inspiration italienne pour un apéro lyrique & idylique</div>
<div class="mb-1">—</div>
<div class="playlists__count">102 titres</div>
</div>
</div>
<div class="playlists__vinyle__center position-absolute">
<div class="lazy-image playlists__vinyle__img overflow-hidden">
<picture class="lazy-image__img d-block" >
<source
media="(min-width: 768px)"
srcset="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-1.jpg 1x, https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-1.jpg 2x"
>
<img class="img-fluid"
src="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-1.jpg"
srcset="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-1.jpg 2x"
alt="belle Epoque"
width="356"
height="356"
>
</picture>
</div>
</div>
</div>
<div class="playlists__item playlists__item--2 h-100 w-100 position-absolute">
<div class="playlists__vinyle__content h-100 w-100 d-flex flex-column align-items-center">
<div class="playlists__vinyle__top position-relative">
<p class="playlists__suptitle fw-semibold mb-0">Avec</p>
<h3 class="playlists__title">L’apéro des canailles</h3>
</div>
<div class="playlists__vinyle__bottom fw-semibold mt-auto mb-0">
<div class="playlists__subtitle mb-3">L’énergie enivrante d’une soirée entre copains et copines</div>
<div class="mb-1">—</div>
<div class="playlists__count">242 titres</div>
</div>
</div>
<div class="playlists__vinyle__center position-absolute">
<div class="lazy-image playlists__vinyle__img overflow-hidden">
<picture class="lazy-image__img d-block" >
<source
media="(min-width: 768px)"
srcset="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-2.jpg 1x, https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-2.jpg 2x"
>
<img class="img-fluid"
src="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-2.jpg"
srcset="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-2.jpg 2x"
alt="belle Epoque"
width="356"
height="356"
>
</picture>
</div>
</div>
</div>
<h3 class="playlists__item playlists__item--text playlists__item--3 position-absolute mb-0 purple">
La musique juste pour les lieux qui rassemblent en fin de journée
</h3>
<div class="playlists__item playlists__item--text playlists__item--4 position-absolute">
<svg class="star star--3" width="85" height="85" viewBox="0 0 43 43" fill="none" xmlns="http://www.w3.org/2000/svg" style="--star-color:var(--blue)">
<path fill="var(--star-color)" stroke="#281F4C" d="M21.5 4.68294C23.3203 13.0714 29.9286 19.6797 38.3171 21.5C29.9286 23.3203 23.3203 29.9286 21.5 38.3171C19.6797 29.9286 13.0714 23.3203 4.68294 21.5C13.0714 19.6797 19.6797 13.0714 21.5 4.68294Z"/>
</svg>
<svg class="star star--4" width="28" height="28" viewBox="0 0 43 43" fill="none" xmlns="http://www.w3.org/2000/svg" style="--star-color:var(--yellow)">
<path fill="var(--star-color)" stroke="#281F4C" d="M21.5 4.68294C23.3203 13.0714 29.9286 19.6797 38.3171 21.5C29.9286 23.3203 23.3203 29.9286 21.5 38.3171C19.6797 29.9286 13.0714 23.3203 4.68294 21.5C13.0714 19.6797 19.6797 13.0714 21.5 4.68294Z"/>
</svg>
<svg class="star star--5" width="35" height="35" viewBox="0 0 43 43" fill="none" xmlns="http://www.w3.org/2000/svg" style="--star-color:var(--blue)">
<path fill="var(--star-color)" stroke="#281F4C" d="M21.5 4.68294C23.3203 13.0714 29.9286 19.6797 38.3171 21.5C29.9286 23.3203 23.3203 29.9286 21.5 38.3171C19.6797 29.9286 13.0714 23.3203 4.68294 21.5C13.0714 19.6797 19.6797 13.0714 21.5 4.68294Z"/>
</svg>
<svg class="star star--6" width="58" height="58" viewBox="0 0 43 43" fill="none" xmlns="http://www.w3.org/2000/svg" style="--star-color:var(--yellow)">
<path fill="var(--star-color)" stroke="#281F4C" d="M21.5 4.68294C23.3203 13.0714 29.9286 19.6797 38.3171 21.5C29.9286 23.3203 23.3203 29.9286 21.5 38.3171C19.6797 29.9286 13.0714 23.3203 4.68294 21.5C13.0714 19.6797 19.6797 13.0714 21.5 4.68294Z"/>
</svg>
<h3 class="mb-0 blue">
& aussi pour ceux<br>
qui brillent jusqu’au<br>
bout de la nuit
</h3>
</div>
<div class="playlists__item playlists__item--5 h-100 w-100 position-absolute">
<div class="playlists__vinyle__content h-100 w-100 d-flex flex-column align-items-center">
<div class="playlists__vinyle__top position-relative">
<p class="playlists__suptitle fw-semibold mb-0">Avec</p>
<h3 class="playlists__title">Slow vintage</h3>
</div>
<div class="playlists__vinyle__bottom fw-semibold mt-auto mb-0">
<div class="playlists__subtitle mb-3">L’énergie enivrante d’une soirée entre copains et copines</div>
<div class="mb-1">—</div>
<div class="playlists__count">242 titres</div>
</div>
</div>
<div class="playlists__vinyle__center position-absolute">
<div class="lazy-image playlists__vinyle__img overflow-hidden">
<picture class="lazy-image__img d-block" >
<source
media="(min-width: 768px)"
srcset="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-5.jpg 1x, https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-5.jpg 2x"
>
<img class="img-fluid"
src="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-5.jpg"
srcset="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-5.jpg 2x"
alt="belle Epoque"
width="356"
height="356"
>
</picture>
</div>
</div>
</div>
<div class="playlists__item playlists__item--6 position-absolute d-flex align-items-center px-0">
<div class="playlists__item__inner">
<h3 class="playlists__subtitle no-shadow blue mb-1">
Notre sélection rythmée n'attend que vous
</h3>
<p class="playlists__text fw-semibold mb-4">• 15h — 19h • </p>
<div class="lazy-image playlists__porthole porthole reverse mx-auto">
<picture class="lazy-image__img d-block" >
<source
media="(min-width: 768px)"
data-srcset="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-6.jpg 1x, https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-6.jpg 2x"
>
<img class="img-fluid"
src="data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox='0 0 887 552'%3E%3C/svg%3E"
data-src="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-6.jpg"
data-srcset="https://dev.local/belleepoque/wp-content/themes/belleepoque-theme/assets/dist/img/playlists-center-6.jpg 2x"
alt="belle Epoque"
width="887"
height="552"
>
</picture>
</div>
</div>
</div>
</div>
</div>
</section>
<section id="references" class="references vh-100 d-flex align-items-center justify-content-center">
References
</section>
$black : black;
$white: white;
$darkyellow : #FFD966;
$yellow : #FFE595;
$lightyellow: #FFF0C2;
$lightbrown: #F4DE98;
$lightpink: #FED7A7;
$orange : #FB874D;
$pink : #F15962;
$purple:#770E59;
$blue: #7D94F6;
$darkblue: #281F4C;
$site_colors: (
white: $white,
black: $black,
darkyellow: $darkyellow,
yellow: $yellow,
lightyellow: $lightyellow,
orange: $orange,
lightpink: $lightpink,
pink: $pink,
purple: $purple,
blue: $blue,
darkblue: $darkblue,
lightbrown: $lightbrown
);
:root {
--app-height: 100vh;
--admin-bar : 0rem;
--container-width: 1110px;
@each $name, $color in $site_colors {
--#{$name + ''}: #{$color};
}
--bs-body-color: var(--darkblue);
--bs-body-bg: var(--lightyellow);
}
html {
scroll-behavior: auto !important;
}
.playlists {
z-index: 0;
height: 800vh;
&__vinyle {
width: calc(100vh - 5.4rem);
height: calc(100vh - 5.4rem);
border-radius: 50%;
text-align: center;
max-width: 70rem;
max-height: 70rem;
--vinyle-bg: var(--darkyellow);
--shadow-color: var(--purple);
--vinyle-scale: 1;
--vinyle-opacity: 1;
--vinyle-color: var(--bs-body-color);
color: var(--vinyle-color);
&::before, &::after {
content:'';
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
border-radius: 50%;
z-index: -1;
transform:scale(var(--vinyle-scale));
will-change: transform;
opacity: var(--vinyle-opacity);
}
&::before {
top: 1.8rem;
background-color: var(--shadow-color);
}
&::after {
background-image: url('../img/playlists-vinyle.png');
background-repeat: no-repeat;
background-position: center;
background-size: cover;
background-blend-mode: overlay;
background-color: var(--vinyle-bg);
}
&__bottom {
max-width: 37rem;
}
&__center {
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 23rem;
height: 23rem;
--border-color:var(--darkblue);
&::after {
content:'';
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: calc(100% + 1.5rem);
height: calc(100% + 1.5rem);
border-radius: 50%;
border: 0.05rem solid var(--border-color);
}
}
&__img {
border-radius: 50%;
}
&__content {
will-change: transform;
}
}
&__inner {
top: 0;
.star {
&--1, &--2 {
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
&--1 {
transform: translate(calc(-50% + 17rem), -50%);
}
&--2 {
transform: translate(calc(-50% - 17rem), -50%);
}
}
}
&__item {
inset:0;
padding-top: 8rem;
padding-bottom: 5rem;
&--4 {
text-shadow: .3rem .3rem 0 $purple;
background-clip: text;
-webkit-text-stroke-width: 0.1rem;
-webkit-text-fill-color: $blue;
-webkit-text-stroke-color: $darkblue;
background-color: $blue;
.star {
&--3 {
left: -20vw;
top: -6rem;
transform:rotate(-120deg);
}
&--4 {
top:50%;
left: -2vw;
transform:rotate(-23deg);
}
&--5 {
top:200%;
right: -1vw;
transform:rotate(23deg);
}
&--6 {
top:100%;
right: -20vw;
transform:rotate(-170deg);
}
}
}
&--text {
max-width: 58rem;
width: 100vw;
inset:unset;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
padding: 0;
}
}
&__suptitle {
font-size: 2rem;
}
&__title {
text-shadow: 0.2rem 0.2rem 0 #e3ded9;
color: $purple;
.playlists__item--5 & {
color:$darkblue;
text-shadow: 2px 2px 0 $blue;
background-clip: text;
-webkit-text-stroke-width: 0.1rem;
-webkit-text-stroke-color: #DBD5E1;
-webkit-text-fill-color: $darkblue;
background-color: $darkblue;
}
}
}
.porthole {
position: relative;
width: 44rem;
height: 28rem;
&::after {
content:'';
position: absolute;
left: 50%;
top: 49%;
transform: translate(-50%, -50%);
width: calc(100% + 2.5rem);
height: calc(100% + 1.5rem);
border-radius: 21rem;
border: 0.1rem solid $darkblue;
}
&.reverse {
&::after {
border-color: $lightyellow;
}
}
picture {
border-radius: 21rem;
overflow: hidden;
}
&--sm {
width: 28rem;
height: 17rem;
&::after {
top: calc(50% + 0.25rem);
width: calc(100% + 1.5rem);
height: calc(100% + 2rem);
}
}
}
.header {
z-index: 10;
top: 0;
left: 0;
}
gsap.registerPlugin(ScrollTrigger);
function getBodyCssVariable(variableName) {
return getComputedStyle(document.body).getPropertyValue(variableName).trim();
}
class Playlists {
constructor() {
this.purple = getBodyCssVariable('--purple');
this.lightpink = getBodyCssVariable('--lightpink');
this.lightyellow = getBodyCssVariable('--lightyellow');
this.darkyellow = getBodyCssVariable('--darkyellow');
this.darkblue = getBodyCssVariable('--darkblue');
this.blue = getBodyCssVariable('--blue');
this.bodyColor = getBodyCssVariable('--bs-body-color');
Playlists.initLenis();
this.initStep1();
this.initStep2();
this.initStep3();
this.initStep4();
this.initStep5();
this.initStep6();
this.initStep7();
}
static initLenis() {
window.lenis = new Lenis({
duration: 2,
easing: (t) => Math.min(1, 1.001 - 2 ** (-10 * t)), // https://www.desmos.com/calculator/brs54l4xou
orientation: 'vertical', // vertical, horizontal
gestureOrientation: 'vertical', // vertical, horizontal, both
smoothWheel: true,
wheelMultiplier: 0.4,
smoothTouch: false,
touchMultiplier: 2,
infinite: false,
});
function raf(time) {
window.lenis.raf(time);
requestAnimationFrame(raf);
}
requestAnimationFrame(raf);
window.lenis.on('scroll', ScrollTrigger.update);
document.querySelectorAll('a[href^="#"]:not([data-bs-toggle])').forEach((anchor) => {
anchor.addEventListener('click', (e) => {
e.preventDefault();
const href = anchor.getAttribute('href');
if (href === '#') {
return;
}
window.lenis.scrollTo(
href,
{
immediate: true,
onComplete() {
const scrollTriggers = ScrollTrigger.getAll();
scrollTriggers.forEach((st) => {
if (st.animation && window.scrollY > st.animation.scrollTrigger.start) {
st.animation.progress(1);
}
});
}
}
);
});
});
}
initStep1() {
const _this = this;
// bg color useless for this demo
gsap.fromTo('body', {
'--bs-body-bg': this.lightpink,
}, {
'--bs-body-bg': this.lightyellow,
immediateRender: false,
scrollTrigger: {
trigger: '.playlists',
start: 'top top',
end: '+=200%',
toggleActions: 'play none none reverse',
}
});
}
initStep2() {
const _this = this;
this.step2 = gsap.timeline({
defaults: {
duration: 0.8
},
scrollTrigger: {
trigger: '.playlists',
start: 'top top',
end: '+=150%',
toggleActions: 'play none none reverse',
id: 'step2',
}
});
this.step2.from('.playlists__vinyle', {
autoAlpha: 0,
'--vinyle-scale': 0.5,
ease: 'back.out(1.7)',
}, 'start');
this.step2.from('.playlists__vinyle .star--1, .playlists__vinyle .star--2', {
x: 0,
ease: 'back.out(1.7)'
}, 'start');
this.step2.from('.playlists__item--1 .playlists__vinyle__content', {
autoAlpha: 0,
rotate: -90,
overwrite: 'auto',
ease: 'back.out(1.7)',
}, 'start+=0.4');
this.step2.from('.playlists__item--1 .playlists__vinyle__center, .playlists__item--2 .playlists__vinyle__center', {
scale: 0.75,
autoAlpha: 0,
ease: 'back.out(1.7)',
}, 'start+=0.4');
}
initStep3() {
const _this = this;
this.step3 = gsap.timeline({
defaults: {
duration: 0.8
},
scrollTrigger: {
trigger: '.playlists',
start: () => _this.step2.scrollTrigger.end,
end: '+=100%',
id: 'step3',
toggleActions: 'play none none reverse',
}
});
this.step3.fromTo('.playlists__vinyle', {
'--vinyle-bg': this.darkyellow,
}, {
'--vinyle-bg': this.lightpink,
immediateRender: false,
}, 'together');
this.step3.to('.playlists__item--1 .playlists__vinyle__content', {
autoAlpha: 0,
rotate: 90,
immediateRender: false,
overwrite: 'auto',
ease: 'back.out(1.7)'
}, 'together');
this.step3.to('.playlists__item--1 .playlists__vinyle__img', {
scale: 0.5,
autoAlpha: 0,
ease: 'expo.inOut',
immediateRender: false,
}, 'together');
this.step3.from('.playlists__item--2 .playlists__vinyle__img', {
scale: 0.5,
autoAlpha: 0,
ease: 'expo.inOut'
}, 'together+=0.2');
this.step3.from('.playlists__item--2 .playlists__vinyle__content', {
autoAlpha: 0,
rotate: -90,
ease: 'back.out(1.7)',
}, '-=.2');
}
initStep4() {
const _this = this;
this.step4 = gsap.timeline({
defaults: {
duration: 0.8
},
scrollTrigger: {
trigger: '.playlists',
start: () => _this.step3.scrollTrigger.end,
end: '+=100%',
id: 'step4',
toggleActions: 'play none none reverse',
}
});
this.step4.to('.playlists__item--2 .playlists__vinyle__content', {
autoAlpha: 0,
rotate: 90,
immediateRender: false,
ease: 'back.out(1.7)',
}, 'together');
this.step4.to('.playlists__vinyle', {
'--vinyle-scale': 0.65,
duration: 0.6,
ease: 'expo.inOut',
}, 'together');
this.step4.from('.playlists__item--3', {
autoAlpha: 0,
}, 'together');
this.step4.to('.playlists__item--1 .playlists__vinyle__center, .playlists__item--2 .playlists__vinyle__center', {
scale: 0.75,
autoAlpha: 0,
ease: 'back.out(1.7)'
}, 'together');
this.step4.to('.playlists__vinyle .star--1, .playlists__vinyle .star--2', {
x: 0,
autoAlpha: 0,
ease: 'back.out(1.7)',
clearProps: 'transform'
}, 'together');
this.step4.fromTo('.playlists__vinyle', {
'--shadow-color': this.purple,
}, {
'--shadow-color': 'transparent',
immediateRender: false,
}, 'together');
}
initStep5() {
const _this = this;
this.step5 = gsap.timeline({
defaults: {
duration: 0.6,
ease: 'expo.inOut',
},
scrollTrigger: {
trigger: '.playlists',
start: () => _this.step4.scrollTrigger.end,
end: '+=100%',
id: 'step5',
toggleActions: 'play none none reverse',
}
});
this.step5.fromTo('body', {
'--bs-body-bg': this.lightyellow,
}, {
'--bs-body-bg': this.darkblue,
duration: 0.8,
immediateRender: false,
}, 'start');
this.step5.fromTo('.header', {
'--header-color': this.purple,
}, {
'--header-color': this.lightyellow,
duration: 0.8,
immediateRender: false,
}, 'start');
this.step5.to('.playlists__item--3', {
autoAlpha: 0,
scale: 1.3
}, 'start');
this.step5.from('.playlists__item--4', {
autoAlpha: 0,
scale: 0.7,
ease: 'back.out(1)',
duration: 0.4,
}, 'start+=0.25');
this.step5.fromTo('.playlists__vinyle', {
'--vinyle-bg': this.lightpink,
'--vinyle-opacity': 1,
'--vinyle-color': this.bodyColor,
}, {
'--vinyle-bg': this.blue,
'--vinyle-opacity': 0.5,
'--vinyle-color': this.lightyellow,
duration: 0.8,
immediateRender: false,
}, 'start');
this.step5.fromTo('.playlists__vinyle__center', {
'--border-color': this.darkblue,
}, {
'--border-color': this.blue,
duration: 0.8,
immediateRender: false,
}, 'start');
}
initStep6() {
const _this = this;
this.step6 = gsap.timeline({
defaults: {
duration: 0.6,
ease: 'expo.inOut',
},
scrollTrigger: {
trigger: '.playlists',
start: () => _this.step5.scrollTrigger.end,
end: '+=100%',
id: 'step6',
toggleActions: 'play none none reverse',
}
});
this.step6.to('.playlists__vinyle', {
'--vinyle-scale': 1,
ease: 'back.out(1.7)'
}, 'together');
this.step6.to('.playlists__item--4', {
autoAlpha: 0,
scale: 0.7,
ease: 'back.out(1)',
duration: 0.4,
}, 'together');
this.step6.fromTo('.playlists__vinyle', {
'--vinyle-opacity': 0.5,
'--vinyle-bg': this.blue,
}, {
'--vinyle-bg': this.darkblue,
immediateRender: false,
'--vinyle-opacity': 1,
}, 'together');
this.step6.fromTo('.playlists__vinyle .star--1, .playlists__vinyle .star--2', {
'--star-color': this.darkblue,
autoAlpha: 0,
}, {
'--star-color': this.blue,
autoAlpha: 1,
}, 'together');
this.step6.from('.playlists__vinyle .star--1, .playlists__vinyle .star--2', {
x: 0,
ease: 'back.out(1.7)',
immediateRender: false,
}, 'together');
this.step6.fromTo('.playlists__vinyle', {
'--shadow-color': 'transparent',
}, {
'--shadow-color': this.blue,
immediateRender: false,
}, 'together+=0.4');
this.step6.from('.playlists__item--5 .playlists__vinyle__center', {
scale: 0.75,
autoAlpha: 0,
ease: 'back.out(1.7)',
}, 'together+=0.4');
this.step6.from('.playlists__item--5 .playlists__vinyle__content', {
autoAlpha: 0,
rotate: -90,
ease: 'back.out(1.7)',
}, 'together+=0.4');
}
initStep7() {
const _this = this;
this.step7 = gsap.timeline({
defaults: {
duration: 0.6,
ease: 'expo.inOut',
},
scrollTrigger: {
trigger: '.playlists',
start: () => _this.step6.scrollTrigger.end,
end: '+=100%',
id: 'step7',
toggleActions: 'play none none reverse',
}
});
this.step7.to('.playlists__item--5 .playlists__vinyle__content, .playlists__item--5 .playlists__vinyle__center, .playlists__vinyle .star--1, .playlists__vinyle .star--2', {
scale: 0.5,
autoAlpha: 0,
}, 'start');
this.step7.to('.playlists__vinyle', {
'--vinyle-scale': 0.5,
'--vinyle-opacity': 0,
}, 'start');
this.step7.from('.playlists__item--6 .porthole', {
scale: 0.5,
autoAlpha: 0,
y: -200,
}, 'start');
this.step7.from('.playlists__item--6 .playlists__subtitle, .playlists__item--6 .playlists__text', {
y: 200,
autoAlpha: 0,
}, 'start');
}
}
new Playlists();
Also see: Tab Triggers