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>
  <div class="r1-logo r1-stat__graphic">
    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640" width="640" height="640" class="r1-logo__slashes">
      <path d="m208.7 443.7 107.7.5 138.4-205.1-107.7-.5z" fill="#f0af13" class="r1-logo__slash r1-logo__slash--gold" />
      <path d="m270.4 179.4-47.7 71.3h54.9l47.6-71.3z" fill="#9ddae6" class="r1-logo__slash r1-logo__slash--blue" />
      <path d="M266 458.5h54.9l47.6-71.4h-54.8z" fill="#f7921e" class="r1-logo__slash r1-logo__slash--orange" />
      <path d="M414.1 279.9h18.2l47.7-71.3h-18.2z" fill="#ce372f" class="r1-logo__slash r1-logo__slash--red" />
    </svg>

    <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 320" width="320" height="320" class="r1-logo__characters">
      <path d="m262.8 50.5-21.3 32.3h-33.8L229 50.5h-3.1l-21.3 32.4-.2 1.2c-3.4 19.6-23.4 26.6-40.9 26.6h-4.8l21-31.9h-3.1l-21.1 32v34.8H190v67.7l53.6-80.3.2-.3V84.1L266 50.5h-3.2z" fill="#002d5b" />
      <path d="M76.2 195.5h8.1c8.6 0 12.7 2.5 12.7 17 0 4.4.2 9 .4 13.5l.1 3.6-21.3 32.3v-66.4zm79.2 65c-1.2-.9-2.2-2-2.8-3.4-1-2.1-2.2-10.1-2.2-20.8v-15c0-11.5-.4-23.5-5-31.6-4-7.1-11-12.2-19.4-14.2 17.1-4.8 25.7-19.5 25.7-43.8 0-30.1-15-46.4-44.6-48.5l21.5-32.6h-3.1l-21.8 33L78 122h2.8c10.5 0 17.5 2.9 17.5 17.3 0 13.5-5.2 20-16 20h-6.1v-34.6L23 204.3l-.2.3v61.5L0 300.6h3.1l22.2-33.7H76l21.6-32.8c.1 1.9.1 3.7.1 5.3 0 14.6 1.4 23.7 4.1 27l.4.5h52l1.8-2.7 22.3-33.8h-3.1l-19.8 30.1z" fill="#002d5b" />
    </svg>
  </div>
  
  <button class="button">Replay</button>
</div>
              
            
!

CSS

              
                @use "sass:math";

$distance: 20rem;
$angle: 56.25deg;
$x: $distance * math.cos($angle);
$y: $distance * math.sin($angle);

html {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

*,
*:before,
*:after {
  -webkit-box-sizing: inherit;
  -moz-box-sizing: inherit;
  box-sizing: inherit;
}

body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  margin: 0;
  text-align: center;
}

.r1-logo {
  position: relative;
  max-width: 400px;

  svg {
    display: block;
    width: 100%;
    height: auto;
  }

  &__slashes {
    transform: scale(2);
  }

  &__slash {
    will-change: transform, opacity;

    @media screen and (prefers-reduced-motion: no-preference) {
      .animate & {
        animation-name: animate-slash-down, fade-in;
        animation-duration: 0.375s;
        animation-timing-function: cubic-bezier(0.4, 0.64, 0, 1.4);
        animation-fill-mode: both;

        &--blue {
          animation-name: animate-slash-up, fade-in;
        }

        &--red {
          animation-delay: 0.15s;
        }

        &--orange {
          animation-name: animate-slash-up, fade-in;
          animation-delay: 0.3s;
        }

        &--gold {
          animation-delay: 0.45s;
        }
      }
    }
  }

  &__characters {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    @media screen and (prefers-reduced-motion: no-preference) {
      .animate & {
        animation-name: fade-in, animate-characters-in;
        animation-duration: 0.25s, 0.75s;
        animation-delay: 0.525s;
        animation-timing-function: cubic-bezier(0, .1, 0, 1);
        animation-fill-mode: both;
      }
    }

    path {
      fill: #002855;
    }
  }
}

.button {
  position: relative;
  height: 2.5rem;
  margin-top: 4rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: .25rem;
  border: #dbdbdb;
  background: #2B85E7;
  box-shadow: 0 .125rem .25rem 0 rgba(black, .25);
  color: #fff;
  text-transform: uppercase;
  cursor: pointer;
}

@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes animate-slash-down {
  from {
    transform: translate($x, -$y);
  }
  to {
    transform: translate(0, 0);
  }
}

@keyframes animate-slash-up {
  from {
    transform: translate(-$x, $y);
  }
  to {
    transform: translate(0, 0);
  }
}

@keyframes animate-characters-in {
  from {
    transform: translate(-50%, -50%) scale(0.9);
  }
  to {
    transform: translate(-50%, -50%) scale(1);
  }
}

              
            
!

JS

              
                (function () {
  var logo = document.querySelector(".r1-logo"),
    button = document.querySelector(".button");

  logo.classList.add("animate");

  button.addEventListener("click", function () {
    logo.classList.remove("animate");

    logo.offsetWidth;

    setTimeout(() => {
      logo.classList.add("animate");
    }, "100");
  });
})();

              
            
!
999px

Console