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

              
                <div class="clock">
<div class="hours">
  <span class="hour1">1</span>
  <span class="hour2">2</span>
  <span class="hour3">3</span>
  <span class="hour4">4</span>
  <span class="hour5">5</span>
  <span class="hour6">6</span>
  <span class="hour7">7</span>
  <span class="hour8">8</span>
  <span class="hour9">9</span>
  <span class="hour10">10</span>
  <span class="hour11">11</span>
  <span class="hour12">12</span>
</div>
<div class="minutes">
  <span class="min1">5</span>
  <span class="min2">10</span>
  <span class="min3">15</span>
  <span class="min4">20</span>
  <span class="min5">25</span>
  <span class="min6">30</span>
  <span class="min7">35</span>
  <span class="min8">40</span>
  <span class="min9">45</span>
  <span class="min10">50</span>
  <span class="min11">55</span>
  <span class="min12">60</span>
</div>
<div class="seconds">
  <span class="sec1">5</span>
  <span class="sec2">10</span>
  <span class="sec3">15</span>
  <span class="sec4">20</span>
  <span class="sec5">25</span>
  <span class="sec6">30</span>
  <span class="sec7">35</span>
  <span class="sec8">40</span>
  <span class="sec9">45</span>
  <span class="sec10">50</span>
  <span class="sec11">55</span>
  <span class="sec12">60</span>
</div>
<div class="cover">
  <div class="needle"></div>
  <div class="bg"></div>
  <div class="present">PRESENT</div>
  <div class="past">PAST</div>
  <div class="future">FUTURE</div>
  <div class="center"></div>
</div>
</div>
              
            
!

CSS

              
                @import compass

body
  background: url(data:image/gif;base64,R0lGODlhFAAUAIAAAMDAwP///yH5BAEAAAEALAAAAAAUABQAAAImhI+pwe3vAJxQ0hssnnq/7jVgmJGfGaGiyoyh68GbjNGXTeEcGxQAOw==)

.clock
  margin: auto
  position: relative
  overflow: hidden
  font: 40px Monaco, MonoSpace
  font-weight: bold
  border: 3px solid #DDD
  width: 300px
  height: 300px
  -webkit-border-radius: 150px
  border-radius: 50%
  -webkit-background-clip: padding-box
  background-color: #FFF
  -webkit-box-shadow: 0px 0px 30px 10px rgba(0,0,0,.7), inset 0px 0px 10px 5px rgba(0,0,0,.7)
.clock .hours, .clock .minutes, .clock .seconds
  position: absolute
  border-radius: 150px
  -webkit-backface-visibility: hidden
.hours
  height: 300px
  width: 300px
  top: 0px
  left: 0px
  +transform-origin(center, center)
  span
    margin-left: 120px
    font-size: 40px
    line-height: 55px
    height: 150px
    position: absolute
    width: 60px
    left: 0
    top: 0
    text-align: center
    +transform-origin(bottom, center)
.minutes
  height: 200px
  width: 200px
  left: 50px
  top: 50px
  +transform-origin(center, center)
  -webkit-box-shadow: 0px 0px 10px rgba(0,0,0,.8)
  span
    margin-left: 70px
    font-size: 25px
    line-height: 35px
    height: 100px
    position: absolute
    width: 60px
    left: 0
    top: 0
    text-align: center
    +transform-origin(bottom, center)
.seconds
  height: 130px
  width: 130px
  left: 85px
  top: 85px
  +transform-origin(center, center)
  -webkit-box-shadow: 0px 0px 10px rgba(0,0,0,.8)
  span
    margin-left: 35px
    font-size: 15px
    line-height: 25px
    height: 65px
    position: absolute
    width: 60px
    left: 0
    top: 0
    text-align: center
    +transform-origin(bottom, center)
.cover
  position: absolute
  height: 300px
  width: 300px
  top: 1px
  left: 1px
  text-align: center
  overflow: hidden
  border-radius: 150px
  .bg
    position: relative
    width: 0px
    height: 0px
    border-width: 149px
    border-color: rgba(255,150,150,0.5) #BBB #BBB #BBB
    border-style: solid
    -webkit-border-radius: 150px
    border-radius: 50%
  .center
    position: absolute
    overflow: hidden
    top: 110px
    left: 110px
    width: 80px
    height: 80px
    background-color: #911
    border: 1px solid #911
    -webkit-border-radius: 40px
    border-radius: 50%
    -webkit-box-shadow: 0px 0px 7px rgba(0,0,0,.9), inset 0px 0px 25px rgba(255,150,150,.9)
  .present, .past, .future
    -webkit-backface-visibility: hidden
    -webkit-background-clip: padding-box
  .present
    position: absolute
    top: 185px
    width: 150px
    height: 20px
    color: #C33
    text-align: right
    font-size: 21px
    line-height: 21px
    +transform-origin(center, right)
    +transform(rotate(-90deg))
  .past
    position: absolute
    top: 140px
    left: 4px
    width: 105px
    height: 45px
    padding-left: 30px
    color: #888
    text-align: left
    font-size: 18px
    line-height: 25px
    border-top: 1px solid red
    -webkit-box-shadow: 1px -15px 20px -3px rgba(255,50,50,0.6)
    +transform-origin(top, right)
    +transform(rotate(45.5deg))
  .past:before
    content: ""
    display: block
    position: absolute
    top: 8px
    left: 4px
    width: 6px
    height: 6px
    -webkit-border-radius: 3px
    border-radius: 50%
    background-color: #DDD
    -webkit-box-shadow: 0px 0px 2px 1px black
  .past:after
    content: ""
    display: block
    position: absolute
    top: 7px
    right: 30px
    width: 6px
    height: 6px
    -webkit-border-radius: 3px
    border-radius: 50%
    background-color: #DDD
    -webkit-box-shadow: 0px 0px 2px 1px black
  .future
    position: absolute
    top: 135px
    left: 170px
    width: 118px
    height: 30px
    padding-right: 17px
    color: #888
    text-align: right
    font-size: 18px
    line-height: 25px
    border-top: 1px solid red
    -webkit-box-shadow: -1px -15px 20px -3px rgba(255,50,50,0.6)
    +transform-origin(center, left)
    +transform(rotate(-45deg))
  .future:after
    content: ""
    display: block
    position: absolute
    top: 8px
    right: 4px
    width: 6px
    height: 6px
    -webkit-border-radius: 3px
    border-radius: 50%
    background-color: #DDD
    -webkit-box-shadow: 0px 0px 2px 1px black
  .future:before
    content: ""
    display: block
    position: absolute
    top: 8px
    left: 32px
    width: 6px
    height: 6px
    -webkit-border-radius: 3px
    border-radius: 50%
    background-color: #DDD
    -webkit-box-shadow: 0px 0px 2px 1px black
  .needle
    position: absolute
    top: 25px
    height: 135px
    width: 5px
    margin-left: 147px
    background-color: #911
    -webkit-border-radius: 5px
    border-radius: 100% 100% 0 0
    border: 1px solid #F22
    -webkit-box-shadow: 0px 0px 10px rgba(0,0,0,0.9)

body
  padding: 50px

@for $i from 1 through 13
  .hour#{$i} 
    +transform(rotate(($i*30)+deg))
  .min#{$i} 
    +transform(rotate(($i*30)+deg))
  .sec#{$i} 
    +transform(rotate(($i*30)+deg))
              
            
!

JS

              
                $(function() {
  setInterval(function() {
    var time = new Date(),
        h = time.getHours(),
        m = time.getMinutes(),
        s = time.getSeconds(),
        ms = time.getMilliseconds();
    
    setHours(-((h+m/60)%12)*360/12);
    setMinutes(-(m+s/60)*360/60);
    setSeconds(-(s+ms/1000)*360/60);
  }, 50);
  
  function setHours(val) {
    $('.hours').css('transform','rotate(' + parseInt(val, 10) + 'deg)');
  }
  function setMinutes(val) {
    $('.minutes').css('transform','rotate(' + parseInt(val, 10) + 'deg)');
  }
  function setSeconds(val) {
    $('.seconds').css('transform','rotate(' + parseInt(val, 10) + 'deg)');
  }
});
              
            
!
999px

Console