Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

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.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

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.

+ add another resource

Packages

Add Packages

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.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <section class="bg-gray"></section>
<section class="our-work">
	<div class="container sticky">
		<div class="row align-items-center">
			<div class="col-12 col-md-4">
				<h1>How does it</h1>
			</div>
			<div class="col-12 col-md-8 slider">
				<div class="carousel__slider">
					<div class="carousel__item" id="our-work-1">
						<div class="blurred-box__step">1</div>
						<h2 class="blurred-box__title">Become an independent contractor in the bSuite Network</h2>
						<div class="blurred-box__footer">
							<span class="blurred-box__footer-line"></span>
							<p class="blurred-box__text">Register on the bSuite app.</p>
							<p class="blurred-box__text">Get trained in our billboard academy.</p>
						</div>
					</div>
					<div class="carousel__item" id="our-work-2">
						<div class="blurred-box__step">2</div>
						<h2 class="blurred-box__title">Identify your clients</h2>
						<div class="blurred-box__footer">
							<span class="blurred-box__footer-line"></span>
							<p class="blurred-box__text">It could be anyone who needs their business to become famous.</p>
						</div>
					</div>
					<div class="carousel__item" id="our-work-3">
						<div class="blurred-box__step">3</div>
						<h2 class="blurred-box__title">Select the billboards that best match the clients’ needs</h2>
						<div class="blurred-box__footer">
							<span class="blurred-box__footer-line"></span>
							<p class="blurred-box__text">it may be a key location close to their business, or a location that will expose them to new audiences. The possibilities are endless.</p>
						</div>
					</div>
					<div class="carousel__item" id="our-work-4">
						<div class="blurred-box__step">4</div>
						<h2 class="blurred-box__title">Confirm the sale</h2>
						<div class="blurred-box__footer">
							<span class="blurred-box__footer-line"></span>
							<p class="blurred-box__text">Sign the contract and send the payment.</p>
						</div>
					</div>
					<div class="carousel__item" id="our-work-5">
						<div class="blurred-box__step">5</div>
						<h2 class="blurred-box__title">Send the artwork to the platform</h2>
						<div class="blurred-box__footer"><span class="blurred-box__footer-line"></span></div>
					</div>
					<div class="carousel__item" id="our-work-6">
						<div class="blurred-box__step">6</div>
						<h2 class="blurred-box__title">Receive your commissions and enjoy life!</h2>
						<div class="blurred-box__footer"><span class="blurred-box__footer-line"></span></div>
					</div>
				</div>
				<ul class="carousel__nav">
					<li class="carousel__nav__item" data-target="our-work-1"></li>
					<li class="carousel__nav__item" data-target="our-work-2"></li>
					<li class="carousel__nav__item" data-target="our-work-3"></li>
					<li class="carousel__nav__item" data-target="our-work-4"></li>
					<li class="carousel__nav__item" data-target="our-work-5"></li>
					<li class="carousel__nav__item" data-target="our-work-6"></li>
				</ul>
			</div>
		</div>
	</div>
</section>
<section class="bg-gray"></section>
              
            
!

CSS

              
                *{
	margin:0;
	padding:0;
}
section{
	height:100vh;
	&.bg-gray{
		background: #111;
	}
}

.our-work{
	display: flex;
	align-items: center;
	background-color: #14192d;
	background-position: center;
	background-size: cover;
	position:relative;
	overflow:hidden;
	&:before{
		width: 50vw;
    height: 50vw;
		position: absolute;
    top: 50%;
    left: 50%;
    z-index: 0;
    background: #e93f8e;
    border-radius: 760px;
    transform: translate(-50%, -50%);
    backface-visibility: hidden;
    opacity: 0.4;
    filter: blur(270px);
    content: '';
    pointer-events: none;
    will-change: transform;
	}
	h1{
		background-image: linear-gradient(269deg, #bc2789 1.26%, #f85956 98.74%);
		background-clip: text;
		-webkit-text-fill-color: transparent;
		display:inline-flex;
		font-size: 3.3rem;
    line-height: 1.1;
	}
}

.slider{
	display: flex;
	gap: 55px;
	align-items: center;
	position:relative;
	@media (max-width: 640px){
		padding-top:1rem;
		flex-direction: column;
		gap:16px;
	}
}

.carousel__slider{
	position:relative;
	width:100%;
	min-height: 440px;
}
.carousel__item{
		width:100%;
		min-height: 440px;
		padding: 48px;
		color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
		position:absolute;
		top:0%;
		opacity:0;
}


.carousel__nav{
	display: flex;
	gap: 16px;
	align-items: center;
	flex-direction: column;
	@media (max-width: 640px){
		flex-direction: row;
	}
	&__item{
		background:#424b58;
		box-shadow: none;
		display: block;
    width: 10px;
    height: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
		
		&--active{
			background: red;
		}
	}
}
              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger, ScrollToPlugin);
const container = document.querySelector(".our-work");
const list = document.querySelector(".carousel__nav");
const listItems = gsap.utils.toArray(".carousel__nav__item", list);
const slides = gsap.utils.toArray(".carousel__item");
const tl = gsap.timeline();
const myST = ScrollTrigger.create({
	animation: tl,
  id: "st",
	trigger: container,
	start: "top top",
	end: "+="+container.clientHeight * (slides.length - 1),
	pin: container,
	scrub: true,
	snap: {
		snapTo: 1 / (slides.length -1)
	},
	markers: false
})

gsap.set(slides, {  xPercent: ()=>{ return (window.innerWidth<768?125:0)}, yPercent: ()=>{ return (window.innerWidth>768?125:0)},scale:0.5 ,opacity: 0 });
listItems.forEach((item, i) => {
  item.addEventListener("click", e => {
    e.preventDefault();
		const percent = tl.labels[e.target.getAttribute("data-target")] / tl.totalDuration();
    const scrollPos = myST.start + (myST.end - myST.start) * percent;
    gsap.to(window, {duration: 2, scrollTo: scrollPos});
	});
	
  const previousItem = listItems[i - 1];
  if (previousItem) {
    tl
			.to(item, { background: "#ed3c3c",boxShadow:'0 0 16px #ed3c3c' }, 0.5 * (i - 1))
      .to(
        slides[i],
        {
          opacity: 1,
					yPercent: 0,
					xPercent: 0,
					scale:1,
        },
        '<'
      )
      .to(previousItem, { backgroundColor: '#424b58',	boxShadow:'0 0 16px transparent' }, '<')
      .to(
        slides[i - 1],
        {
          opacity: 0,
					yPercent: ()=>{ return (window.innerWidth>768?-125:0)},
					xPercent: ()=>{ return (window.innerWidth<768?-125:0)},
					scale:0.5,
        },
        '<'
      ).add("our-work-"+(++i))
  } else {
		gsap.set(item, { background: "#ed3c3c",boxShadow:'0 0 16px #ed3c3c' });
    gsap.to(slides[i], { yPercent:0, xPercent:0, opacity: 1,scale:1, duration:0},0);
		tl.add("our-work-"+(++i), "+=0")
  }
});
              
            
!
999px

Console