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

              
                <div class="cards">
  <h3>Movies</h3>
  <h1>Popular</h1>
  <div class="card" style="--view-transition-name:card-1">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=1') center / cover no-repeat"></div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/62105/3dr_mono.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>Howl's Moving Castle</span>
    </h3>
    
  </div>
  <div class="card" style="--view-transition-name:card-2">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=2') center / cover no-repeat"></div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/62105/3dr_chihiro.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>Spirited Away</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-3">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=3') center / cover no-repeat"></div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/62105/3dr_howlcastle.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>Howl's Moving Castle</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-4">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=4') center / cover no-repeat"></div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/wizard.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>The Wizard</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-5">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=5') center / cover no-repeat"></div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/barbarian.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>The Barbarian</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-6">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=6') center / cover no-repeat"></div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/archer.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>The Archer</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-7">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=7') center / cover no-repeat"></div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/giant.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>The Giant</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-8">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=8') center / cover no-repeat"></div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/195612/goblin.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>The Goblin</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-9">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=8') center / cover no-repeat"></div>
    <img src="https://ggayane.github.io/css-experiments/cards/dark_rider-character.webp" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>The Dark Rider</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-10">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=10') center / cover no-repeat"></div>
    <img src="https://ggayane.github.io/css-experiments/cards/force_mage-character.webp" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>Force Mage</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-11">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=11') center / cover no-repeat"></div>
    <img src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/908370/jelly.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>Mesmerizing Depths</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-12">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=12') center / cover no-repeat"></div>
    <img src="https://i.ibb.co/Dw3q3tZ/cutout.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>The Eagle</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-13">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=13') center / cover no-repeat"></div>
    <img src="https://i.ibb.co/RC70XmC/m-cutout.png" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>The Monkey</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-14">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=14') center / cover no-repeat"></div>
    <img src="https://firebasestorage.googleapis.com/v0/b/fotos-3cba1.appspot.com/o/batman.png?alt=media&token=bcce964a-7224-4e47-b619-265e93b5311e" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>ARTFX DC UNIVERSE Batman HUSH Renewal Package</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-15">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=15') center / cover no-repeat"></div>
    <img src="https://firebasestorage.googleapis.com/v0/b/fotos-3cba1.appspot.com/o/blackpanter.png?alt=media&token=de5d3491-e31f-4d91-aa3d-1eb15827d954" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>Mafex No.091 MAFEX BLACK PANTHER</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-16">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=16') center / cover no-repeat"></div>
    <img src="https://firebasestorage.googleapis.com/v0/b/fotos-3cba1.appspot.com/o/arthur.png?alt=media&token=7e0f09e6-1369-42c5-9c98-af99946fae72" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>Nendoroid Fate/Grand Order: Saber/Arthur Pendragon Ascension</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
  <div class="card" style="--view-transition-name:card-17">
    <div class="card__bg" style="background: url('https://picsum.photos/800/600?random=17') center / cover no-repeat"></div>
    <img src="https://firebasestorage.googleapis.com/v0/b/fotos-3cba1.appspot.com/o/kashima.png?alt=media&token=ffed0174-7dbe-4b61-bd42-05608a3a3090" alt="" class="card__thumbnail">
    <h3 class="card__title">
      <span>figma Kantai Collection -Kan Colle- Kashima</span>
    </h3>
    <button>
      <svg t="1696403426056" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15857" width="200" height="200"><path d="M896 320l0 512c0 105.984-86.016 192-192 192l-384 0c-106.048 0-192-86.016-192-192l0-512c-35.328 0-64-28.672-64-64s28.672-64 64-64l192 0c0-106.048 85.952-192 192-192 105.984 0 192 85.952 192 192l192 0c35.392 0 64 28.672 64 64s-28.608 64-64 64l0 0zM512 128c-35.328 0-64 28.672-64 64l128 0c0-35.328-28.672-64-64-64l0 0zM768 320l-512 0 0 512c0 35.392 28.672 64 64 64l384 0c35.392 0 64-28.608 64-64l0-512zM640 384l64 0 0 448-64 0 0-448zM448 384l128 0 0 448-128 0 0-448zM320 384l64 0 0 448-64 0 0-448z" fill="currentColor" p-id="15858"></path></svg>
    </button>
  </div>
</div>
<div class="tutorials">
  <a href="https://s.juejin.cn/ds/idkRes2Y/" target="_blank">
    <svg t="1696988571607" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4422" width="200" height="200"><path d="M924.8 576.64v-115.2c12.8-13.44 13.44-26.88 12.8-34.56-3.2-30.08-36.48-42.24-47.36-46.72-79.36-30.08-226.56-89.6-307.84-122.88-49.28-24.32-65.28-19.84-113.28-0.64-12.8 5.12-224.64 83.84-306.56 117.76-44.8 18.56-51.2 46.08-51.2 61.44 0 25.6 17.92 48.64 50.56 62.08L259.84 537.6v257.28l8.32 8.32c3.84 3.84 91.52 92.16 252.16 92.16 150.4 0 236.16-88.96 240-92.8l7.68-8.32V540.16l36.48-15.36-1.28 52.48-29.44 49.28 88.96 84.48 98.56-85.76-36.48-48.64zM710.4 771.2c-22.4 18.56-88.96 67.2-190.08 67.2-111.36 0-179.84-48.64-202.88-67.2V561.28l144.64 58.88h0.64c46.08 17.28 81.28 16 125.44-3.2l122.24-51.84v206.08z m154.24-138.24l-17.92-16.64 13.44-22.4 2.56-102.4c4.48-14.08-0.64-25.6-8.32-32-7.68-7.04-21.76-11.52-36.48-2.56L565.12 563.84c-30.08 13.44-49.92 14.08-81.92 2.56l-298.88-121.6c-7.68-3.2-12.16-6.4-14.08-8.96 1.92-1.92 6.4-5.12 14.72-8.96 81.92-33.92 302.72-116.48 305.28-117.12h0.64c38.4-15.36 38.4-15.36 67.2-0.64l1.92 0.64c80.64 32.64 226.56 92.16 307.2 122.88v163.2l16 21.12-18.56 16z" p-id="4423"></path></svg>
  </a>
  
</div>
              
            
!

CSS

              
                @layer reset, base, layout, transitions;

@layer transitions {
  
  @keyframes outgoing {
    0% {
      translate: 0 0;
      scale: 1;
      opacity: 1;
    }
    100% {
      translate: 100vw -100vh;
      scale: 1.2;
      opacity: 0;
    }
  }
  :root {
    view-transition-name: none;
  }

  ::view-transition {
    pointer-events: none;
  }
  
  .card {
    view-transition-name: var(--view-transition-name);
  }
  ::view-transition-old(outgoing) {
    animation: outgoing 1s linear  both;
    animation-composition: add;
  }
  
}

@layer layout {
  .cards {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0px 10px 20px 20px rgba(0, 0, 0, 0.17);
    display: grid;
    padding: 30px 35px 160px;
    perspective: 1400px;
    transform-origin: 50% 50%;
    transform-style: preserve-3d;
    transform: rotateX(11deg) rotateY(16.5deg);
    color: #333;
    grid-template-rows: min-content min-content minmax(0, 1fr);
    grid-template-areas:
      "subtitle"
      "title"
      "thumbnail";
    cursor: pointer;
    transition: all 0.28s linear;
    width: 800px;
    contain: layout;
    will-change: transform;

    & h3 {
      grid-area: subtitle;

      color: #eb285d;
      font-size: 16px;
      margin-bottom: 6px;
      translate: 0 0 25px;
    }

    & h1 {
      grid-area: title;
      color: #3e3e42;
      font-size: 32px;
      font-weight: 800;
      letter-spacing: -1px;
      margin-bottom: 30px;
      translate: 0 0 35px;
    }

    .card {
      grid-area: thumbnail;

      border-radius: 15px;
      border: 1px solid rgb(0 0 0 / 0.15);
      box-shadow: 0 0 0 1px rgb(0 0 0 / 0.025);
      overflow: hidden;
      perspective: 1200px;
      position: relative;
      transform-style: preserve-3d;
      translate: 0 0 35px;
      rotate: var(--rotate, 0deg);
      transform-origin: center bottom;
      transition: all 200ms ease-out;
      text-align: center;
      width: 300px;
      aspect-ratio: 3 / 4;
      z-index: var(--index, 1);
      margin-inline: auto;
      
      &:only-of-type {
        --rotate: 0deg !important;
      }
    }
  }

  .card__bg {
    position: absolute;

    inset: -80px;
    transform-origin: 50% 50%;
    translate: 0 0 -50px;
    z-index: 0;
    filter: blur(3px);
    transition: all 0.2s linear;
    
  }

  .card__thumbnail {
    top: 14px;
    right: -10px;
    height: 110%;
    position: absolute;
    transition: all 0.2s linear;
    z-index: 2;
  }

  .card__title {
    align-items: center;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0%,
      rgba(0, 0, 0, 0.55) 100%
    );
    bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 70px;
    justify-content: center;
    position: absolute;
    width: 100%;
    z-index: 3;

    & span {
      color: #fff;
      font-size: 18px;
      font-weight: 700;
      padding: 0 10px;
      margin-bottom: 3px;
    }
  }
  
  button {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 64px;
    aspect-ratio: 1;
    border-radius: 50%;
    background-color: rgb(0 0 0 / .5);
    border: none 0;
    z-index: 99;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    translate: 0 0 35px;
    
    & svg {
      display: block;
      width: 32px;
      height: 32px;
      color: #fff;
    }
  }
}

@layer reset {
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
  }
}

@layer base {
  body {
    width: 100vw;
    min-height: 100vh;
    font-family: "Exo", "Bungee Shade", cursive, Arial, sans-serif;
    background-color: #557;
    color: #fff;
    display: grid;
    place-content: center;
    padding: 1rem;
  }
  @media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
      animation-delay: -1ms !important;
      animation-duration: 1ms !important;
      animation-iteration-count: 1 !important;
      background-attachment: initial !important;
      scroll-behavior: auto !important;
      transition-duration: 0s !important;
      transition-delay: 0s !important;
    }
  }
  
  .tutorials {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
    width: 64px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #3f517e;
    padding: .5rem;
    display: grid;
    place-content: center;
    transition: all .28s linear;
    
    &:hover {
      background:#4161b2;
    }
    
    & svg {
      display: block;
      width: 100%;
      height: 100%;
      filter: invert(1);
    }
  }
}

              
            
!

JS

              
                const cards = document.querySelector(".cards");
const buttons = document.querySelectorAll("button");
const thumbnails = document.querySelectorAll(".card__thumbnail");
const backgrounds = document.querySelectorAll(".card__bg");
const range = 60;
const calcValue = (a, b) => ((a / b) * range - range / 2).toFixed(1);
const cardlist = document.querySelectorAll(".card");
const startDeg = -40;
let timeout;

buttons.forEach((button, i) => {
  button._name = i;
  const card = button.parentNode;
  card.addEventListener("click", (event) => {
    event.stopPropagation();
  });
  button.addEventListener("click", (event) => {
    card.style.viewTransitionName = "outgoing";
    const cardLength = document.querySelectorAll(".card").length;
    const degTotal = 90 / cardLength;
    cardlist.forEach((card, index) => {
      card.style.setProperty(`--rotate`, `${startDeg + Math.round(index * degTotal)}deg`);

      card.style.setProperty(`--index`, `${index + 1}`);
    });
    viewTransition(() => {
      cards.removeChild(card);
    });
  });
});

function viewTransition(fn, params) {
  if (document.startViewTransition) {
    document.startViewTransition(() => fn(params));
  } else {
    fn(params);
  }
}

document.addEventListener(
  "mousemove",
  ({ x, y }) => {
    if (timeout) {
      window.cancelAnimationFrame(timeout);
    }

    timeout = window.requestAnimationFrame(() => {
      const yValue = calcValue(y, window.innerHeight);
      const xValue = calcValue(x, window.innerWidth);

      cards.style.transform = `rotateX(${yValue}deg) rotateY(${xValue}deg)`;

      [].forEach.call(thumbnails, (thumbnail) => {
        thumbnail.style.transform = `translateX(${-xValue}px) translateY(${yValue}px)`;
      });

      [].forEach.call(backgrounds, (background) => {
        background.style.backgroundPosition = `${xValue * 0.45}px ${
          -yValue * 0.45
        }px`;
      });
    });
  },
  false
);

              
            
!
999px

Console