Pen Settings

HTML

CSS

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

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

HTML

              
                <div class="eavesdrop">
  <header>
    <h1 data-text="Eavesdrop">Eavesdrop</h1>
  </header>
  
  <aside>
    <p>A progressive web app to unshorten URLs. Proof-of-concept built with
        React, Node, and Netlify functions.</p>
    <p><a href="https://dbushell.com/2020/01/27/building-a-pwa-with-netlify-functions/">About Eavesdrop</a></p>
  </aside>
 
  <main>
    <form autocomplete="off">
      <fieldset class="app-fieldset">
        <label class="app-label u-vh" for="url">Short URL</label>
        <input class="app-url" required id="url" type="url" name="url" placeholder="https://">
        <button class="app-button u-vh" type="submit">Go!</button>
      </fieldset>
    </form>
    <div role="alert"><p>⚠️ Live site: <a target="_blank" href="https://eavesdrop.app/">eavesdrop.app</a></p></div>
  </main>
  <footer>
    <p><a href="https://github.com/dbushell/eavesdrop.app">MIT licensed</a> &ndash; Copyright © 2020 <a href="https://dbushell.com/">David Bushell</a> &ndash; <a href="https://twitter.com/dbushell">@dbushell</a></p>
  </footer>
</div>
<script>
  (function(d) {
    var config = {
      kitId: 'kyo1upk',
      scriptTimeout: 3000,
      async: true
    },
    h=d.documentElement,t=setTimeout(function(){h.className=h.className.replace(/\bwf-loading\b/g,"")+" wf-inactive";},config.scriptTimeout),tk=d.createElement("script"),f=false,s=d.getElementsByTagName("script")[0],a;h.className+=" wf-loading";tk.src='https://use.typekit.net/'+config.kitId+'.js';tk.async=true;tk.onload=tk.onreadystatechange=function(){a=this.readyState;if(f||a&&a!="complete"&&a!="loaded")return;f=true;clearTimeout(t);try{Typekit.load(config)}catch(e){}};s.parentNode.insertBefore(tk,s)
  })(document);
</script>
              
            
!

CSS

              
                $green: #3dcc9c;
$pink: #ff6680;
$text: #494b4d;
$yellow: #fffbcc;

:root {
  --h: 340; // 340;
  --s: 65%; // 65%;
  --l: 55%; // 55%;

  --error: hsl(var(--h), 100%, 80%);
  --gradient: hsla(230, 60%, 30%, 0.5);
  --body: hsl(var(--h), var(--s), calc(var(--l) - 4%));
  --header: hsl(var(--h), calc(var(--s) - 0%), calc(var(--l) - 0%));
  --aside: hsl(var(--h), calc(var(--s) - 0%), calc(var(--l) - 14%));
  --main: hsl(var(--h), calc(var(--s) - 0%), calc(var(--l) - 10%));
  --shadow: hsl(var(--h), calc(var(--s) - 0%), calc(var(--l) - 18%));
}

*,
*:before,
*:after {
  box-sizing: border-box;
}

// Hide only visually, but have it available for screenreaders: h5bp.com/v
.u-vh {
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  white-space: nowrap;
}

html {
  background: var(--body);
  font-family: aglet-slab, sans-serif;
  font-style: normal;
  font-weight: 400;
}

.eavesdrop {
  display: grid;
  grid-template-columns: 1fr 2fr;
  grid-template-rows: 1fr 2fr auto auto;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  animation: hue 2ms linear;
  
  // &:after {
  //   content: "";
  //   position: absolute;
  //   top: 0;
  //   left: 0%;
  //   width: 100%;
  //   height: 100%;
  //   background-image: radial-gradient(circle at 0% 33%, transparent, transparent 50%, rgba(255, 255, 255, 0.8) 75%, transparent 75%);
  //   pointer-events: none;
  //   opacity: 0.1;
  // }
}

@keyframes skew {
  50%, 56% {
    transform: translateZ(0);
  }
  52% {
    transform: translateX(1px) skew(-2deg, 0);
  }
  54% {
    transform: translateY(1px) skew(2deg, 0);
  }
}

@keyframes scanlines {
  from {
    transform: translateY(-2px);
    opacity: 0.2;
  }
  to {
    transform: translateY(2px);
    opacity: 0.4;
  }
}

@keyframes glitch {
  0% {
    clip-path: polygon(0 10%, 100% 10%, 100% 60%, 0 60%);
  }
  10% {
    clip-path: polygon(0 50%, 100% 50%, 100% 50%, 0 50%);
  }
  20% {
    clip-path: polygon(0 50%, 100% 50%, 100% 70%, 0 70%);
  }
  30% {
    clip-path: polygon(0 50%, 100% 50%, 100% 50%, 0 50%);
  }
  40% {
    clip-path: polygon(0 20%, 100% 20%, 100% 30%, 0 30%);
  }
  50% {
    clip-path: polygon(0 50%, 100% 50%, 100% 50%, 0 50%);
  }
  60% {
    clip-path: polygon(0 30%, 100% 30%, 100% 70%, 0 70%);
  }
  70% {
    clip-path: polygon(0 50%, 100% 50%, 100% 50%, 0 50%);
  }
  80% {
    clip-path: polygon(0 60%, 100% 60%, 100% 90%, 0 90%);
  }
  90% {
    clip-path: polygon(0 50%, 100% 50%, 100% 50%, 0 50%);
  }
  100% {
    clip-path: polygon(0 50%, 100% 50%, 100% 100%, 0 100%);
  }
}

h1 {
  color: rgba(255, 255, 255, 1);
  font-weight: 800;
  font-size: 8.5vw;
  margin: 0;
  position: relative;
  z-index: 1;
  animation: skew 2000ms linear infinite;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.7);

  &:after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    background-clip: text;
    background: linear-gradient(to bottom, transparent 50%, var(--header) 51%);
    background-size: 100% 3px;
    animation: scanlines 200ms linear infinite;
    color: transparent;
    opacity: 0;
    will-change: opacity, transform;
  }
  
  &:before {
    content: attr(data-text);
    position: absolute;
    left: 1px;
    top: 0;
    overflow: hidden;
    animation: glitch 1000ms infinite linear alternate-reverse;
    z-index: -1;
  }
}

header {
  align-items: flex-end;
  background: var(--header);
  display: flex;
  grid-column: 2 / 3;
  grid-row: 1 / 1;
  padding: 2vh 7vw;
  position: relative;
}

aside {
  background: var(--aside);
  background-image: linear-gradient(to top, var(--gradient), var(--aside) 70%);
  // box-shadow: inset -20px 0 40px var(--shadow);
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  padding: 5vh 3.5vw;
  color: $yellow;
  position: relative;
  
  p {
    font-size: 2.5vw;
    line-height: 1.35;
    letter-spacing: 0.03rem;
    margin: 1.5vw 0;
  }
  
  a {
    color: rgba(255, 255, 255, 1);
  }
}

[role="alert"] {
  color: var(--error);
  text-shadow: 0 -1px 0 var(--shadow);
  
  p {
    font-size: 2.5vw;
    line-height: 1.35;
    letter-spacing: 0.03rem;
    margin: 1.5vw 0;
  }
  
  a {
    color: inherit;
  }
}

main {
  background: var(--main);
  background-image: linear-gradient(to top, var(--gradient), var(--main) 70%);
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  padding: 5vh 7vw;
  position: relative;
}

footer {
  background: var(--gradient);
  color: rgba(255, 255, 255, 0.7);
  grid-column: 1 / 3;
  grid-row: 4 / 5;
  padding: 15px 7vw;
  text-align: right;

  p {
    font-size: 14px;
    letter-spacing: 0.03rem;
    line-height: 20px;
    margin: 0;
  }
  
  a {
    color: inherit;
    text-decoration: none;
  }
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

input[type="url"] {
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: 1.25vw;
  box-shadow:
    2px 2px 4px 0 var(--shadow),
    8px 8px 16px 0 var(--shadow);
  font-family: aglet-slab, sans-serif;
  font-size: 2.5vw;
  line-height: 1.35;
  padding: 1.5vw 2vw;
  width: 100%;
  transition: background 200ms;
  // background: $green;
  
  &::placeholder {
    color: $text;
    opacity: 0.5;
    transition: opacity 200ms;
  }
  
  &:focus {
    background: rgba(255, 255, 255, 1);

    &::placeholder {
      opacity: 0.3;
    }
  }
  
  .u-done & {
    background: $yellow;
    box-shadow:
      inset 0 0 0 3px $green,
      2px 2px 4px 0 var(--shadow),
      8px 8px 16px 0 var(--shadow);
  }
  
  .u-waiting & {
    background: rgba(255, 255, 255, 0.5);
  }
  
  &:invalid {
    // box-shadow: none;
  }
}

@media screen and (max-width: 600px) {
  .eavesdrop {
    grid-template-columns: 0 1fr;
  }
  
  h1 {
    font-size: 50px;
  }
  
  input[type="url"] {
    font-size: 16px;
    padding: 10px 15px;
  }
  
  aside {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    padding: 15px 7vw;
    background: var(--gradient);
    
    p {
      font-size: 18px;
    }
  }
  
  [role="alert"] {
    p {
      font-size: 18px;
      margin: 15px 0;
    }
  }
  
  footer {
    text-align: left;
    padding: 15px 7vw;
  }
}
              
            
!

JS

              
                
              
            
!
999px

Console