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.

Quick-add: + add another resource

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.

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.

            
              <audio id="beeper" src="https://actions.google.com/sounds/v1/alarms/beep_short.ogg" tipe="audio/ogg" target="_blank"></audio> 
<!--Header-->
<nav class="navbar fixed-top bg-success">
  <div class="container">
    <div class="navbar-brand">
    <h2>Pom<img src="https://drive.google.com/uc?export=view&id=0B8w05S5PR6VMWVJxLTVwaklWQVU" target="_blank">doro Cl<i class="fa fa-clock-o" aria-hidden="true"></i>ck</h2>
    </div>
   </div>
</nav>
<!--Page container-->
<div class="container-fluid">
  <div class="row justify-content-center">
    <div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-xl-4">
      <div class="jumbotron-fluid mt-90 text-center">
        <div class="row">
          <!--Break length title and buttons-->
          <div class="col-6">
            <p class="mb-1">break length</p> 
            <button class="btn-xs btn-danger" type="button" id="minusBL"><i class="fa fa-minus" aria-hidden="true"></i></button>
              <a class="length-num" id="breakNum">5</a>
              <button class="btn-xs btn-success" type="button" id="plusBL"><i class="fa fa-plus" aria-hidden="true"></i></button>
            </div>
          <!--Session length title and buttons-->
          <div class="col-6">
            <p class="mb-1">session length</p>
              <button class="btn-xs btn-danger" type="button" id="minusSL"><i class="fa fa-minus" aria-hidden="true"></i></button>
               <a class="length-num" id="sessionNum">25</a>
              <button class="btn-xs btn-success" type="button" id="plusSL"><i class="fa fa-plus" aria-hidden="true"></i></button>
            </div>
      </div>
           <!--Timer title and buttons-->
             <h2 class="mb-1 mt-2" id="timeType">timer</h2> 
              <button class="btn-xs btn-danger" type="button" id="pause"><i class="fa fa-pause" aria-hidden="true"></i></button>
              <a id="timer">25:00</a>
              <button class="btn-xs btn-success" type="button" id="start"><i class="fa fa-play" aria-hidden="true"></i></button>
              <button class="btn-xs btn-success" type="button" id="reset"><i class="fa fa-undo" aria-hidden="true"></i></button>
          <!--Clock image-->
          <div class="my-2 text-center"><img src="https://drive.google.com/uc?export=view&id=0B8w05S5PR6VMTlZ2dDJHano3Tk0" id="clock" target="_blank"></img>
         </div>
      </div>
    </div>
  </div>
</div>
<!--Footer-->
<footer class="footer bg-danger">
  <div class="container text-center">
  </div>
</footer> 

            
          
!
            
              html {
  position: relative;
  min-height: 100%;
}
body {
	font-family: Lato, Sans-serif;
  margin-bottom: 60px;
}
.mt-90 {
  margin: 90px 10px 0px 10px;
}
.length-num{
  font-size: 20px;
  vertical-align: middle;
 }
#timer{
  font-size: 25px;
  vertical-align: middle;
 }
#clock {
  width: 230px;
  height: 230px;
}
/*Sticky Footer*/
.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding-top: 15px;
	height: 60px;
}

            
          
!
            
              $(document).ready(function(){
  var beeper = $('#beeper')[0];
  var breakCount = parseInt($('#breakNum').html());
  var sessionCount = parseInt($('#sessionNum').html());
  var startSession;
  var startBreak;
  $('#reset').hide();
 //Set session interval on click start.   
  $('#start').click(function(){
    startSession = setInterval(sessionTimer, 1000);
    $('#minusBL').attr('disabled',true);
    $('#minusSL').attr('disabled',true);
    if (breakCount !== 0) {
      $('#start').hide();
      $('#reset').show();
      }
    //Prevents double count when a pause and again a start clicked.
    if (sessionCount < 60 && breakCount < 60){
      sessionCount *= 60;
      breakCount *= 60;
       }
    else{
      sessionCount;
      breakCount;
    }
    //Session timer settings
    function sessionTimer(){
      $('#timeType').html('session time');
    //Prevents countdowning when break count is 0.  
      if (breakCount !== 0) {
        sessionCount--;
      }
      //When session done,starts break.  
     if(sessionCount === 0){
        $('#clock').effect('shake', {distance:10, direction:'up'}, 1000)
        beeper.play();
        clearInterval(startSession);
        startBreak = setInterval(breakTimer, 1000);
      }
      //Rounds digits and adds 0 in front of one-digit numbers
      if(sessionCount%60>=10){
         $('#timer').html(Math.floor(sessionCount/60)+':'+sessionCount%60)
         }
         else {
            $('#timer').html(Math.floor(sessionCount/60)+':'+'0'+sessionCount%60)
         }
    // Break timer settings  
   function breakTimer(){
      $('#timeType').html('break time'); 
        breakCount--;
   //When break done, events are happening.
      if(breakCount === 0){
        $('#clock').effect('shake', {distance:10, direction:"up"}, 1000)
        beeper.play();
        clearInterval(startBreak);
        $('#start').show();
        $('#minusBL').removeAttr('disabled');
        $('#minusSL').removeAttr('disabled');
        $('#timeType').html('timer');
        $('#timer').html('');
       } 
      //Rounds digits and adds 0 in front of one-digit numbers
      if(breakCount % 60 >= 10){
         $('#timer').html(Math.floor(breakCount/60)+':'+breakCount%60)
         }
         else {
           $('#timer').html(Math.floor(breakCount/60)+':'+'0'+breakCount%60)
         }  
      } 
   }
 })
//Pause button functionality
 $('#pause').click(function(){
   clearInterval(startSession);
   clearInterval(startBreak);
   $('#start').show();
   $('#reset').hide();
  })
 //Reset button functionality 
  $('#reset').click(function(){
    $('#start').show();
    $('#reset').hide();
    clearInterval(startSession);
    clearInterval(startBreak);
    $('#minusBL').removeAttr('disabled');
    $('#minusSL').removeAttr('disabled');
    $('#timer').html('00:00');
    breakCount = 1;
    sessionCount = 1;
    $('#breakNum').html(breakCount);
    $('#sessionNum').html(sessionCount);
  })
 //Minus break lenght button functionality
  $('#minusBL').click(function(){
    if(breakCount>1 && breakCount < 60){
     breakCount--;
     $('#breakNum').html(breakCount);
     }
    else{
     breakCount = 1; 
    } 
  })
   //Minus break lenght button functionality
  $('#plusBL').click(function(){
    if(breakCount<60){
    breakCount++;
    $('#breakNum').html(breakCount);
    }
  })
   //Minus session lenght button functionality
  $('#minusSL').click(function(){
    if(sessionCount>1 && sessionCount<60){
    sessionCount--;
    $('#sessionNum').html(sessionCount);
    }
    else{
     sessionCount = 1; 
    } 
  })
   //Plus session lenght button functionality
  $('#plusSL').click(function(){
    if(sessionCount<60){
    sessionCount++;
    $('#sessionNum').html(sessionCount);
    }
  })
})


                        
                      

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

Console