Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

Save Automatically?

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="section section--intro">
    <img class="hero__image" src="https://images.unsplash.com/photo-1580983563878-706ee872c772?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=934&q=80" alt="" />

    <svg class="cross-1" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
      <line x1="12" y1="5" x2="12" y2="19"></line>
      <line x1="5" y1="12" x2="19" y2="12"></line>
    </svg>

    <svg class="cross-2" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
      <line x1="12" y1="5" x2="12" y2="19"></line>
      <line x1="5" y1="12" x2="19" y2="12"></line>
    </svg>

    <div class="ring ring--left"></div>
    <div class="ring ring--right"></div>

    <h3 class="hero__title hero__title--1">HI, I'M ISMAEL</h3>
    <h3 class="hero__title hero__title--2">UI DEVELOPER</h3>

    <p class="hero__copy"><span>I'm not the one in the photo but blue is essential</span></p>
  </section>

  <section class="section section--text">
    <div class="box">
      Lorem ipsum dolor, sit amet consectetur adipisicing elit. Id officiis reprehenderit sunt doloremque. Consequuntur
      delectus rerum harum. Eum, nihil minima. Voluptatibus quod ducimus possimus placeat.
      <div class="line"></div>
    </div>
  </section>

  <section class="section section--works">
    <div class="cards">
      <a href="https://unsplash.com/photos/IuF6G4b4XSI" class="card card-1" data-cursor="hover"></a>
      <a href="https://unsplash.com/photos/AGf_KACMHJ8" class="card card-2" data-cursor="hover"></a>
      <a href="https://unsplash.com/photos/IJyXoyGmiZY" class="card card-3" data-cursor="hover"></a>
    </div>

    <svg class="cross-3" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
      <line x1="12" y1="5" x2="12" y2="19"></line>
      <line x1="5" y1="12" x2="19" y2="12"></line>
    </svg>
  </section>

  <section class="section section--footer">
    <div class="big">Works</div>

    <div class="footer__link">
      <svg xmlns="http://www.w3.org/2000/svg" width="72" height="72" viewBox="0 0 24 24" fill="none" stroke="var(--skyblue)" style="margin-bottom: 2rem" stroke-width="1" stroke-linecap="round" stroke-linejoin="round">
        <path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z">
        </path>
      </svg>
    </div>

    <p class="footer__copy">
      Lorem ipsum, dolor sit amet consectetur adipisicing elit. Facere animi impedit, esse sunt at
      exercitationem nostrum, accusamus veniam est commodi expedita, praesentium excepturi ut quidem illum incidunt
      officia.
    </p>

    <a href="https://twitter.com/ismamz" class="footer__button" data-cursor="hover" target="_blank" rel="noopener noreferer">Follow me on Twitter</a>
  </section>

  <div class="cursor"></div>
              
            
!

CSS

              
                :root {
  --blue: #01266c;
  --gold: #f7c505;
  --yellow: #fbdc74;
  --skyblue: #0071fb;
  --black: #1a1a1a;
}

body {
  background-color: var(--black);
  background: linear-gradient(90deg, var(--black) 20px, transparent 1%) 50%, linear-gradient(var(--black) 20px, transparent 1%) 50%, #222;
  background-size: 22px 22px;
  background-attachment: fixed;
  color: #fff;
  font-family: 'Barlow Semi Condensed', sans-serif;
  overflow-x: hidden;
}

.hero__title {
  letter-spacing: -0.0125em;
  font-weight: 900;
  font-size: 110px;
  white-space: nowrap;
  text-transform: uppercase;
  margin-bottom: 0;
  line-height: 1;
  position: relative;
  z-index: 2;
  mix-blend-mode: difference;
  margin: 0;
  margin-top: 2rem;
}

.hero__title--2 {
  color: var(--black);
  -webkit-text-stroke: 1px white;
  margin-top: 0;
  margin-bottom: 1rem;
  mix-blend-mode: color-burn;
}

.hero__copy {
  margin: 0;
  font-size: 1.85vw;
  font-weight: 300;
  opacity: 0.75;
  overflow: hidden;
}

.hero__copy span {
  display: inline-block;
}

.hero__image {
  width: 400px;
  height: 400px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 15%;
}

.ring {
  border: 30px solid white;
  border-radius: 50%;
  background-color: transparent;
  mix-blend-mode: difference;
  position: absolute;
}

.ring--left {
  border-width: 50px;
  border-color: var(--yellow);
  width: 300px;
  height: 300px;
  left: -200px;
  top: -200px;
}

.ring--right {
  border-style: dot-dash;
  right: -50px;
  bottom: 300px;
  border-width: 25px;
  width: 150px;
  height: 150px;
}

.cross-1 {
  width: 180px;
  height: 180px;
  left: 10%;
  bottom: 15%;
  position: absolute;
  mix-blend-mode: difference;
}

@media screen and (max-width: 900px) {
  .cross-1 {
    left: 0;
  }
}

.cross-2 {
  width: 90px;
  height: 90px;
  right: 200px;
  top: 200px;
  position: absolute;
  mix-blend-mode: difference;
}

.section {
  height: 100vh;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.section--intro {
  position: relative;
  justify-content: center;
}

.box {
  width: 780px;
  display: flex;
  align-items: flex-start;
  height: 300px;
  mix-blend-mode: difference;
  font-size: 28px;
  font-weight: 300;
  text-align: left;
  line-height: 1.5;
}

.box .line {
  position: absolute;
  bottom: 120px;
  left: 0;
  width: 40%;
  height: 3px;
  background-color: white;
}

.cards {
  width: 350px;
  height: 350px;
  position: relative;
}

.card {
  position: absolute;
  top: 0;
  left: 0;
  width: 350px;
  height: 350px;
  border-radius: 8px;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-color: transparent;
}

.card-1 {
  background-color: var(--yellow);
  background-image: url("https://images.unsplash.com/photo-1590845947376-2638caa89309?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1350&q=80");
}
.card-2 {
  background-color: var(--blue);
  background-image: url("https://images.unsplash.com/photo-1535043205849-513fe27db33e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=800&q=80");
}

.card-3 {
  background-color: var(--skyblue);
  background-image: url("https://images.unsplash.com/photo-1580234797602-22c37b2a6230?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1347&q=80");
}

.cross-1.scroll-end {
  animation: rotate 6s linear infinite;
}

@keyframes rotate {
  100% {
    transform: rotate(-360deg);
  }
}

.big {
  font-size: 35vw;
  font-weight: 900;
  letter-spacing: -1vw;
  line-height: 1;
  color: white;
  text-transform: uppercase;
  pointer-events: none;
}

.section--works {
  position: relative;
}

.section--footer {
  min-height: 135vh;
  mix-blend-mode: difference;
}

.cross-3 {
  width: 140px;
  height: 140px;
  position: absolute;
  left: 20vw;
  top: 10vw;
  mix-blend-mode: difference;
}

.footer__button {
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  background-color: white;
  color: var(--black);
  font-family: inherit;
  border: 0;
  padding: 1em 3em;
  text-align: center;
  display: inline-block;
  font-weight: 900;
  font-size: 24px;
  line-height: 1;
  margin-top: 3rem;
  margin-bottom: 6rem;
  cursor: pointer;
  transition: color .25s ease, background-color .25s ease;
}

.footer__button:hover {
  background-color: var(--skyblue);
  color: #fff;
}

.footer__copy {
  font-size: 24px;
  max-width: 720px;
  line-height: 1.5;
  margin-bottom: 2rem;
  margin: 0 auto;
  text-align: center;
  mix-blend-mode: difference;
}

.footer__link {
  mix-blend-mode: difference;
}

.cursor {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  background-color: white;
  mix-blend-mode: difference;
  position: fixed;
  top: 0;
  left: 0;
  will-change: transform;
  pointer-events: none;
}

.section--text {
  position: relative;
}
              
            
!

JS

              
                gsap.from(".hero__image", {
  scale: 8,
  transformOrigin: "center center",
  ease: "expo",
  scrollTrigger: {
    trigger: ".hero__image",
    start: "center center",
    end: "center top",
    pin: true,
    scrub: 0.5
  }
});

gsap.to(".ring--right", {
  scale: 5,
  ease: "power4",
  transformOrigin: "center",
  scrollTrigger: {
    trigger: ".ring--right",
    start: "top center",
    end: "bottom+=300 200px",
    pin: true,
    scrub: 0.25
  }
});

gsap.to(".ring--left", {
  scale: 3,
  ease: "power4",
  transformOrigin: "center center",
  scrollTrigger: {
    trigger: ".ring--left",
    start: "center+=100% center",
    end: "bottom+=300 top",
    pin: true,
    scrub: 0.25
  }
});

gsap.to(".hero__title--1", {
  xPercent: -50,
  scrollTrigger: {
    trigger: ".hero__title--1",
    start: "center center",
    pin: true,
    scrub: 0.5
  }
});

gsap.to(".hero__title--2", {
  xPercent: 50,
  scrollTrigger: {
    trigger: ".hero__title--2",
    start: "center center",
    pin: true,
    scrub: 0.5
  }
});

gsap.to(".hero__copy", {
  opacity: 0,
  scrollTrigger: {
    trigger: ".hero__copy",
    start: "top 60%",
    end: "+=60 60%",
    pin: false,
    scrub: 0.5
  }
});

gsap.to(".cross-1", {
  rotate: "+=360",
  scrollTrigger: {
    trigger: ".cross-1",
    start: "bottom bottom",
    end: "bottom top",
    pin: false,
    scrub: 0.5
  }
});

gsap.to(".cross-2", {
  rotate: 360 * 4,
  scrollTrigger: {
    trigger: ".cross-2",
    start: "bottom bottom",
    end: "bottom top",
    pin: false,
    scrub: 0.5
  }
});

gsap.to(".box", {
  y: 500,
  x: "-10vw",
  ease: "power.in",
  scrollTrigger: {
    trigger: ".box",
    start: "top bottom",
    end: "bottom top",
    scrub: true
  }
});

gsap.from(".line", {
  scaleX: 0,
  transformOrigin: "left center",
  ease: "power.in",
  scrollTrigger: {
    trigger: ".line",
    start: "center 75%",
    end: "bottom 10%",
    scrub: 0.5,
    pin: false
  }
});

gsap.to(".big", {
  x: "-130vw",
  transformOrigin: "center center",
  scrollTrigger: {
    trigger: ".big",
    start: "top 62%",
    end: "bottom top-=200",
    pin: true,
    scrub: 1.75
  }
});

gsap.to(".cards", {
  scale: 1.75,
  scrollTrigger: {
    trigger: ".cards",
    start: "center center",
    end: "bottom top",
    pin: true,
    scrub: true
  }
});

gsap.to(".card-1", {
  rotate: -20,
  scale: 0.75,
  x: -200,
  transformOrigin: "bottom center",
  scrollTrigger: {
    trigger: ".cards",
    start: "center center",
    end: "bottom top",
    pin: true,
    scrub: true
  }
});

gsap.to(".card-3", {
  rotate: 20,
  scale: 0.75,
  x: 200,
  transformOrigin: "bottom center",
  scrollTrigger: {
    trigger: ".cards",
    start: "center center",
    end: "bottom top",
    pin: true,
    scrub: true
  }
});

gsap.from(".hero__copy span", {
  opacity: 0,
  duration: 1,
  y: 40,
  delay: 0.5,
  ease: "power2.inOut"
});

let titleOne = new SplitText(".hero__title--1", { type: "words" });
let oneWords = titleOne.words;

gsap.from(oneWords, {
  opacity: 0,
  duration: 1.5,
  y: 80,
  ease: "power4",
  stagger: {
    each: 0.15
  }
});

let titleTwo = new SplitText(".hero__title--2", { type: "words" });
let twoWords = titleTwo.words;

gsap.from(twoWords, {
  opacity: 0,
  duration: 1.5,
  y: 80,

  delay: 0.25,
  ease: "power4",
  stagger: {
    each: 0.15
  }
});

gsap.to(".cross-3", {
  rotate: 360 * 2,
  y: 150,
  scrollTrigger: {
    scrub: 0.5,
    start: "bottom bottom",
    end: "bottom -300px",
    trigger: ".cross-3",
    pin: false
  }
});

let tl = gsap.timeline({
  scrollTrigger: {
    trigger: ".footer__link",
    start: "top 75%"
  }
});

tl.from(".footer__link", {
  opacity: 0,
  y: 90,
  duration: 2,
  ease: "expo.out"
})
  .from(
    ".footer__copy",
    {
      opacity: 0,
      y: 90,
      duration: 2,
      ease: "expo.out"
    },
    "-=1.75"
  )
  .from(
    ".footer__button",
    {
      opacity: 0,
      y: 90,
      duration: 2,
      ease: "power3.out"
    },
    "-=1.75"
  );

// ScrollTrigger.addEventListener("scrollEnd", () => {
//   document.querySelector('.cross-1').classList.add('scroll-end')
// });

// ScrollTrigger.addEventListener("scrollStart", () => {
//   document.querySelector('.cross-1').classList.remove('scroll-end')
// });

gsap.fromTo(
  ".hero__image",
  {
    opacity: 0,
    objectPosition: "center 0%",
    y: 100
  },
  {
    opacity: 1,
    duration: 2,
    objectPosition: "center 15%",
    y: 0,
    ease: "expo.inOut"
  }
);

gsap.set(".cursor", { force3D: true });
document.addEventListener("mousemove", (e) => {
  let x = e.clientX;
  let y = e.clientY;

  gsap.to(".cursor", {
    x: x - 16,
    y: y - 16,
    ease: "power3"
  });
});

document.body.addEventListener("mouseleave", () => {
  gsap.to(".cursor", {
    scale: 0,
    duration: 0.1,
    ease: "none"
  });
});

document.body.addEventListener("mouseenter", () => {
  gsap.to(".cursor", {
    scale: 1,
    duration: 0.1,
    ease: "none"
  });
});

let hoverCursors = document.querySelectorAll('[data-cursor="hover"]');

hoverCursors.forEach(function (cursor) {
  cursor.addEventListener("mouseenter", () => {
    gsap.to(".cursor", {
      scale: 2.5
    });
  });

  cursor.addEventListener("mouseleave", () => {
    gsap.to(".cursor", {
      scale: 1
    });
  });
});

              
            
!
999px

Console