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='wrapper'>
  <p class="neon-text" data-text="game over">game over</p>
  <p class="neon-text rotating-text" data-text="game over">game over</p>
</div>
              
            
!

CSS

              
                @import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");

$gameFont: "Press Start 2P", cursive;

$sassy: #bf4080;
$coral: #fe5f55;
$royal: #6f2ed8;
$tiffany: #00b4d8;
$peach: #e6f14a;
$offWhite: #fffff7;

$colors: $sassy, $coral, $royal, $tiffany, $peach;

.wrapper {
  display: flex;
  flex-direction: column;
  width: 70vw;
  gap: 0.5rem;
  justify-content: center;
  align-content: center;
  margin: auto;
  text-align: center;
}

:root {
  background: black;
}

.neon-text {
  position: relative;
  font-family: $gameFont;
  font-size: 4.2rem;
  position: relative;
  width: 100%;
  text-transform: uppercase;
  -webkit-text-stroke: 1px $sassy;
  color: $offWhite;

  z-index: 10;

  &::before {
    content: attr(data-text);
    position: absolute;
    bottom: 8px;
    right: 8px;

    font-family: inherit;
    font-size: 4.2rem;
    color: $sassy;
    width: 100%;
    height: 100%;
    animation: animateTextColor 3s infinite linear;

    z-index: -1;
    // border: 2px solid green;
  }
}

.rotating-text {
  position: relative;
  -webkit-text-stroke: 1px $sassy;

  &::before {
    animation: rotatingWord 2.8s linear infinite;
  }

  &::after {
    content: attr(data-text);
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 8px;
    animation: animateTextColor 3s infinite linear,
      rotatingWord 5s linear infinite;
    z-index: -1;
  }
}
@mixin randomColor($colors) {
  $color: nth($colors, random(length($colors)));
  color: $color;
}

@keyframes animateTextColor {
  0% {
    @include randomColor($tiffany);
  }
  20% {
    @include randomColor($colors);
  }
  50% {
    @include randomColor($colors);
  }
  60% {
    @include randomColor($colors);
  }
  80% {
    @include randomColor($colors);
  }
  100% {
    @include randomColor($tiffany);
  }
}

@keyframes rotatingWord {
  0% {
    transform: translate(0px, 0px);
  }
  20% {
    transform: translate(5px, 0px);
  }
  40% {
    transform: translate(5px, 5px);
  }
  60% {
    transform: translate(0px, 5px);
  }
  100% {
    transform: translate(0px, 0px);
  }
}

              
            
!

JS

              
                
              
            
!
999px

Console