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

              
                <!--

Variable Font Experiment
         No.2

A playground to discover what’s possible when vFonts and CSS clash together. I’m in charge of pulling all strings on all sides ➼ Using the fonts and designing them to exactly serve the needs. A little baby steps towards some pretty slick novelties here. Play around with the CodePens.

markfromberg.com/projects/variable-font-preview/

-->
<link rel="stylesheet" href="http://markfromberg.com/public/css/codepen.css">

<body onload="create()">
  <div class="wrapper">
    <h1 class="fun"></h1>
  </div>
  <button class="playbutton hide" onclick="buttonCallback()"></button>
  [[[https://codepen.io/mark2mark/pen/gdeajv]]]
</body>
              
            
!

CSS

              
                :root {
  --speed: 1.25s;
  --max: 100;
  --style: ease;
  --background: 252, 251, 248;
  --blue: rgb(0,108,210);
  --powerRed: rgb(255,61,0);
}
html, body {
  margin: 0;
  padding: 0;
}
body {
  background: rgb(var(--background));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: none;
}
@font-face {
  font-family: mark2mark-variable-font;
  src: url('https://markfromberg.com/public/fs/vF/fnt.php?f=vFontExperiments02GX.ttf');
}
@keyframes pulseIn {
  0%, 100% { font-variation-settings: "INLN" var(--max); }
  50% {	font-variation-settings: "INLN" 0; }
}
.wrapper {
  font-family: mark2mark-variable-font;
  margin: 4vh auto;
  background-color: black;
  border: 3.5vh double white;
  width: 85vh;
  height: 85vh;
  -webkit-box-shadow: 0px 0px 11px 1px rgba(224,224,224,1);
  -moz-box-shadow: 0px 0px 11px 1px rgba(224,224,224,1);
  box-shadow: 0px 0px 11px 1px rgba(224,224,224,1);
}
.wrapper h1 {
  left: -1.5%;
  margin: 1.5%;
  font-weight: normal;
  height: 100%;
}
h1 {
  display: block;
  width: 100%;
  text-align: center;
  font-size: 25vh;
  white-space: nowrap;
  line-height: 0.8em;
}
.fun {
  position: relative;
  color: white;
  font-variation-settings: "INLN" var(--max);
  animation-name: pulseIn;
  animation-timing-function: var(--style);
}
::selection {
  color: red;
  background: transparent;
}
              
            
!

JS

              
                var css = document.createElement("style");
css.type = "text/css";
var word = "XOOOOXOOOOXOOOOX"
var fun = document.getElementsByClassName("fun")[0];
var b = document.getElementsByClassName('playbutton')[0]
var amount = 1;
var buttonHide = 3000;

window.addEventListener('load', function() {
  hideButton()
})

function create() {
  for (var i = 0; i < word.length; i++) {
    var l = word[i];
    if (i % 4 == 0 & i != 0) {
      fun.innerHTML += "<br/>";
    }
    fun.innerHTML += "<x"+i+">"+l+"</x>";
    css.innerHTML += "x"+i+" { animation: pulseIn var(--speed) calc(var(--speed)*" +i+ "/16) "+amount+"; }";
  }
  document.body.appendChild(css);
}

function replay() {
  b.classList.toggle('hide');
  hideButton()
  
  fun.innerHTML += "";
}

function hideButton() {
  setTimeout(function () {
    b.classList.toggle('hide');     
  }, buttonHide );
}

function buttonCallback() {
  hideButton()
  hideButton()

  replay();
}

              
            
!
999px

Console