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.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

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.

HTML

            
              <link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">

<div id="app">
  <div class="found cover" id="found">
    <div class="wrapper">
      <div class="results">
      <h2>thank you for your obedience</h2>
      <p class="result">Your leader, <span class="info">{{ name }}</span>, was destroyed by us at <span class="info">{{ address }}</span </p>
 <p class="end">... all hail your new overlords (us btw)</p>
    </div>
        <div class="wrong">got the wrong guy? No worries, mistakes happen. try again <span class="link" @click="hidePage('found'); startAgain()">here</span></div>
    </div>
    
  </div>
  <div class="loading cover" id="loading">
    <p>locating <span>...</span></p>
  </div>
  <div class="main cover" id="main">
    <div class="wrapper">
      <div>
        <p>Please, take us to your leader</p>
      </div>
      <div class="form">
        <div class="input">
          <label for="name">name</label>
          <input type="text" id="name" v-model="name">
        </div>
        <div class="input">
          <label for="coordinates">co-ordinates</label>
          <input type="text" id="coordinates" v-model="coords" place-holder=" ">
        </div>
      </div>
      <div class="button" @mouseover="glitch = true" @mouseleave="glitch = false" @click="getLocation(); hidePage('main')">
        <p :class="['submit-text', {
                   'glitch': glitch
                   }]" data-text="kill">submit</p>
      </div>
    </div>
  </div>
  <div class="home cover" id="landing">
    <div class="title">
      <h1 class="typeEffect">landed</h1>
      <div class="type"></div>
    </div>
    <img class="ufo" src="https://i.postimg.cc/RFMcQBZS/ufo.png" alt="">
  </div>
</div>
            
          
!

CSS

            
              body {
  font-family: "Inconsolata", monospace;
  letter-spacing: 0.2em;
  margin: 0;
}

.w100 {
  width: 100vw;
}

h1 {
  font-weight: normal;
  font-size: 1.2em;
  overflow: hidden;
  position: relative;
  margin-bottom: 0;
}
.title {
  position: relative;
  display: block;
}
.type {
  border-bottom: solid 3px rgba(0, 0, 0, 0.75);
  position: absolute;
  right: -1em;
  width: 1em;
  bottom: 3px;
  animation: blink 0.5s steps(6, end) infinite;
}
.cover {
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  background: white;
}
.home {
  p {
    background: red;
    display: block;
    width: 100%;
  }
  .ufo {
    height: 1.5em;
    margin-left: 2em;
    opacity: 0;
    animation: ufo 2s cubic-bezier(0.44, 0.9, 0.06, 0.58) 2s forwards;
  }
}

.main {
  .form {
    font-size: 1em;
    .input {
      margin: 20px 0;
    }
    input {
      border: none;
      border-bottom: 2px solid black;
      font-family: "Inconsolata", monospace;
      font-weight: bold;
      font-size: 1em;
      letter-spacing: 0.2em;

      &:focus {
        outline: none;
        animation: blink 0.5s infinite;
      }
    }
  }

  .button {
    margin: auto;
    font-size: 1.2em;
    padding-bottom: 5px;
    text-align: center;
    background: black;
    color: white;
    margin-top: 30px;
    cursor: pointer;

    p {
      display: inline-block;
    }
  }
}

.wrapper {
  max-width: 80%;
  margin: auto;
}

.typeEffect {
  animation: type 1s steps(6) 0.5s 1 normal both;
}

.hide {
  animation: hide 0.5s forwards;
}

.dp0 {
  display: none;
}

.result {
  line-height: 2em;
}

.info {
  background: black;
  color: white;
  padding: 5px;
  font-weight: bold;
}

.end {
  margin-top: 50px;
}

.wrong {
  font-size: 0.6em;
  letter-spacing: 0em;
  position: absolute;
  bottom: 50px;
}
.link {
  cursor: pointer;
  border-bottom: 2px solid black;
  
}

$primaryColor: #fff;
$secondaryColor: #000;
$steps: 30;

.glitch {
  // margin: 0 auto;
  color: $primaryColor;
  // font-size: 30px;
  font-family: "Inconsolata", monospace;
  // font-weight: 600;
  text-align: center;
  transform: scale3d(1, 1, 1);
  position: relative;
  text-align: center;
  transform: scale3d(1, 1, 1);
    // text-transform: uppercase;
  

  &::before,
  &::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    background: $secondaryColor;
    color: $primaryColor;
    clip: rect(0, 900px, 0, 0);
  }

  &::before {
    left: 7px;
    text-shadow: 1px 0 green;
    animation: glitch-effect 3s infinite linear alternate-reverse;
  }

  &::after {
    left: 3px;
    text-shadow: -1px 0 red;
    animation: glitch-effect 2s infinite linear alternate-reverse;
  }
}

@keyframes glitch-effect {
  @for $i from 0 through $steps {
    #{percentage($i*(1/$steps))} {
      clip: rect(random(100)+px, 9999px, random(100)+px, 0);
    }
  }
}

@keyframes type {
  from {
    width: 0;
  }
  to {
    width: 4em;
    // border-right: none;
  }
}

@keyframes blink {
  from {
    border-bottom-color: rgba(0, 0, 0, 0.75);
  }
  to {
    border-bottom-color: transparent;
  }
}

@keyframes ufo {
  0% {
    opacity: 0;
    transform: translateY(-30px) rotate(-5deg);
  }
  40% {
    transform: rotate(5deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0px);
  }
}

@keyframes hide {
  // from {
  //   display: block;
  //   opacity: 1;
  // }
  // to {
  //   opacity: 0;
  //   display: none;
  // }
  0% {
    opacity: 1;
  }
  50% {
    opacity: 1; 
  }
  56% {
    opacity: 0; 
  }
  57% {
    opacity: 0; 
  }
  58% {
    opacity: 1; 
  }
  71% {
    transform: scaleY(1), skewX(0deg); 
  }
  72% {
    transform: scaleY(3), skewX(-60deg); 
  }
  73% {
    transform: scaleY(1), skewX(0deg); 
  }
  80% {
    opacity: 1 ;
  }
  81% {
    opacity: 0; 
  }
  84% {
    opacity: 0; 
  }
  85% {
    opacity: 1; 
  }
  91% {
    transform: scaleX(1), scaleY(1), skewX(0deg);
      color: black;
  }
  92% {
    transform: scaleX(1.5), scaleY(.2), skewX(80deg);
      color: green; 
  }
  93% {
    transform: scaleX(1), scaleY(1), skewX(0deg);
    color: black;
    }
}

            
          
!

JS

            
              new Vue({
  el: "#app",

  data() {
    return {
      coords: "",
      name: "",
      address: "1600 Pennsylvania Ave NW, Washington, DC 20500, USA",
      glitch: false
    };
  },

  methods: {
    getLocation() {
      const apikey = "95e4e91b66a3477c92ea7fe6ccbc37cd";
      const latitude = this.coords.split(",")[0];
      const longitude = this.coords.split(",")[1];
      const api_url = "https://api.opencagedata.com/geocode/v1/json";
      const request_url =
        api_url +
        "?" +
        "key=" +
        encodeURIComponent(apikey) +
        "&q=" +
        encodeURIComponent(latitude) +
        "," +
        encodeURIComponent(longitude) +
        "&pretty=1" +
        "&no_annotations=1";

      axios
        .get(request_url)
        .then(response => {
          const data = JSON.parse(response.request.responseText);
          this.address = data.results[0].formatted;
          setTimeout(() => {
            this.hidePage("loading");
          }, 1000);
        })
        .catch(err => {
          console.log(err);
        });
    },
    hidePage(section) {
      const el = document.getElementById(section);
      el.classList.add("hide");
      setTimeout(() => {
        el.classList.add("dp0");
      }, 1000);
    },
    addGlitch() {
      document.querySelector(".submit-text").classList.add("glitch");
      console.log("hia");
    },
    startAgain() {
      const els = document.querySelectorAll(".dp0");
      setTimeout(() => {
             for (var i = 0; i < els.length; i++) {
        if (!els[i].matches(".home")) {
          els[i].classList.remove("dp0");
          els[i].classList.remove("hide");
          this.name = "";
          this.coords = "";
        }
      }
      document.querySelector('.found').classList.remove("dp0", "hide");
      }, 1000)

      console.log("start");
    }
  },

  created() {
    setTimeout(() => this.hidePage("landing"), 5000);
  }
});

            
          
!
999px

Console