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

+ 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.


                <figure class="scene" data-scene>
  <div class="stage" data-stage></div>

<aside class="controls">
    <label>x rotation</label>
    <input class="range" type="range" min="-180" max="180" value="50" data-property="x" data-unit="deg">
    <span data-value="x"></span>

    <label>y rotation</label>
    <input class="range" type="range" min="-180" max="180" value="20" data-property="y" data-unit="deg">
    <span data-value="y"></span>
    <label>z rotation</label>
    <input class="range" type="range" min="-180" max="180" value="-30" data-property="z" data-unit="deg">
    <span data-value="z"></span>
    <input class="range" type="range" min="10" max="1000" value="500" data-property="perspective" data-unit="px">
    <span data-value="perspective"></span>
    <label>x perspective origin</label>
    <input class="range" type="range" min="0" max="100" value="50" data-property="x-perspective-origin" data-unit="%">
    <span data-value="x-perspective-origin"></span>

    <label>y perspective origin</label>
    <input class="range" type="range" min="0" max="100" value="50" data-property="y-perspective-origin" data-unit="%">
    <span data-value="y-perspective-origin"></span>
    <label>font size</label>
    <input class="range" type="range" min="5" max="100" value="10" data-property="font-size" data-unit="vmin">
    <span data-value="font-size"></span>


                @import url('');

$color-primary: blue;
$color-secondary: #ffe400;

*:after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;

body {
  width: 100%;
  height: 100%;

body {
  font-family: 'JetBrains Mono', sans-serif;
  color: $color-secondary;
  background-color: $color-primary;

.scene {
  --x: 50deg;
  --y: 20deg;
  --z: -30deg;
  --perspective: 500px;
  --x-perspective-origin: 50%;
  --y-perspective-origin: 50%;
  --font-size: 10vmin;
  position: relative;
  width: 100%;
  height: 100%;
  perspective: var(--perspective);
  transform-style: preserve-3d;
  perspective-origin: var(--x-perspective-origin) var(--y-perspective-origin);

.stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-style: preserve-3d;
  transform: translateX(-50%) translateY(-50%) rotateX(var(--x)) rotateY(var(--y)) rotateZ(var(--z));

.row {
  display: flex;
  transform-style: preserve-3d;

.glyph {
  display: block;
  font-size: var(--font-size);
  line-height: 1em;
  will-change: transform;

.controls {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 10px;


                const scene = document.querySelector('[data-scene]')
const stage = document.querySelector('[data-stage]')
const glyphs = ('VOORHOEDE').split('')
const controls = document.querySelectorAll('[data-property]')

function initStage() {
  const row = `
    <div class="row" data-row>
      ${ => `<span class="glyph" data-glyph>${glyph}</span>`).join('')}
  const rows = new Array(3).fill(row).join('')
  stage.innerHTML = rows

function initAnimation() {
  const rows = document.querySelectorAll('[data-row]')
  rows.forEach((row, index) => animateRow(row))

function animateRow(row) {
  const duration = 500
  const glyphs = row.querySelectorAll('[data-glyph]')
  const zOffset = 10
  glyphs.forEach((glyph, index) => {
      transform: [`translateZ(${-zOffset}vmin)`, `translateZ(${zOffset}vmin)`],
      easing: 'ease-in-out'
      delay: index * -duration * .15,
      iterations: Infinity,
      direction: 'alternate-reverse'

function initControls(controls) {
  controls.forEach(control => {
    control.addEventListener('input', controlHandler)
  function controlHandler({ currentTarget }) {
    const { property, unit } = currentTarget.dataset
    const value = document.querySelector(`[data-value="${property}"]`)`--${property}`, `${currentTarget.value}${unit}`)
    value.innerHTML = currentTarget.value