46193ab5fe
The primary license of the project is changing to: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later with some specific files to be licensed under the one of two licenses: CC0-1.0 LGPL-3.0-or-later This commit is one of the many steps to relicense the entire codebase. Documentation granting permission for this relicensing (from all past contributors who hold copyrights) is on file with Software Freedom Conservancy, Inc.
44 lines
1.1 KiB
SCSS
44 lines
1.1 KiB
SCSS
/* License: AGPL-3.0-or-later WITH Web-Template-Output-Additional-Permission-3.0-or-later */
|
|
@mixin animation($animate...) {
|
|
$max: length($animate);
|
|
$animations: '';
|
|
|
|
@for $i from 1 through $max {
|
|
$animations: #{$animations + nth($animate, $i)};
|
|
|
|
@if $i < $max {
|
|
$animations: #{$animations + ", "};
|
|
}
|
|
}
|
|
-webkit-animation: $animations;
|
|
-moz-animation: $animations;
|
|
-o-animation: $animations;
|
|
animation: $animations;
|
|
}
|
|
|
|
@mixin keyframes($animationName) {
|
|
@-webkit-keyframes #{$animationName} {
|
|
@content;
|
|
}
|
|
@-moz-keyframes #{$animationName} {
|
|
@content;
|
|
}
|
|
@-o-keyframes #{$animationName} {
|
|
@content;
|
|
}
|
|
@keyframes #{$animationName} {
|
|
@content;
|
|
}
|
|
}
|
|
|
|
// Using the mixins looks like this:
|
|
// @include keyframes(move-the-object) {
|
|
// 0% { left: 100px; }
|
|
// 100% { left: 200px; }
|
|
// }
|
|
|
|
// .object-to-animate {
|
|
// @include animation('move-the-object .5s 1', 'move-the-object-again .5s 1 .5s');
|
|
// }
|
|
|
|
// credit: http://joshbroton.com/quick-fix-sass-mixins-for-css-keyframe-animations/
|