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.

+ add another resource


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


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.


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.


                mixin Image(src, alt)
      img(src=`${src}/600x600`, alt=alt)
    .caption= alt

  +Image('', 'cut citrus fruits')
  +Image('', 'sliced mango')
  +Image('', 'a bunch of blueberries')
  +Image('', 'a pineapple sitting on a table')
  +Image('', 'frozen raspberries')
  +Image('', 'a sliced strawberry')
  +Image('', 'an arrangement of assorted sliced fruits')
  +Image('', 'sliced watermelons')
  +Image('', 'grapefruits, lemons, and pomegranates')
  +Image('', 'half of an avocado')
  +Image('', 'half of a lime')
  +Image('', 'a single cherry with stem')
  +Image('', 'a bunch of bananas')
  +Image('', 'three pears')
  +Image('', 'a basket full of peaches next to a plate with sliced peaches')
  +Image('', 'a bowl of avocados')



                @import url("");

* {
  box-sizing: border-box;

body {
  margin: 0;
  overflow: hidden;
  height: 100vh;

.images-list {
  position: relative;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: scroll;
  scroll-snap-type: y mandatory;

.list-item {
  --duration: 300ms;
  --ease: cubic-bezier(0, 0.55, 0.45, 1);

  display: grid;
  justify-items: center;
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
  scroll-snap-align: center;

.figure {
  align-self: end;
  width: 50vmin;
  height: 50vmin;

.figure img {
  opacity: 0;

.caption {
  align-self: start;
  padding: 1rem;
  font-size: clamp(1rem, 4vmin, 4rem);
  font-family: "Caveat", sans-serif;
  line-height: 1;
  text-align: center;
  opacity: 0;
  transition: opacity calc(var(--duration) * 2) calc(var(--duration) * 2.75)

.splitting.cells {
  overflow: visible;

.cell-grid {
  perspective: 30vmin;
  perspective-origin: top left;

.cell {
  --delay: calc(var(--row-index) * var(--col-index) * 3ms);

  opacity: 0;
  transform: translate(
    calc(var(--offset-x) * 10px),
    calc(var(--offset-y) * 10px)
  transition: var(--duration) var(--delay) var(--ease);
  transition-property: opacity, transform;

.in-view .caption {
  opacity: 1;

.in-view .cell {
  opacity: 1;
  transform: translate(-4px, -4px);



                const results = Splitting({
  target: ".images-list .figure",
  by: "cells",
  image: true,
  columns: 14,
  rows: 14

const list = document.querySelector(".images-list");
const items = list.querySelectorAll(".list-item");

const options = {
  root: list,
  threshold: 0.5

const oberver = new IntersectionObserver(observerCallback, options);

function observerCallback(entries, observer) {
  entries.forEach((entry) => {
    if (entry.isIntersecting) {"in-view");

items.forEach((item) => oberver.observe(item));