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

              
                <!-- BootStrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css">

<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Roboto|Roboto+Mono" rel="stylesheet">

<body>
  <div class="wrapper">
    <!-- Content -->
    <div class="main-content">
      <div class="counterDown text-center">
        <h1>COMING SOON</h1>
        <hr>
        <div id="demo">
          <div id="jours" class="text-center"></div>
          <div id="heures" class="text-center"></div>
          <div id="minutes" class="text-center"></div>
          <div id="secondes" class="text-center"></div>
        </div>
        <div id="infos">
            <div class="infos-jours">Jours</div>
            <div class="infos-heures">Heures</div>
            <div class="infos-minutes">Minutes</div>
            <div class="infos-secondes">Secondes</div>
        </div>
      </div>
    </div>
    
    <!-- Footer -->
    <footer class="text-center">
      <p>Copyright Marc Schneider - <span id="annee"></span> © Tous droits réservés. </p>
    </footer>
  </div>
  
  <!-- JavaScript -->
  <script type="text/javascript">
    // Date de fin
var countDownDate = new Date('Jul 12, 2018 00:00:00').getTime();

// Update toutes les 1 secondes
var x = setInterval(function() {
  
  // Récupération de la date du jour
  var now = new Date().getTime();
  
  // Calcul de la distance entre aujourd'hui et la fin
  var distance = countDownDate - now;
  
  //Calcul des temps
  var days = Math.floor(distance / (1000 * 60 * 60 * 24));
  
  var hours = Math.floor ((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
  
  var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
  
  var seconds = Math.floor((distance % (1000 * 60)) / 1000);
  
  // Affichage du résultat dans l'id=demo
  document.getElementById("jours").innerHTML = days;
  document.getElementById("heures").innerHTML = hours;
  document.getElementById("minutes").innerHTML = minutes;
  document.getElementById("secondes").innerHTML = seconds;
  
  // On stylise les éléments
  document.getElementById("jours").style.backgroundColor = 'rgba(126,85,39,0.2)';
  document.getElementById("heures").style.backgroundColor = 'rgba(126,85,39,0.2)';
  document.getElementById("minutes").style.backgroundColor = 'rgba(126,85,39,0.2)';
  document.getElementById("secondes").style.backgroundColor = 'rgba(126,85,39,0.2)';
  
  document.getElementById("jours").style.color = 'rgb(126,85,39)';
  document.getElementById("heures").style.color = 'rgb(126,85,39)';
  document.getElementById("minutes").style.color = 'rgb(126,85,39)';
  document.getElementById("secondes").style.color = 'rgb(126,85,39)';
  
  document.getElementById("jours").font.weight = 'bold';
  document.getElementById("heures").font.weight = 'bold';
  document.getElementById("minutes").font.weight = 'bold';
  document.getElementById("secondes").font.weight = 'bold';
  
  // Si le compteur arrive à la fin
  if (distance < 0) {
    clearInterval(x);
    document.getElementById("demo").innerHTML = "EXPIRED";
  }
}, 1000);
  </script>
  
  <script type="text/javascript">
    var date = new Date();
    var annee = date.getFullYear();

    document.getElementById('annee').innerHTML = annee;
  </script>
  
</body>
              
            
!

CSS

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

html {
    font-family: -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans",
    "Droid Sans", "Helvetica Neue", sans-serif;
    font-size: 62.5%; /* 1rem vaut 10px */
}

body {
    font-size: 1.4rem; /* 1.4 rem vaut 14px */
    height: 100%;
}

.wrapper {
  display: flex;
  background-image: url('https://cdn.allwallpaper.in/wallpapers/2400x1350/926/fog-forests-landscapes-trees-2400x1350-wallpaper.jpg');
  background-size: cover;
  color: rgb(245,245,245);
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  display: flex;
  flex: 1;
}

.counterDown {
  margin: auto;
}

.counterDown h1 {
  font-size: 4rem;
}

hr {
  background-color: rgba(255,255,255, 0.8);
}

#demo {
  display: flex;
  flex-direction: row;
  font-size: 1.6rem;
}

#jours {
  font-family: "Roboto Mono", sans-serif;
  font-size: 4rem;
  height: 10rem;
  margin-right: 1rem;
  width: 8rem;
}

#heures {
  font-family: "Roboto Mono", sans-serif;
  font-size: 4rem;
  height: 10rem;
  margin-right: 1rem;
  width: 8rem;
}

#minutes {
  font-family: "Roboto Mono", sans-serif;
  font-size: 4rem;
  height: 10rem;
  margin-right: 1rem;
  width: 8rem;
}

#secondes {
  font-family: "Roboto Mono", sans-serif;
  font-size: 4rem;
  height: 10rem;
  margin: auto;
  width: 8rem;
}

#infos {
  color: rgba(126,85,39,1);
  display: flex;
  flex-direction: row;
  font-size: 1.6rem;
}

.infos-jours {
  font-family: "Roboto Mono", sans-serif;
  margin-right: 1rem;
  margin-top: -3rem;
  width: 8rem;
}

.infos-heures {
  font-family: "Roboto Mono", sans-serif;
  margin-right: 1rem;
  margin-top: -3rem;
  width: 8rem;
}

.infos-minutes {
  font-family: "Roboto Mono", sans-serif;
  margin-right: 1rem;
  margin-top: -3rem;
  width: 8rem;
}

.infos-secondes {
  font-family: "Roboto Mono", sans-serif;
  margin: auto;
  margin-top: -3rem;
  width: 8rem;
}

/* Footer */
footer {
  border-top: 1px solid rgba(255,255,255, 0.5);
  font-size: 1.3rem;
  padding-top: 0.6rem;
  margin-left: auto;
  margin-right: auto;
  width: 80%;
}
              
            
!

JS

              
                
              
            
!
999px

Console