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

52 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;
width: 100%;
height: 100%;
}
.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;
position: absolute;
top: 0;
width: $progress-block-size;
height: $progress-block-size;
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);