cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - Activehtmlicon-personicon-teamoctocatpop-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.

            
              <div class="wrapper">
  <div class="container">
    <div class="icons" id="btn-start-stop">
        <span class="stop-watch">
          <span class="sw-parts">
            <span class="sw-parts2" id="icn-clock-line"></span>
          </span>
        </span>
        <span class="label" id="label-start-stop">START</span>
      </div>
    <div class="clock">
      <p><span id="hr">00</span>:<span id="min">00</span>:<span id="sec">00</span></p>
    </div>
    <ul class="clockline" id="clockline">
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
    </ul>
    <div class="btn btn-reset" id="btn-reset">
      <span class="bl-parts"></span>
      <span class="bl-parts"></span>
      <span class="btn-label">RESET</span>
    </div>
  </div><!-- /.container -->
</div><!--/.wrapper -->
            
          
!
            
              @import "compass";
$boxWidth: 50;
html,body{
  width:100%;
  height:100%;
  background: radial-gradient(50% 16%, circle, #219eb0 32%, #3f679d 88%);
}
.wrapper{
  position:relative;
  width:100%;
  height:100%;
}

.container{
  width:320px;
  height:320px;
  margin:auto;
  position:absolute;
  top:0;
  bottom:0;
  left:0;
  right:0;
  background: linear-gradient(to bottom, #0c3d69 16%, #116c97 95%);
  box-shadow:0 4px 36px 0 rgba(0,0,0,0.5);
  border-radius:8px;
  overflow:hidden;
  
}

.icons{
  position:absolute;
  width:48px;
  height:48px;
  text-align:center;
  cursor:pointer;
  top:4px;
  left:8px;
  .stop-watch{
    display:block;
    width:24px;
    height:24px;
    position:absolute;
    left:0;
    right:0;
    top:50%;
    margin:-10px auto 0;
    border: 2px solid #f8f8f8;
    border-radius:24px;
    //margin:4px auto;
    &::before{
        content:"";
        display:block;
        width:10px;
        height:2px;
        background:#f8f8f8;
        position:absolute;
        top:-6px;
        right:0;
        left:0;
        margin:0 auto;
        transform:top 0.2s;
      }
     &::after{
        content:"";
        display:block;
        width:2px;
        height:4px;
        background:#f8f8f8;
        position:absolute;
        top:-3px;
        right:-3px;

       transform:rotate(45deg);
      }
    &.sw-click::before{
      top:-3px;
    }

    .sw-parts{
      display:block;
      position:absolute;
      top:0;
      bottom:0;
      left:0;
      right:0;
      margin:auto;
      width:4px;
      height:4px;
      border-radius:4px;
      background:#F8f8f8;

      .sw-parts2{
        display:block;
        width:2px;
        height:9px;
        background:#f8f8f8;
        position:absolute;
        top:2px;
        left:1px;
        
      }
      #icn-clock-line{
        transform-origin:50% 0;
        transform:rotate(180deg);
        transition:transform 0.5s ; 
      }
    }
  }
  .label{
    color:#FFF;
    text-align:center;
    position:absolute;
    bottom:-1rem;
    left:0;
    right:0;
    margin:auto;
    font-size:0.75rem;
    font-family: 'Share Tech Mono',sans-serif;
  }
}

.clock{
  p{
    position:absolute;
    color:#FFF;
    text-align:center;
    top:144px;
    left:0;
    right:0;
    margin:0 auto;
    font-family: 'Share Tech Mono',sans-serif;
    font-size:2rem;
    font-weight:300;
  }
}
  
.clockline li{
  width:1px;
  height:20px;
  border-radius:2px;
  background:#f8f8f8;
  position:absolute;
  left: 160px;
  top: 160px;
  //Half size of a circle
  $r: 112;//224px cirlcle
  
  @for $i from 1 through 100{
    //What I want to repeat
    &:nth-child(#{$i}){
      $angle:450 + (360 / 100) * $i;
      $radian: (360 / 100) * (pi()/180) * $i;
      $x: $r * cos($radian) + px;
      $y: $r * sin($radian) + px;
      transform-origin:100% 0%;
      transform: translate($x,$y) rotate( $angle + deg) ;
      @if ($i % 5) == 0 {
        height:32px;
      }
    }
  }
}

.btn{
  cursor:pointer;
}

.btn-reset{
  //shape
  width:48px;
  height:48px;
  //border:1px solid #f8f8f8;
  //border-radius:48px;
  position:absolute;
  top:4px;
  right:8px;
  box-sizing:border-box;
  //padding:10px;
  opacity:0.5;
 
  transition:opacity 0.2s;
  
  
  .bl-parts{
    display:block;
    position:absolute;
    width:24px;
    height:24px;
    border-top:2px solid #f8f8f8;
    border-right:2px solid transparent;
    border-left:2px solid transparent;
    border-radius:50%;
    transform:rotate(45deg);
    top:10px;
    left:10px;
     transition:transform 0s;
    
    &::after{
      content:"";
      display:block;
      width:0;
      height:0;
      border-top:8px solid transparent;
      border-right:8px solid #f8f8f8;
      border-left:8px solid transparent;
      position:absolute;
      top:2px;
     // transform:rotate(-1deg);
      left:8px;
      top:-2px;
    }
  }
  .bl-parts:nth-child(2){
    transform:rotate(225deg);
    
  }
  &.br-click{
    .bl-parts{
      transform:rotate(405deg);
    }
    .bl-parts:nth-child(2){
    transform:rotate(585deg);
  }
  }
}

.btn-label{
  width:100%;
  color:#FFF;
  text-align:center;
  position:absolute;
  bottom:-1rem;
  font-size:0.75rem;
  font-family: 'Share Tech Mono',sans-serif;
}
            
          
!
            
              (function($,doc,win){
  //Variables
  var hour = $('#hr');
  var min = $('#min');
  var sec = $('#sec');
  var liNum = 75;
  var flip = false;
  var intervalCounter = 0;
  //Buttons
  var btnStartStop = $('#btn-start-stop');
  var labelStartStop = $('#label-start-stop');
  var btnReset = $('#btn-reset');
  //Elements for Animations
  var icnClockLine = $('#icn-clock-line');
  var icnClockLineDeg = 180;
  var clockLines = $('.clockline').find('li');
  var clockLines_arr = [];
    for (var i = 0; i < clockLines.length; i++) {
        clockLines_arr.push(clockLines[i]);
    }
  //Time
  var currentTime = 0;
  //States
  var stop = true;
  //Method
  var sWatchMethod ={
    timer: function(){
      var interval = 10;
      time = setInterval(function() {
                intervalCounter +=interval;
                if (!stop) {
                 
                  if((intervalCounter%1000)==0){
                    currentTime += 1000;
                    var appendHour = currentTime / (1000 * 60 * 60) | 0; 
                    var appendMinute = currentTime % (1000 * 60 * 60) / (1000 * 60) | 0;
                    var appendSecond = currentTime  % (1000 * 60) / 1000 | 0;
                  
                    appendHour = appendHour < 10 ? "0" + appendHour : appendHour;
                    appendMinute = appendMinute < 10 ? "0" + appendMinute : appendMinute;
                    appendSecond = appendSecond < 10 ? "0" + appendSecond : appendSecond;
                    hour.html(appendHour);
min.html(appendMinute);
sec.html(appendSecond);
        
                    }
                  
                  //------
                  
                    var target = $('#clockline li').eq(liNum);
          
                    if(!flip){
                    target.css('background','#339dac');
                    }else{
                      target.css('background','#fff');
                    }
                    
                    liNum += 1;
                    if(liNum>100){
                      liNum=0;
                    }
                    if(liNum ==75){
                      flip =!flip;
                    }
                }

            }, 10); 
    },
    startAndStop: function(){

      $('#btn-start-stop .stop-watch').addClass('sw-click');
      setTimeout(function(){
        $('#btn-start-stop .stop-watch').removeClass('sw-click');
      },200);
      stop = !stop;
      if(!stop){
      labelStartStop.html('STOP');
        if(!intervalCounter){
         sWatchMethod.timer();
        }
      }else{ 
     
      labelStartStop.html('START');
      //clearInterval(time);
      //clearInterval(time2);
      }
      
      
      btnReset.css('opacity',1);
      $('.btn-reset .bl-parts').css('transition','transform 0s');
      btnReset.removeClass('br-click');
      setTimeout(function(){
      $('.btn-reset .bl-parts').css('transition','transform 0.5s');
        },200);
    },
    reset: function(){
      if(!stop){
        stop = !stop;
        labelStartStop.html('START');
      }
      clearInterval(time);
      if(intervalCounter){
      currentTime = 0;
      intervalCounter = 0;
      hour.html("00");
      min.html("00");
      sec.html("00");
      liNum = 75;
      flip = false;
      for (var i = 0; i < clockLines.length; i++) {
        $('#clockline li').eq(i).css('background','#fff');
      }
      
      $(this).css('opacity',0.5);
      $(this).addClass('br-click');
      }
    },
    init: function(){
      btnStartStop.on('click',sWatchMethod.startAndStop);
      btnReset.on('click',sWatchMethod.reset); 
    }
  }
  
  $(document).ready(sWatchMethod.init);
  }(jQuery,document,window));
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console