cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

Code Indentation


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.

              <div class="container">
  <div class="box easeBox" data-timing="sineInOut"></div>
  <div class="box easeBox" data-timing="backInOut"></div>
  <div class="box easeBox" data-timing="circIn"></div>
  <div class="box easeBox" data-timing="quintOut"></div>
  <div class="box easeBox" data-timing="expoIn"></div>

<div class="container">
  <div class="box rotateBox">rotate</div>
  <div class="box fadeBox">fade</div>
              body {
  width: 100%;
  height: 300vh;

.container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;

.container:nth-child(1) { height: 200vh; }
.container:nth-child(2) { height: 0; }

.box {
  padding: 1em 2em;
  margin: 0 .5em;
  background: #ddd;
  will-change: transform;

.box::before {
  content: attr(data-timing);

.easeBox { transform: translateY(var(--ty)); }
.rotateBox { transform: rotate(var(--r)); }
.fadeBox { opacity: var(--o); }
              const easeBoxes = []

// Create an animation for each ease box. Each with a different timing.
document.querySelectorAll('.easeBox').forEach((elem, i) => {

  // Get the timing from the data attribute.
  // You can also hard-code the timing, but for the demo it's easier this way.
  const timing = elem.getAttribute('data-timing')

  // Crate an instance for the current element and store the instance in an array.
  // We start the animation later using the instances from the array.
    elem: elem,
    from: 'middle-bottom',
    to: 'bottom-top',
    direct: true,
    props: {
      '--ty': {
        from: '0',
        to: '100px',
        timing: timing


const rotateBox = basicScroll.create({
  elem: document.querySelector('.rotateBox'),
  from: 'top-middle',
  to: 'top-top',
  props: {
    '--r': {
      from: '0',
      to: '1turn'

const fadeBox = basicScroll.create({
  elem: document.querySelector('.fadeBox'),
  from: 'bottom-bottom',
  to: 'top-middle',
  inside: (instance, percentage) => console.log('fadeBox is animating'),
  outside: (instance, percentage) => console.log('fadeBox is not animating'),
  props: {
    '--o': {
      from: .01,
      to: .99

easeBoxes.forEach((easeBox) => easeBox.start())
Loading ..................