cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

            
              <!-- 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>
            
          
!
            
              * {
    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%;
}
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console