Pen Settings

HTML

CSS

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.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

Behavior

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.

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

              
                <link href="https://fonts.googleapis.com/css?family=VT323" rel="stylesheet">  
<div id="pomodoroClock">
    <h1>Pomodoro Clock</h1>
 <div id = "container">
   
 <div id = "workTimer">
  <span id = "labelWorkTimer">
    Work Timer
   </span></br>

   <span id = "workMinutes">
     25
   </span>
   
   </div>
   
   <div id = "breakTimer">
     <span id = "labelBreakTimer"> Break </span></br>
   <span id = "breakMinutes">
     5
   </span>
   </div>
   <div id = "timer">
     <div id = "time">
       <span id = "minutes">25</span>
       <span id = "colon">:</span>
       <span id = "seconds">00</span>
     </div>
   </div>
   
  <div id = "status">
    WORK
</div>
   
     <div id = "buttons">
       <span id = "workId"><button id = "work">Work</button></span>
        <span id = "workId"><button id = "workMinus">Work -</button>             </span>
        <span id = "workId"><button id = "workPlus">Work +</button>               </span>
       
        <!--<span id = "breakId"><button id = "break">Break</button></span>-->
        <span id = "breakId"><button id = "breakMinus">Break - </button>
       <span id = "breakId"><button id = "breakPlus">Break + </button>          </span>
       </span>
       <button id="pause">Pause</button>
       <button id = "resume">Resume</button>
       <button id="reset">Reset</button>
   </div>
     
   
   
  </div>
</div>
              
            
!

CSS

              
                h1{
  text-align:center;
  font-family: 'VT323', monospace;
  font-size:3em;
}
#container{
  border: 1px solid #333;
  border-radius: 20px;
  width: 800px;
  margin: 20px auto;
  padding: 20px;
  text-align: center;
  background: #333;
}

#workTimer{
  background-color:#ebebe0;
  float:left;
  color:#f00;
  font-size: 25px;
  margin: 100px auto;
  /*padding: 10px 10px 10px 10px;*/
  border: 5px solid red;
  border-radius: 50%;
  width: 110px;
  height: 110px;
  overflow: hidden;
  positon: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor:default;
}

#labelWorkTimer{
  position:relative;
  top:10px;
}

#workMinutes{
 position:relative;
  top:10px;
 
}

#breakTimer{
  float:right;
  color:#f00;
   background-color:#ebebe0;
   font-size: 25px;
  margin: 100px auto;
  /*padding: 10px 10px 10px 10px;*/
  border: 5px solid red;
  border-radius: 50%;
  width: 110px;
  height: 110px;
  overflow: hidden;
  positon: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor:default;
}
#labelBreakTimer{
  position:relative;
  top:10px;
}
#breakMinutes{
 position:relative;
  top:10px;
 
}
#timer{
  background-color:#ebebe0;
  color: #f00;
  font-size: 50px;
  margin: 10px auto;
  border: 5px solid red;
  border-radius: 50%;
  width: 200px;
  height: 200px;
  overflow: hidden;
  positon: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  cursor:default;
}

#time{
 margin-top: 70px;
 z-index: 1;
 position: relative;
}

#filler{
  background: #ddffcc;
  height: 0px;
  width: 200px;
  position:absolute;
  bottom: 0; 
}

#buttons button {
  background: #4da6ff;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 5px;
  width: 90px;
  margin: 10px auto;
  font-size: 14px;
  height: 50px;
  border-radius: 50px;
}

#breakTimer{
  color:#f00;
}

#status{
  color:#f00;
  font-size:1.5em;
}

#buttons button#work{
  background-color:#0039e6;
}

#buttons button#workPlus{
  background-color:#b380ff;
}

#buttons button#workMinus{
  background-color:#b380ff;
}

#buttons button#break{
  background-color: #0c0;
}

#buttons button#pause{
  background-color: #cc3300;
}

#buttons button#resume{
  background-color:#33ff33;
}

#buttons button#reset{
  background-color: #7300e6;
}
              
            
!

JS

              
                $(document).ready(function() {
  $('#resume').hide();/*the resume button is behind the pause button it appears when you hit pause*/
  var breakCount = 5;//initializes the breakCount to 5 minutes
  var workCount = 25;//initializes the workCount to 25 minutes
  var seconds = 60; //sixty seconds in an interval or minute
  var workCheck = true;
  var clock = '';
  var count = '25'
  var beep = new Audio('http://www.briankiddmedia.com/sounds/beep.wav');
  var breakTime = new Audio('http://www.briankiddmedia.com/sounds/break.wav');
  var breakOver = new Audio('http://www.briankiddmedia.com/sounds/breakOver.wav');
  
function timer() {//this function creates the actual count down
   // $('#time').html(display);
    if (seconds === 60) {
      if (count > 0) {
        count--;
        $('#minutes').html(count);
      }
      if (count === 0) {
        $('#minutes').html('00');
      }
    }
    seconds--;
    if (seconds < 10) {
      $('#seconds').html("0" + seconds);
    } else {
      $('#seconds').html(seconds);
    }
    if (seconds === 0 && count > 0) {/*This conditional resets the seconds */
      seconds = 60;
    }
    if (seconds === 0) {//this is where it the function transitions to break time
      if (workCheck === true) {//this is like the trigger to tell the program that now it is break time
        workCheck = false;
        breakTime.play();
        count = breakCount;
        seconds = 60;
        $('#status').html('BREAK!');
        $('#workMinus, #workPlus').attr("disabled", "disabled");
        $("breakMinus, #breakPlus").removeAttr("disabled");
      } else {
        workCheck = true;
        breakOver.play();
        count = workCount;
        seconds = 60;
         $('#status').html('WORK');
      }
    }
  }
//the following is the break display for the break timer
  
  $('#breakMinus').click(function(){
    breakCount--;
    if (breakCount < 1){
      breakCount= 1;
    }
    $('#breakMinutes').html(breakCount);
  });
    $('#breakPlus').click(function(){
    breakCount++;
    $('#breakMinutes').html(breakCount);
  });

  //the following is the work timer display adjustment
  $('#workMinus').click(function() {
    workCount--;
    count--;
    if (workCount < 1){
      workCount= 1;
       count=1;
    }
    $('#workMinutes, #minutes').html(workCount);/*This displays the new work count */
  });
  
    $('#workPlus').click(function() {
    workCount++;
    count++;
    $('#workMinutes, #minutes').html(workCount);
    
  });
  
  $('#work').click(function(){
    beep.play();  
    $('#work').css("background-color", "#ccccff");
     $('#workMinus, #workPlus').css("background-color", "#ccccff");
    $('#workMinus, #workPlus').attr("disabled", "disabled");
    clock = setInterval(timer, 1000);/*this is what makes the clock count in seconds as it counts down using the timer function*/
    $(this).attr("disabled", "disabled");/*This was necessary so you cannot press Work again when the button is active. if the user was able to click work button again it would double the interval time and the seconds would move twice as fast */
    $('#pause').show();
    $('#resume').hide(); 
 });
  
  $('#pause').click(function(){
    // $('#pause').show().html("Resume");
     $('#resume').show();
     $('#pause').hide(); 
     clearInterval(clock);
  
  });
  
  $('#resume').click(function(){
     beep.play();
    $('#work').attr("disabled", "disabled");
    $('#work').css("background-color", "#ccccff");
    clock = setInterval(timer, 1000);
    $('#pause').show();
    $('#resume').hide();
    
  });
  
  $('#reset').click(function () {
    $('#work').css("background-color", "#0039e6");
   $('#workMinus, #workPlus').css("background-color", "#b380ff");
    $('#pause').show();
    $('#resume').hide();
    $('#work').show();
    $("#work").removeAttr("disabled");
    clearInterval(clock);
    $("#workMinus, #workPlus").removeAttr("disabled");
    workCheck = true;
    breakCount = 5;
    workCount = 25;
    seconds = 60;
    count = 25;
    clock = ' ';
    $('#workMinutes').html('25');
    $('#minutes').html('25');
    $('#breakMinutes').html('5');
    $('#seconds').html('00');
    $('#status').html('WORK');
  });

});
              
            
!
999px

Console