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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

              $shadows: ();
$shadows-trans: ();
$shadows-empty: ();
$font-size: 120px;
$step: $font-size / 200;
$count: 400; // 1 shadow per count

// initial base shadow for white on light contrast
$base-shadow: 1px 1px 4px rgba(0,0,0,0.1);
$shadows: append($shadows,$base-shadow,comma);
$shadows-trans: append($shadows-trans,$base-shadow,comma);

// adding each shadow
@for $i from 1 through $count - 1 { 
  // one less because we need to account for the first...
  // ...and because telling the truth is important. only 400, no more no less.
  // decimal ratio for HSL calculations  
  $ratio: $i / $count;
  // relative color, lighter and colder towards center
  $color: hsla($ratio*360,100-$ratio*100, 100-$ratio*100, 0.2);
  // transparent version of same color to avoid color animation on fadeout
  $color-trans: transparentize($color,1);
  // positive shadow increment
  $inc-pos: $i*$step;
  // negative shadow increment
  $inc-neg: $i*-$step;
  // undefined variables outside for loop
  $shadow: null;
  $shadow-trans: null;
  // shadow fade amount
  $fade: 80px;
  // four different directions for shadows. 
  // switching direction for each case
  @if $i % 4 == 0 {
    // down
    $shadow: 0px $inc-pos $fade $color;
    $shadow-trans: 0px $inc-pos 0px $color-trans;
  } @elseif $i % 4 == 1 {
    // right
    $shadow: $inc-pos 0px $fade $color;
    $shadow-trans: $inc-pos 0px 0px $color-trans;
  } @elseif $i % 4 == 2 {
    // left
    $shadow: $inc-neg 0px $fade $color;
    $shadow-trans: $inc-neg 0px 0px $color-trans;
  } @else {
    // bottom
    $shadow: 0px $inc-neg $fade $color;
    $shadow-trans: 0px $inc-neg 0px $color-trans;
  // adding all the shadows to the different lists
  $shadows: append($shadows,$shadow,comma);
  $shadows-trans: append($shadows-trans,$shadow-trans,comma);

body {
  background: black;

@import url(https://fonts.googleapis.com/css?family=Oswald:400);
body::after {
  content: "400!";
  font-family: Oswald, Helvetica, sans-serif;
  font-weight: 400;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  transform-origin: top left;
  text-align: center;
  font-size: $font-size;
  color: white;
  -webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
  text-shadow: $shadows;
  animation-duration: 3s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-name: slant, shadows, letter-spacing;

// shadow magic
@keyframes shadows {
  // no shadow
  0%, 5%, 70%, 100% { text-shadow: $shadows-trans; }
  // yes shadow  
  37.5% { text-shadow: $shadows; }

// skewing
@keyframes slant {
  // no slant
  0%, 5%, 70%, 100% {
    transform: skewX(0deg) skewY(0deg) translate(-50%, -50%);
  // subtle nudge when slanting
  8% {
    transform: skewX(0deg) skewY(-14deg) translate(-50%, -50%);
  // true slant
  10%, 65% {
    transform: skewX(0deg) skewY(-10deg) translate(-50%, -50%);
  // subtle nudge returning to 0
  68% {
    transform: skewX(0deg) skewY(4deg) translate(-50%, -50%);

// subtle growth when shadow is at peak
@keyframes letter-spacing {
  0%, 10%, 65%, 100% { letter-spacing: 0; }
  37.5% { letter-spacing: 0.025em; }

🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.