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

              
                <main class="scrollContainer">
  <section class="main-container-animation" id="stickytargetzzz">
    <div class="bg-image" style="background-image: url('https://dr-best-de.preprod-cf65.ch.adobecqms.net/content/dam/cf-consumer-healthcare/drbest/master/interdental/animation/bg-paper-800px.jpg');"></div>
    <div class="bg-color"></div>
    <div class="scene-alt scene-0-alt">
      <h1>Die neuen <i>Dr.</i>BEST <span>GreenClean <span class="interdental">INTERDENTAL</span></span></h1>
      <div class="brushes">
        <div class="brush-small brush-1">
          <img src="https://dr-best-de.preprod-cf65.ch.adobecqms.net/content/dam/cf-consumer-healthcare/drbest/master/interdental/animation/brush-small-1.png" />
        </div>
        <div class="size">
          <div class="size-inner">ISO-Größe 0&nbsp;<span>(0,4 mm)</span></div>
        </div>
        <div class="brush-small brush-2">
          <img class="brush-image" id="stickytarget" src="https://dr-best-de.preprod-cf65.ch.adobecqms.net/content/dam/cf-consumer-healthcare/drbest/master/interdental/animation/brush-small-2.png" />
        </div>
        <div class="size">
          <div class="size-inner">ISO-Größe 2&nbsp;<span>(0,5 mm)</span></div>
        </div>
        <div class="brush-small brush-3">
          <img src="https://dr-best-de.preprod-cf65.ch.adobecqms.net/content/dam/cf-consumer-healthcare/drbest/master/interdental/animation/brush-small-3.png" />
        </div>
        <div class="size">
          <div class="size-inner">ISO-Größe 3&nbsp;<span>(0,6 mm)</span></div>
        </div>
      </div>
    </div>
    <div class="scene-alt scene-vorteile-alt  scene-1-alt " id="scene-1-alt">
      <p class="vorteile-text">Bis zu 40% mehr Zahnoberfläche reinigen als mit Zähneputzen allein!</p>
      <img src="https://dr-best-de.preprod-cf65.ch.adobecqms.net/content/dam/cf-consumer-healthcare/drbest/master/interdental/animation/Vorteil1.svg" class="vorteile-image" alt="vorteile-1">
    </div>
    <div class=" scene-alt scene-vorteile-alt  scene-2-alt " id="scene-2-alt">
      <p class="vorteile-text">Für eine gründliche Entfernung von Plaque und Essensresten.</p>
      <img src="https://dr-best-de.preprod-cf65.ch.adobecqms.net/content/dam/cf-consumer-healthcare/drbest/master/interdental/animation/Vorteil2.svg" class="vorteile-image" alt="vorteile-2">
    </div>
    <div class=" scene-alt scene-vorteile-alt  scene-3-alt " id="scene-3-alt">
      <p class="vorteile-text">Sanfte Reinigung zwischen den Zähnen. Hilft bei regelmäßiger Anwendung
        Zahnfleischproblemen vorzubeugen.</p>
      <img src="https://dr-best-de.preprod-cf65.ch.adobecqms.net/content/dam/cf-consumer-healthcare/drbest/master/interdental/animation/Vorteil2.svg" class="vorteile-image" alt="vorteile-2">
      <div class="kong-brush_start"></div>
    </div>
    <div class="scene-brush-alt" id="scene-brush-alt">
      <div class="brush-container-alt">
        <img src="https://dr-best-de.preprod-cf65.ch.adobecqms.net/content/dam/cf-consumer-healthcare/drbest/master/interdental/animation/brush-big-with-shadow.png" class="bigbrush-image" alt="King Kong's brush">
      </div>
      <div class="cap-container-alt">
        <img src="https://dr-best-de.preprod-cf65.ch.adobecqms.net/content/dam/cf-consumer-healthcare/drbest/master/interdental/animation/brush-cap-with-shadow.png" class="cap-image" alt="">
      </div>

    </div>
    <div class=" scene-alt scene-details-alt  scene-4-alt " id="scene-4-alt">
      <h2 class="details-title">Softe Borsten aus nachwachsenden Rohstoffen</h2>
      <p class="details-text">Für eine sanfte Reinigung zwischen den Zähnen.</p>
    </div>
    <div class=" scene-alt scene-details-alt  scene-5-alt " id="scene-5-alt">
      <h2 class="details-title">Flexibler, beschichteter Draht</h2>
      <p class="details-text">Um auch die hinteren Zahnzwischenräume einfach zu erreichen</p>
    </div>
    <div class=" scene-alt scene-details-alt  scene-6-alt " id="scene-6-alt">
      <h2 class="details-title">Ergonomischer, pflanzenbasierter Griff</h2>
      <p class="details-text">aus nachwachsenden Rohstoffen und zudem ergonomisch, um eine einfache und angenehme Anwendung zu ermöglichen.</p>
      <div class="cap-brush-start"></div>
      <div class="kong-brush-end"></div>
    </div>
    <div class=" scene-alt scene-details-alt  scene-7-alt " id="scene-7-alt">
      <h2 class="details-title">Hygienische, umweltfreundliche Schutzkappe</h2>
      <p class="details-text">Ideal um unsere Bürsten immer & überall hygienisch verpackt dabei zu haben.</p>
      <div class="cap-brush-end"></div>
    </div>
  </section>

</main>
              
            
!

CSS

              
                * {
  margin: 0;
  padding: 0;
  border: 0;
}
body {
  overflow-x: hidden;
  width: 100vw;
}
.appear {
  position: relative;
}

.img-wrap {
  display: flex;
  justify-content: center;
}

.norotate {
  position: relative;
  width: 30%;
  background-color: brown;
  color: beige;
  transition: 0.5s all ease-in-out;
}

.main-container-animation {
  color: #1b2148;
  position: relative;
  height: 100%;
}

.main-container-animation .bg-image {
  height: 100%;
  position: absolute;
  width: 100%;
}

.main-container-animation .bg-color {
  background-color: transparent;
  bottom: 0;
  left: 0;
  top: 0;
  position: absolute;
  right: 0;
  width: 100%;
  height: 100%;
}

.scene-alt {
  align-items: center;
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

.scene-alt.scene-0-alt h1 {
  font-family: Larsseit, sans-serif;
  font-size: 55px;
  line-height: 1;
  font-weight: 400;
  left: 10%;
  position: absolute;
  top: 18%;
  width: 490px;
}

.scene-alt.scene-0-alt .brushes {
  align-content: space-between;
  display: flex;
  left: 45px;
  margin: auto;
  position: relative;
  z-index: 1;
  line-height: 0 !important;
}

.scene-alt.scene-0-alt .brushes .brush-small .brush-image {
  height: 100%;
  width: auto;
  position: relative;
  z-index: 1;
}

.scene-alt.scene-0-alt .brushes .size {
  align-items: flex-end;
  display: flex;
  font-weight: 700;
  font-size: 16px;
  margin-left: 15px;
  margin-right: 20px;
  position: relative;
  white-space: nowrap;
  width: 25px;
  line-height: 0 !important;
}

.scene-alt.scene-0-alt .brushes .size .size-inner {
  position: absolute;
  transform: rotate(-90deg);
  transform-origin: left bottom;
}

.scene-alt.scene-0-alt .brushes .size span {
  font-weight: 400;
}

.scene-alt.scene-vorteile-alt,
.end-scene {
  justify-content: space-between;
  height: 100vh;
}

.scene-alt.scene-vorteile-alt .vorteile-text {
  font-family: Larsseit, sans-serif;
  font-size: 40px;
  line-height: 1;
  font-weight: 600;
  margin-left: 10%;
  width: 453px;
}

.scene-alt.scene-vorteile-alt .vorteile-image {
  margin-right: 8%;
  width: 25%;
  height: auto;
}

.scene-alt.scene-details-alt {
  flex-direction: column;
  align-items: flex-start !important;
  justify-content: flex-start;
}

.scene-alt.scene-details-alt .details-title {
  font-family: Larsseit, sans-serif;
  font-size: 60px;
  line-height: 1;
  font-weight: 600;
  margin-left: 10%;
  margin-top: 22vh;
  margin-bottom: 0;
  width: 38%;
}

.scene-alt.scene-details-alt .details-text {
  font-family: Larsseit, sans-serif;
  font-size: 22px;
  line-height: 1;
  font-weight: 400;
  margin-left: 10%;
  margin-top: 1rem;
  width: 30%;
}

.scene-brush-alt {
  box-sizing: border-box;
  bottom: 0;
  height: 100vh;
  max-width: 1920px;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  width: 100%;
  z-index: 5;
}

.scene-brush-alt.stick {
  position: fixed;
  background:red;
}

.scene-brush-alt.under {
  z-index: 2;
}

.scene-brush-alt .brush-container-alt,
.scene-brush-alt .cap-container-alt {
  height: 100%;
  position: absolute;
  right: 0;
  top: 0;
  transform: scaleY(-1);
}

/* @media (max-width: 991px) {
  .scene-brush-alt .brush-container-alt {
    height: 180%;
  }
}

@media (max-width: 767px) {
  .scene-brush-alt .brush-container-alt {
    height: 150%;
  }
}
 */
.scene-brush-alt .brush-container-alt .bigbrush-image,
.scene-brush-alt .cap-container-alt .cap-image {
  height: 150%;
  width: auto;
  transform: translateX(90%);
}

/* .scene-brush-alt .brush-container-alt .cap-container-alt {
  top: -113%;
  height: auto;
  left: 0;
  position: absolute;
  visibility: hidden;
  width: 93%;
} */

.scene-brush-alt .brush-container-alt .cap-container-alt .cap-image {
  width: 100%;
  height: auto;
  transform: translateX(-50%);
}

              
            
!

JS

              
                gsap.registerPlugin(ScrollTrigger);

const BGcolor = document.querySelector(".bg-color");
const tl = gsap.timeline({
  scrollTrigger: {
    trigger: ".scene-1-alt",
    endTrigger: ".scene-3-alt",
    pin: false,
    anticipatePin: 1,
    scrub: 1,
    end: "bottom"
  }
});
tl.to(
  BGcolor,
  {
    duration: 1,
    backgroundColor: "#e268a0",
    ease: "none"
  },
  0
)
  .to(
    BGcolor,
    {
      duration: 1.5,
      backgroundColor: "#e95868",
      ease: "none"
    },
    1
  )
  .to(
    BGcolor,
    {
      duration: 1.5,
      backgroundColor: "#7ecbdb",
      ease: "none"
    },
    2
  );

gsap.to(".brush-2", {
  scrollTrigger: {
    pin: true,
    anticipatePin: 1,
    scrub: 1,
    markers: true,
    trigger: ".brush-2",
    start: "top-=70px",
    endTrigger: ".scene-4-alt",
    end: "center+=800px",
    invalidateOnRefresh: true
  }
});
// var brush = gsap.timeline({
//     scrollTrigger: {
//         trigger: ".brush-2",
//         endTrigger: ".scene-4-alt ",
//         pin: true,
//         anticipatePin: 1,
//         scrub: true,
//         start: 'top-=70px',
//         end: "bottom",
//         markers: true,
//         id: "pin",

//     }
// });

var scene1 = gsap.timeline({
  scrollTrigger: {
    trigger: ".scene-1-alt",
    pin: true,
    anticipatePin: 1,
    scrub: 0,
    start: "top",
    end: "bottom",
    invalidateOnRefresh: true
  }
});
var scene2 = gsap.timeline({
  scrollTrigger: {
    trigger: ".scene-2-alt",
    pin: true,
    anticipatePin: 1,
    scrub: true,
    start: "top",
    end: "bottom",
    invalidateOnRefresh: true
  }
});
var scene3 = gsap.timeline({
  scrollTrigger: {
    trigger: ".scene-3-alt",
    pin: true,
    anticipatePin: 1,
    scrub: 1,
    start: "top",
    end: "bottom",
    invalidateOnRefresh: true
  }
});
var scene4 = gsap.timeline({
  scrollTrigger: {
    trigger: ".scene-4-alt",
    pin: true,
    anticipatePin: 1,
    scrub: 0.2,
    start: "top",
    end: "bottom ",
    invalidateOnRefresh: true
  }
});
var scene5 = gsap.timeline({
  scrollTrigger: {
    trigger: ".scene-5-alt",
    pin: true,
    anticipatePin: 1,
    scrub: 0.2,
    start: "top",
    end: "bottom",
    invalidateOnRefresh: true
  }
});
var scene6 = gsap.timeline({
  scrollTrigger: {
    trigger: ".scene-6-alt",
    pin: true,
    anticipatePin: 1,
    scrub: 0.2,
    start: "top",
    end: "bottom",
    invalidateOnRefresh: true
  }
});
var scene7 = gsap.timeline({
  scrollTrigger: {
    trigger: ".scene-7-alt",
    pin: true,
    anticipatePin: 0,
    scrub: 0.2,
    start: "top",
    end: "bottom",
    invalidateOnRefresh: true
  }
});

gsap.set(".bigbrush-image", {
  xPercent: 50
});

var rotate = gsap
  .timeline({
    scrollTrigger: {
      trigger: ".kong-brush_start",
      endTrigger: ".kong-brush-end",
      pin: true,
      scrub: 0.2,
      start: "top top",
      end: "top"
    }
  })
  .to(".bigbrush-image", {
    x: -500,
    scale: 0.7,
    duration: 0.2
  })
  .to(
    ".bigbrush-image",
    {
      rotation: -180,
      duration: 0.3,
      scale: 0.45,
      transformOrigin: "50% 35%"
      // ease: "power3.inOut"
    },
    "<"
  );

gsap.set(".cap-image", {
  xPercent: 50
});

var rotate = gsap
  .timeline({
    scrollTrigger: {
      trigger: ".cap-brush-start",
      endTrigger: ".cap-brush-end",
      pin: true,
      scrub: 0.2,
      start: "top top",
      end: "top"
    }
  })
  .to(".cap-image", {
    rotation: -180,
    x: -500,
    y: 1500,
    scale: 0.4,
    duration: 0
  })
  .to(
    ".cap-image",
    {
      y: 0,
      duration: 0.3,
      scale: 0.25,
      transformOrigin: "50% 47%"
      // ease: "power3.inOut"
    },
    "<"
  );

let fixed = gsap.timeline({
  scrollTrigger: {
    toggleClass: "stick",
    trigger: "#scene-brush-alt",
    endTrigger: "#scene-7-alt",
    start: "top bottom",
    end: "bottom+=50"
  }
});

              
            
!
999px

Console