Skip to content

Instantly share code, notes, and snippets.

@erotte
Created May 26, 2014 22:08
Show Gist options
  • Save erotte/4a1ac5785bec7b056b98 to your computer and use it in GitHub Desktop.
Save erotte/4a1ac5785bec7b056b98 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
.progress
.inner-progress
// ----
// Sass (v3.3.5)
// Compass (v)
// ----
@import "compass"
$spotcolor: #4a98ed
=keyframes($name)
@-webkit-keyframes #{$name}
@content
@-moz-keyframes #{$name}
@content
@keyframes #{$name}
@content
=animation($name, $duration)
-webkit-animation-name: #{$name}
-webkit-animation-duration: #{$duration}
-moz-animation-name: #{$name}
-moz-animation-duration: #{$duration}
animation-name: #{$name}
animation-duration: #{$duration}
animation-fill-mode: forwards
-webkit-animation-fill-mode: forwards
+keyframes(progress)
0%
width: 0
10%
width: 30%
40%
width: 55%
80%
width: 65%
+keyframes(progress-finished)
0%
left: 30%
90%
left: 110%
100%
left: 0
background: $spotcolor
.progress
height: 10px
border: 1px solid #cecece
.inner-progress
background-color: $spotcolor
height: 10px
+animation(progress, 8s)
&.finished
position: relative
left: 100%
border: 1px solid red
+background-image(linear-gradient(left, #fff, $spotcolor))
+animation(progress-finished, 2s)
@-webkit-keyframes progress {
0% {
width: 0;
}
10% {
width: 30%;
}
40% {
width: 55%;
}
80% {
width: 65%;
}
}
@-moz-keyframes progress {
0% {
width: 0;
}
10% {
width: 30%;
}
40% {
width: 55%;
}
80% {
width: 65%;
}
}
@keyframes progress {
0% {
width: 0;
}
10% {
width: 30%;
}
40% {
width: 55%;
}
80% {
width: 65%;
}
}
@-webkit-keyframes progress-finished {
0% {
left: 30%;
}
90% {
left: 110%;
}
100% {
left: 0;
background: #4a98ed;
}
}
@-moz-keyframes progress-finished {
0% {
left: 30%;
}
90% {
left: 110%;
}
100% {
left: 0;
background: #4a98ed;
}
}
@keyframes progress-finished {
0% {
left: 30%;
}
90% {
left: 110%;
}
100% {
left: 0;
background: #4a98ed;
}
}
.progress {
height: 10px;
border: 1px solid #cecece;
}
.inner-progress {
background-color: #4a98ed;
height: 10px;
-webkit-animation-name: progress;
-webkit-animation-duration: 8s;
-moz-animation-name: progress;
-moz-animation-duration: 8s;
animation-name: progress;
animation-duration: 8s;
animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
}
.inner-progress.finished {
position: relative;
left: 100%;
border: 1px solid red;
background-image: -moz-linear-gradient(left, #ffffff, #4a98ed);
background-image: -webkit-linear-gradient(left, #ffffff, #4a98ed);
background-image: linear-gradient(to right, #ffffff, #4a98ed);
-webkit-animation-name: progress-finished;
-webkit-animation-duration: 2s;
-moz-animation-name: progress-finished;
-moz-animation-duration: 2s;
animation-name: progress-finished;
animation-duration: 2s;
animation-fill-mode: forwards;
-webkit-animation-fill-mode: forwards;
}
<div class="progress">
<div class="inner-progress"></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment