<div class="container">
  <label for="button1">Pause download</label>
  <input type="checkbox" name="" id="button1" >
  <div class="loading">
    <div class="loading-bar"></div> 
  </div>
</div>
<div class="container">
  <label for="button2">Pause download</label>
  <input type="checkbox" name="" id="button2" >
  <div class="loading green-border">
    <div class="loading-mask">
      <div class="loading-bar green-bar"></div>
    </div>
  </div>
</div>
*,
*:before,
*:after{
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

html,
body{
  min-height: 100%;
}

body{
  background-image: -webkit-radial-gradient(top, mintcream 0%, lightgray 100%);
  background-image: -moz-radial-gradient(top, mintcream 0%, lightgray 100%);
  background-image: -o-radial-gradient(top, mintcream 0%, lightgray 100%);
  background-image: radial-gradient(top, mintcream 0%, lightgray 100%);
}

.container{
  width: 300px;
  height: auto;
  margin: 50px auto 20px;
}

.loading{
  width: 100%;
  height: 10px;
  border: solid 2px blue;
  overflow: hidden;
  position: relative;
}

.loading-bar{
  right: 0;
  position: absolute;
  width: 600px;
  height: 100%;
  background: blue;
  background-image: -webkit-linear-gradient(45deg, white 0%, white 30%, blue 30%, blue 70%, white 70%);
  background-image: -webkit-moz-gradient(45deg, white 0%, white 30%, blue 30%, blue 70%, white 70%);
  background-image: -webkit-o-gradient(45deg, white 0%, white 30%, blue 30%, blue 70%, white 70%);
  background-image: linear-gradient(45deg, white 0%, white 30%, blue 30%, blue 70%, white 70%);
  background-size: 25px 10px;

  animation: slide 3s linear infinite;
}

.green-bar{
  background-image: -webkit-linear-gradient(45deg, white 0%, white 30%, #00B000 30%, #00B000 70%, white 70%);
}

.green-border{
  border-color: #00B000;
}

.loading-mask{
  width: 0%;
  height: 100%;
  overflow: hidden;
  position: relative;

  animation: move 10s ease-out infinite;
}

input[type="checkbox"]{
  display: none;
}

#button1:checked + .loading > .loading-bar{
  animation-play-state: paused;
}

#button2:checked + .loading > .loading-mask{
  animation-play-state: paused;
}

label{
  cursor: pointer;
  font: normal 9px arial;
  color: #272822;
  margin-bottom: 3px;
  position: relative;
  left: 310px;
  top: 13px;
}

label:hover{
  text-decoration: underline;
}

@keyframes slide{
  from{right: 0;}
  to{right: -300px;}
}

@keyframes move{
  from{width: 0%;}
  to{width: 100%;}
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.