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 id="wrapper">
  <div id="container">
    
    <img id="star" src="http://enwaara.se/codepen/deathstar.svg" />
    
    <ul id="countdown"></ul>
    
  </div>
</div>
              
            
!

CSS

              
                @mixin border-radius($radius) {
  -webkit-border-radius: $radius;
  -moz-border-radius: $radius;
  -ms-border-radius: $radius;
  border-radius: $radius;
}

$primary-color: #aebebf;
$decor-color: #95a5a6;
$font: "proxima-nova", sans-serif;
$decor-font: "rift", sans-serif;

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-transition: 0.2s ease-in-out;
  -moz-transition: 0.2s ease-in-out;
  -o-transition: 0.2s ease-in-out;
  transition: 0.2s ease-in-out;
  font-family: $font;
  font-weight: 300;
  color: $primary-color;
  &:focus{
    outline: none;
  }
}

body{
  background: #C82647;
}

#wrapper{
   position: absolute;
   top: 50%;
   margin-top: -335px;
   left: 0;
   width: 100%;
}

#container{
  width: 375px;
  height: 670px;
  margin: 0 auto;
  box-shadow: 1px 1px 10px 2px rgba(0,0,0,0.2);
  @include border-radius(5px);
  position: relative;
  text-align: center;
  padding: 20px 30px;
  overflow: hidden;
  background: rgb(68,68,68);
  background: -moz-linear-gradient(45deg, rgba(68,68,68,1) 0%, rgba(90,90,90,1) 100%);
  background: -webkit-linear-gradient(45deg, rgba(68,68,68,1) 0%,rgba(90,90,90,1) 100%);
  background: linear-gradient(45deg, rgba(68,68,68,1) 0%,rgba(90,90,90,1) 100%);
}

#star{
  width: 300px;
  height: auto;
  -webkit-filter: drop-shadow(1px 1px 2px #282830);
  filter: drop-shadow(1px 1px 2px #282830);
}

#countdown{
  width: 100%;
  overflow: hidden;
  padding-top: 20px;
  li{
    list-style: none;
    float: left;
    width: 50%;
    text-align: center;
    h1{
      font-size: 4em;
      letter-spacing: 5px;
      font-family: $decor-font;
      font-weight: 700;
    }
    p{
      text-transform: uppercase;
      font-size: 0.8em;
      letter-spacing: 3px;
      padding: 20px 0;
      color: $decor-color;
    }
  }
}

@media screen and (max-width: 1440px){
  #wrapper{
    transform: scale(0.7);
  }
}
              
            
!

JS

              
                var end = new Date('12/18/2019 00:1 AM');

var _second = 1000;
var _minute = _second * 60;
var _hour = _minute * 60;
var _day = _hour * 24;
var timer;

function showRemaining() {
  var now = new Date();
  var distance = end - now;
  if (distance < 0) {

      clearInterval(timer);
      document.getElementById('countdown').innerHTML = 'EXPIRED!';

      return;
  }
  var days = Math.floor(distance / _day);
  var hours = Math.floor((distance % _day) / _hour);
  var minutes = Math.floor((distance % _hour) / _minute);
  var seconds = Math.floor((distance % _minute) / _second);

  document.getElementById('countdown').innerHTML = '<li><h1>' + (days <= 9 ? "0" : "") + days + '</h1><p>days</p></li>';
  document.getElementById('countdown').innerHTML += '<li><h1>' + (hours <= 9 ? "0" : "") + hours + '</h1><p>hours</p></li>';
  document.getElementById('countdown').innerHTML += '<li><h1>' + (minutes <= 9 ? "0" : "") + minutes + '</h1><p>mins</p></li>';
  document.getElementById('countdown').innerHTML += '<li><h1>' + (seconds <= 9 ? "0" : "") + seconds + '</h1><p>secs</p></li>';
}

timer = setInterval(showRemaining, 1000);
              
            
!
999px

Console