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 CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              <header>
  <h3>Your time is limited, so don't waste it living someone else's life.</h3>
</header>
<p id="quoteAuthor">Steve Jobs</p>
<div class="container">
<div class="section">
        <div class="content clearfix">
          <div class="card effect hourEf" data-id="1">
            <div class="front">
              <span class="hour time">front</span>
            </div>
            <div class="back">
              <span class="hour time">back</span>
            </div>
          </div><!-- /card -->
          <div class="card effect minuteEf" data-id="1">
            <div class="front">
              <span class="minute time">front</span>
            </div>
            <div class="back">
              <span class="minute time">back</span>
            </div>
          </div><!-- /card -->

          <div class="card effect secondEf" data-id="1">
            <div class="front">
              <span class="second time">front</span>
            </div>
            <div class="back">
              <span class="second time">back</span>
            </div>
          </div><!-- /card -->
      </div><!-- /section -->
  
  </div>
            
          
!
            
              body {
    background: #1d1d1e;
}

header{
  font-family: 'Architects Daughter', cursive;
  font-size:25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: rgba(128,128,128,1);
  text-shadow: 1px 1px 0 rgba(140,140,140,0.6) , -1px -1px 1px rgba(0,0,0,0.67) ;
}

#quoteAuthor{
  font-family: 'Architects Daughter', cursive;
  font-size:25px;
  color: rgba(58,58,58,1);
  text-shadow: 1px 1px 0 rgba(140,140,140,0.6) , -1px -1px 1px rgba(0,0,0,0.67) ;
  text-align:right;
  padding-right: 15%;
}
.content {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  padding-bottom: 5%
}

/**
 * The cards
 *
 * Each card plays home to a front and back. I've set them up as squares here
 * by using the padding technique, but you may set them up in any dimensions
 * you like based on your site design.
 */
.card {
  position: relative;
  float: left;
  padding-bottom: 35%;
  width: 25%;
  text-align: center;
  perspective: 600px;
}

.front,
.back {
  background-color: black;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  -webkit-box-shadow: 5px 5px 11px 0px rgba(0,0,0,0.59);
-moz-box-shadow: 5px 5px 11px 0px rgba(0,0,0,0.59);
box-shadow: 5px 5px 11px 0px rgba(0,0,0,0.59);
  -webkit-backface-visibility: hidden; /* Chrome, Safari, Opera */
    backface-visibility: hidden;
}

.back {
  -webkit-transform: rotateX(-180deg);
          transform: rotateX(-180deg);
}

.time{
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  margin: auto;
  height: 20px;
  font-family: 'Rationale', sans-serif;
  font-size:15vw;
  line-height: 20px;
  color:white; }
 
.card.effect.flipped .front {
  -webkit-transition: -webkit-transform 0.5s;
          transition: transform 0.5s;
  transition-timing-function: linear;
  -webkit-transform: rotateX(-180deg);
          transform: rotateX(-180deg);
}
.card.effect.flipped .back {
  -webkit-transition: -webkit-transform 0.5s;
          transition: transform 0.5s; 
  transition-timing-function: linear;
  -webkit-transform: rotateX(10deg);
          transform: rotateX(-359deg);
}



            
          
!
            
              /*
 *By Suleyman Tekin 02/07.2017
 */

var minute, hour, sec;
function setup(){
  var date = new Date();
  sec = addZero(date.getSeconds());
  minute = addZero(date.getMinutes());
  hour = addZero(date.getHours());
  showSecond();
  if(sec==00){
    showMinute();
    if(minute == 59){
      showHour();
    }
  }
}

function showSecond(){
  $('.card.effect.secondEf').hasClass( "flipped" )  === true ? $('.card.effect.secondEf').removeClass("flipped") : $('.card.effect.secondEf').addClass("flipped");
  $('.second').text(sec);
 
}

function showMinute(){
  $('.card.effect.minuteEf').hasClass( "flipped" )  === true ?      $('.card.effect.minuteEf').removeClass("flipped") :     $('.card.effect.minuteEf').addClass("flipped");
  if($('.minuteEf .front').is(':visible')) {
      $('.back .minute').text(minute);
      $('.front .minute').text(addZero(minute-1));
  }else{
      $('.front .minute').text(minute);
      $('.back .minute').text(addZero(minute-1));
  }  
}

function showHour(){
   
  $('.card.effect.hourEf').hasClass( "flipped" )  === true ? $('.card.effect.hourEf').removeClass("flipped") : $('.card.effect.hourEf').addClass("flipped");
  $('.hour').text(hour);
}

setup();
setInterval(setup, 500);
showSecond();
showMinute();
showHour();

function addZero(a){
  if(a == -1){return "00";}
  if(a <10){
    return "0" + a;
  }
  return a;
}


            
          
!
999px
Loading ..................

Console