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.

            
              .container
  .clock
    .side
      .line
    .side
      .line
      .glas
        h1 clOck
        p dailycssimages
        .reflex
        .t-hours
          .tick-hour
        .t-mins
          .tick-min
        .t-secs
          .tick-sec
        .alarm  
      ul.secs
        - for(var x = 0;x <= 59;x++)
          li
      ul.mins
        - for(var x = 0;x <= 11;x++)
          li
      ul.min
        - for(var x = 12;x > 0;x--)
          li
            span= x
    .side
      .button
    .side
      .line
    .side
      .line
    .side
    .shadow
            
          
!
            
              html, body {
  margin: 0;
  padding: 0;
}

html {
  box-sizing: border-box;
}

*, *:before, *:after {
  box-sizing: inherit;
}


.container {
  width: 300px;
  height: 300px;
  margin: 0 auto;
  position: fixed;
  perspective: 1200px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  .clock {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform-origin: center center;
    transform: rotateX(-15deg) rotateY(-20deg) translateZ(-150px);
    background: #000;
    
    &:after {
        content: "";
        position: absolute;
        height: 30px;
        width: 345px;
        background: linear-gradient(rgba(0,0,0,.2) 0%, rgba(0,0,0,0) 100%);
        top: 365px;
        left: -76px;
        border-radius: 4px 4px 0 0;
     }
    
    h1, p {
      position: absolute;
      z-index: 1;
      text-align: center;
      width: 100%;
      color: #ddd;
      transform: scaleX(-1) rotate(-180deg); 
      font-weight: 100;
      font-family: Arial;      
    }
    
    h1 {
      top: 160px;
      font-size: 14px;
    }
    
    p {
      top: 145px;
      font-size: 11px;
      color: #bbb;
    }
    
    .shadow {
      position: absolute;
      background: rgba(0,0,0,.8);
      width: 100%;
      height: 100%;
      z-index: 10;
     transform: rotateX(90deg) translateZ(-150px);
      box-shadow: -20px 20px 120px 0 rgba(0,0,0,.8);
     
    }
    
    .glas {
      position: absolute;
      left: 20px;
      top: 20px;
      right: 20px;
      bottom: 20px;
      border-radius: 50%;
      border: 5px solid #000;
      box-shadow: 
        1px 0 4px 0 rgba(255,255,255,.3),
        inset 0 0  5px #666,
        inset -20px -10px 120px 0 rgba(100,100,100,.4);
    }
    
    .reflex {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%,-50%);
        background: #f6bc0d;
        width: 30px;
        height: 30px;
        z-index: 10;
        border-radius: 50%;
        box-shadow: 
          inset -3px 0 0 0 rgba(255,255,255,.5),
          inset 1px 0 0 0 rgba(0,0,0,.5),
          0 -1px 4px 1px rgba(0,0,0,.5);
     }
    
    .t-secs {
      position: absolute;
      width: 100%;
      height: 100%;
      animation: tick 60s normal infinite steps(60, end);
      z-index: 5;
    }
    
    .t-mins {
      position: absolute;
      width: 100%;
      height: 100%;
      animation: tick 3600s normal infinite steps(3600,end);
      z-index: 4;
    }
    
    .t-hours {
      position: absolute;
      width: 100%;
      height: 100%;
      animation: tick 21600s normal infinite steps(3600,end);
      z-index: 3;
    }
    
   .tick-sec {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%,-50%) rotate(120deg);
      width: 30px;
      height: 30px;
      border-radius: 50%;
      z-index: 5;
      background: #f6bc0d;
       
     &:before, &:after {
       content: "";
       position: absolute;
       background: #f6bc0d;
       width: 5px;
       z-index: 3;
       transform: translateX(-50%);
       left: 50%;
       border-radius: 3px;
     }
     
     &:before {
       height: 100px;
       margin-top: -5px;
       top: 100%;
       box-shadow: 
          inset -1px 0 0 0 rgba(255,255,255,.5),
          inset 1px 0 0 0 rgba(0,0,0,.5),
          2px 0 0 0 rgba(0,0,0,.8);
     }
     
     &:after {
       height: 20px;
       width: 20px;
       margin-bottom: -5px;
       bottom: 100%;
       border-radius: 10px 10px 0 0;
       box-shadow: 
          inset -1px 0 0 0 rgba(255,255,255,.5),
          inset 1px 0 0 0 rgba(0,0,0,.5),
          2px 0 0 0 rgba(0,0,0,.8);
     }
     
    }
    
    .tick-min {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%,-50%) rotate(-30deg);
      width: 30px;
      height: 30px;
      border-radius: 50%;
      z-index: 2;
      background: #eee;
       
     &:before {
       content: "";
       position: absolute;
       background: #eee;
       width: 8px;
       z-index: 4;
       transform: translateX(-50%);
       left: 50%;
       border-radius: 4px;
     }
     
     &:before {
       height: 100px;
       margin-top: -5px;
       top: 100%;
       box-shadow: 
          inset -2px 0 0 0 rgba(255,255,255,1),
          inset 1px 0 0 0 rgba(0,0,0,.5);
     }
     
    }
    
    .tick-hour {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%,-50%) rotate(60deg);
      width: 30px;
      height: 30px;
      border-radius: 50%;
      z-index: 2;
      background: #fff;
       
     &:before {
       content: "";
       position: absolute;
       background: #eee;
       width: 12px;
       z-index: 4;
       transform: translateX(-50%);
       left: 50%;
       border-radius: 6px;
       box-shadow: 
         inset -4px 0 0 0 rgba(255,255,255,1),
         inset 1px 0 0 0 rgba(0,0,0,.5);
     }
     
     &:before {
       height: 80px;
       margin-top: -5px;
       top: 100%;
     }
     
    }
    
   .alarm {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%,-50%) rotate(-165deg);
      width: 30px;
      height: 30px;
      border-radius: 50%;
      z-index: 2;
      background: #000;
       
     &:before {
       content: "";
       position: absolute;
       background: #000;
       width: 8px;
       z-index: 4;
       transform: translateX(-50%);
       left: 50%;
     }
     
     &:before {
       height: 70px;
       margin-top: -5px;
       top: 100%;
       border: 1px solid rgba(100,100,100,.5);
       box-shadow: inset 0 -10px 0 0 #7dab59;
     }
     
    }
    
  ul, li {
    margin: 0;
    padding: 0;
    list-style-type: none;
    z-index: 1;
  }
  
  ul {
    transform-origin: 50% 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin: -10px 0 0 -10px;
    border: 1px solid #ccc;
  }
    
  li {
    position: absolute;
    width: 20px;
    height: 20px;
    font-size: 16px;
    line-height: 20px;
    text-align: right;
  }
  
  .secs {
    li {
        &:after {
          content: "";
          position: absolute;
          right: 0;
          top: 0;
          background: rgba(255,255,255,.4);
          width: 5px;
          height: 2px;
        }
        @for $i from 1 through 60 {
         &:nth-child(#{$i}) {
           $rotation: 6 * $i;
           transform: rotate(#{$rotation}deg) translateX(100px);
         }
      }
    }
  }
    
  .mins {
    li {
        &:after {
          content: "";
          position: absolute;
          right: 0;
          top: 50%;
          background: #ddd;
          width: 10px;
          height: 4px;
        }
        @for $i from 1 through 12 {
         &:nth-child(#{$i}) {
           $rotation: 30 * $i;
           transform: rotate(#{$rotation}deg) translateX(100px);
         }
      }
    }
  }
    
  .min {
    color: #ccc;
    font-family: Helvetica, sans-serif;
    font-weight: 100;
    span {
      font-size: 13px;
      display: block;
      position: absolute;
      width: 100&;
      height: 100%;
      right: 0;
      top: 0;
      
    }
    li {
        @for $i from 1 through 12 {
         &:nth-child(#{$i}) {
           $rotation: 30 * ($i + 2);
           transform: rotate(#{$rotation}deg) translateX(80px);
           $r: $rotation + 180;
           span {
             transform: scaleX(-1) rotate(#{$r}deg);    
           }
         }
      }
    }
  }

    
    .side {
      position: absolute;
      width: 300px;
      height: 300px;
      background: #ddd;
      border-radius: 10px;
      
      &:nth-child(1) {
        z-index: -1;
        transform: rotateX(0deg) translateZ(-150px);  
        .line {
          position: absolute;
          right: -25%;
          top: 100%;
          width: 150%;
          height: 1px;
          background:  linear-gradient(rgba(0,0,0,.1) 70%, rgba(0,0,0,0) 100%);
          
        }
      }
      &:nth-child(2) {
        transform: rotateX(180deg) translateZ(-150px);  
        background: #1b191c;
        .line {
          position: absolute;
          left: -25%;
          bottom: 100%;
          width: 150%;
          height: 1px;
          background:  linear-gradient(rgba(0,0,0,.1) 70%, rgba(0,0,0,0) 100%);
          
        }
      }
      &:nth-child(3) {
        transform: rotateX(-90deg) translateZ(-150px);
        background: linear-gradient(#302f2d 0%, #615b5d 100%);
        &:after {
          content: "";
          position: absolute;
          right: 0px;
          top: 40px;
          width: 100%;
          height: 25px;
          background: #000;
          border-bottom: 5px solid rgba(255,255,255,.5);
        }
      }
      &:nth-child(4) {
        transform: rotateY(90deg) translateZ(-150px);  
        .line {
          position: absolute;
          left: -40%;
          top: 100%;
          width: 200%;
          height: 1px;
          background:  linear-gradient(rgba(0,0,0,.1) 70%, rgba(0,0,0,0) 100%);
          
        }
      }
      &:nth-child(5) {
        transform: rotateY(-90deg) translateZ(-150px);  
        background: linear-gradient(-45deg, #302f2d, #76757b 100%);
        
        .line {
          position: absolute;
          left: -50%;
          top: 100%;
          width: 200%;
          height: 1px;
          background:  linear-gradient(rgba(0,0,0,.1) 70%, rgba(0,0,0,0) 100%);
          
        }
        
        &:after {
          content: "";
          position: absolute;
          right: 40px;
          border-left: 5px solid rgba(255,255,255,.5);
          top: 0;
          width: 25px;
          height: 100%;
          background: #000;
        }
        
        &:before {
          content: "";
          position: absolute;
          left: 0px;
          top: 100%;
          width: 95%;
          height: 30px;
          background: linear-gradient(rgba(0,0,0,.1) 0%, rgba(0,0,0,0) 100%);
  

        }
      }
      &:nth-child(6) {
        transform: rotateX(90deg) translateZ(-150px); 
      }
    }
  }
  
  .button {
    position: absolute;
    width: 50%;
    border: 5px solid #555;
    height: 150px;
    bottom: 0;
    left: 25%;
    border-top: 10px solid #000;
    
    &:after {
      content: "";
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%,-50%);
      border-radius: 50%;
      width: 60px;
      height: 60px;
      background: #717747;
    }
  }
}

@keyframes tick {
  0% {
    transform: rotate(0deg);        
  }
 
  100% {
    transform: rotate(-360deg);    
  }
}
            
          
!
999px
Loading ..................

Console