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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                <div class="columns" data-scroll-container="">
    <div class="column column-reverse">
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/1.04213a58.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Cyber Blue</span> <span>2011</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/2.3ff1fdb6.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Gnostic Will</span> <span>2012</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/3.b606be87.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>French Kiss</span> <span>2013</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/4.24fd614c.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Half Life</span> <span>2014</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/5.d13f5e61.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Love Boat</span> <span>2015</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/6.786c7db4.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Golden Ray</span> <span>2016</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/7.df95fe5c.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Blame Game</span> <span>2017</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/8.e7faf38e.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Lone Dust</span> <span>2018</span> </figcaption>
        </figure>
    </div>
    <div class="column">
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/9.ea63bab4.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Lucky Wood</span> <span>2019</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/10.57de09c7.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Good Earth</span> <span>2020</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/11.ba790930.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Empty Words</span> <span>2021</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/12.c3a8d893.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Nonage Line</span> <span>2009</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/13.3bd52250.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Blue Hell</span> <span>2010</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/14.b7263516.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Cold Blood</span> <span>2011</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/15.55bda21b.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Tulip Heat</span> <span>2012</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/16.eb88393b.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Red Wrath</span> <span>2013</span> </figcaption>
        </figure>
    </div>
    <div class="column column-reverse">
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/17.3450839a.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Bold Human</span> <span>2014</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/18.763d23f6.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Loyal Royal</span> <span>2015</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/19.be25549f.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Lone Cone</span> <span>2016</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/20.d7a9356b.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Dutch Green</span> <span>2017</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/21.4c8813a5.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Valley Hill</span> <span>2018</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/22.ec97ea6e.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Kale Hale</span> <span>2019</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/23.49e8893a.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Fake Cake</span> <span>2020</span> </figcaption>
        </figure>
        <figure class="column__item">
            <div class="column__item-imgwrap">
                <img src="https://tympanus.net/Development/ColumnScroll/24.057dafba.jpg" alt="" title="" height="" width="" />
            </div>
            <figcaption class="column__item-caption"> <span>Book Belly</span> <span>2021</span> </figcaption>
        </figure>
    </div>
</div>

<div class="warning">⚠️ Unfortunately your browser does not support CSS Scroll-Linked Animations, so this demo won't work for you. If you're feeling adventurous use Chromium 95+ with “Experimental Web Platform Features” enabled.</div>
<div class="info">⚠️ Your browser does not support CSS Scroll-Linked Animations, but <a href="https://github.com/flackr/scroll-timeline" target="_top">a JavaScript polyfill</a> with some <abbr title="Web Animations API">WAAPI</abbr> code is used as a fallback.</div>
              
            
!

CSS

              
                /* Three column layout */
.columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    width: 100%;
    max-width: 80em;
    margin: 0 auto;
    position: relative;
}

/* Inside one column, lay out all items in column direction */
.column {
    --column-offset: 10vh;
    display: flex;
    flex-direction: column;
    padding: var(--column-offset) 0;
}

/* Limit site of the images */
.column__item-imgwrap img {
    border-radius: 1em;
    width: 100%;
    height: auto;
    aspect-ratio: 0.75;
    object-fit: cover;
}

.column__item-caption {
    text-align: center;
}

/* Show warning for older browsers */
.warning,
.info {
    position: fixed;
    right: 1em;
    left: 1em;
    bottom: 1em;
    padding: 1em;
    border: 1px solid black;
    z-index: 9999;
    text-align: center;
    color: black;
    background: rgba(255 255 225 / 0.9);
}
.warning a,
.info a {
    color: blue;
}
.info {
    display: none;
    border: 1px solid #123456;
    background: rgba(205 230 255 / 0.8);
}

/* Scroll-Timeline Supported, Yay! */
@supports (animation-timeline: works) {
    /* Hide Warning */
    .warning {
        display: none;
    }

    /* As we're about to shift content out of .columns, we need it to hide its overflow */
    .columns {
        overflow-y: hidden;
    }

    .column-reverse {
        /* Flip item order in reverse columns */
        flex-direction: column-reverse;
    }

    /* Set up Animation */
    @keyframes adjust-position {
        /* Start position: shift entire column up, but not so that it goes out of view */
        from {
            transform: translateY(calc(-100% + 100vh));
        }
        /* End position: shift entire column down, but not so that it goes out of view */
        to {
            transform: translateY(calc(100% - 100vh));
        }
    }

    /* Set up scroll-timeline */
    @scroll-timeline scroll-in-document {
        source: auto; /* Default scroll-timeline: scrolling in the document */
    }

    /* Hook our animation with the timeline to our columns */
    .column-reverse {
        animation: 1s adjust-position linear forwards;
        animation-timeline: scroll-in-document;
    }
}

/* general styles */
* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
        "Segoe UI Symbol";
}

              
            
!

JS

              
                // Polyfill for browsers with no Scroll-Timeline support
import "https://flackr.github.io/scroll-timeline/dist/scroll-timeline.js";

// Fallback for browsers that don't support CSS ScrollTimeline
if (!CSS.supports("animation-timeline: foo")) {
    // Replace warning box with info box
    document.querySelector(".warning").style.display = "none";
    document.querySelector(".info").style.display = "block";

    // As we're about to shift content out of .columns, we need it to hide its overflow
    document.querySelector(".columns").style.overflowY = "hidden";

    // Set up timeline
    const timeline = new ScrollTimeline({
        scrollSource: document.documentElement,
        timeRange: 1,
        fill: "both"
    });

    // Loop all eligible columns
    document.querySelectorAll(".column-reverse").forEach(($column) => {
        // Flip item order in reverse columns
        $column.style.flexDirection = "column-reverse";

        // Hook Animation
        $column.animate(
            {
                transform: [
                    "translateY(calc(-100% + 100vh))",
                    "translateY(calc(100% - 100vh))"
                ]
            },
            {
                duration: 1,
                fill: "both",
                timeline
            }
        );
    });
}

              
            
!
999px

Console