sass-site/source/assets/css/components/_progress.scss

50 lines
1.2 KiB
SCSS
Raw Normal View History

2013-10-09 12:30:53 +02:00
$progress-block-count: 8;
$progress-block-size: $font-unit;
// without the 's' for seconds...
$progress-block-animation-duration: 1;
$progress-block-delay-interval: 1 / $progress-block-count;
.progress {
@include stretch;
2013-10-10 22:21:47 +02:00
@include square(100%);
2013-10-09 12:30:53 +02:00
}
.progress-wrap { @extend %table-layout; }
.progress-center {
@extend %table-layout-cell;
text-align: center;
}
.progress-bar {
position: relative;
display: inline-block;
width: $progress-block-count * $progress-block-size;
height: $progress-block-size;
vertical-align: middle;
}
.progress-block {
@include animation-name(progress-block);
@include animation-duration(#{$progress-block-animation-duration}s);
@include animation-iteration-count;
@include animation-direction;
2013-10-10 22:21:47 +02:00
@include square($progress-block-size);
2013-10-09 12:30:53 +02:00
position: absolute;
top: 0;
background: $color-primary;
}
@for $i from 1 through $progress-block-count {
.progress-block:nth-child(#{$i}) {
@include animation-delay(#{$progress-block-delay-interval * ($i - 1) * $progress-block-animation-duration}s);
left: $progress-block-size * ($i - 1);
}
}
@include keyframes(progress-block, background-color, $color-primary, transparent);