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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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

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

              
                <div class="container">
  
  <div class="row d-flex justify-content-center">  
    <div id="titulo" class="display-3 bg-success px-5 mt-3 text-white "><h1>Reloj Pomodoro </h1></div>
    <div class="letrero bg-info text-white p-4 m-2 flex-column d-flex flex-md-row align-items-center">
      <div class="texto"><p> Tiempo programado: <span class="tiempo"></span> minutos</p></div>
      <div class="d-flex iconos flex-row flex-md-column">
<button id="mas" type="button" class="btn btn-secondary round">&uarr;</button>
      <button id="menos" type="button" class="btn btn-secondary round">&darr;</button>
      </div>
      <div class="texto"><p> Pausa programada: <span class="descanso"></span> minutos</p></div>
    <div class="d-flex iconos flex-row flex-md-column">
<button id="masd" type="button" class="btn btn-secondary round">&uarr;</button>
      <button id="menosd" type="button" class="btn btn-secondary round">&darr;</button>
      </div> 
<button type="button" class="control btn btn-secondary empezar pom">Inicio</button> 
<button id="reset" type="button" class="control  btn btn-secondary reset" disabled>Reset</button> 
<button type="button" class="control btn btn-secondary empezar des">Descanso</button>
    </div>
  </div>
  <div class="row d-flex justify-content-center">
    <div id="contador" class="d-flex justify-content-center align-items-center display-3 bg-success text-white "></div>
  </div>
  </div>
</div>
              
            
!

CSS

              
                body{
  min-height: 100vh;
  background: linear-gradient(135deg, #e1ffff 0%,#e1ffff 7%,#e1ffff 12%,#fdffff 12%,#e6f8fd 30%,#c8eefb 54%,#bee4f8 75%,#b1d8f5 100%);
}
#titulo{
  border-radius:20px;
}
.letrero{
  border-radius:7px;
  min-width:100%;
}
.round{ 
  border-radius:50%;
  margin: 1px 15px 15px 1px;
}
.control{
 min-width:100px;
}
#contador{
  border-radius: 50%;
  height: 230px;
  width:230px;
}
@media screen and (max-width: 770px) {

.control{
    width:100%;
  }
  #contador{
  border-radius:6px;
  height: 50px;
  width:100vw;
}
  .display-3{
  font-size:3rem;
  }
  .letrero{
  
  min-width:60%;
}
}
              
            
!

JS

              
                function escribesegundos(segundos){
  if (segundos<10) return "0"+segundos;
  else return segundos;
}
function beep() {
      new Audio('https://s3.amazonaws.com/freecodecamp/simonSound4.mp3').play();
setTimeout(function () {
  new Audio('https://s3.amazonaws.com/freecodecamp/simonSound1.mp3').play();
}, 300); 
}
$(document).ready(function(){
  var tiempo = 25;
  var descanso=11;
  $('.tiempo').text(tiempo);
  $('.descanso').text(descanso);
  $('#mas').click(function(){
    tiempo++;
    $('.tiempo').text(tiempo);
  })
  $('#menos').click(function(){
    if(tiempo>0)tiempo--;
    else $('.tiempo').css("color","red");
    $('.tiempo').text(tiempo);
  })
  $('#masd').click(function(){
    descanso++;
    $('.descanso').text(descanso);
  })
  $('#menosd').click(function(){
    if(descanso>0)descanso--;
    else $('.descanso').css("color","red");
    $('.descanso').text(descanso);
  })
   var $contador=$("#contador");
  $contador.text('0:00');
  
   $('.empezar').click(function(){
     if ($(this).hasClass('pom'))var minutos=tiempo;
     else var minutos=descanso;
  $('.pom').attr("disabled", true);
  $('.des').attr("disabled", true);
  $('.reset').attr("disabled", false); 
  var segundos =0;
  var ssegundos=escribesegundos(segundos);
  $contador.text(minutos+":"+ssegundos);
  
  var x = setInterval(function() {
    if (segundos>0) segundos--;
    else if(minutos>0){
      minutos--;
      segundos=59;
    }else{clearInterval(x);
          $('.des').attr("disabled", false);
    $('.pom').attr("disabled", false);
    $('.reset').attr("disabled", true);
         beep();}
    ssegundos=escribesegundos(segundos);
    
    
  $contador.text(minutos+":"+ssegundos);
    $('#reset').click(function(){
    clearInterval(x);
    $('.des').attr("disabled", false);
    $('.pom').attr("disabled", false);
    $('.reset').attr("disabled", true); 
    $contador.text("0:00");
  })
  
    }, 1000);
  })
  
})
              
            
!
999px

Console