Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace / as division operation with the new math.div function in sass issue #102 #104

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/animations/ball-scale-multiple.scss
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
@import '../variables';
@import '../mixins';
@import '../functions';
@use "sass:math";
@import "../variables";
@import "../mixins";
@import "../functions";

$size: 60px;

@keyframes ball-scale-multiple {
0% {
transform: scale(0.0);
transform: scale(0);
opacity: 0;
}
5% {
opacity: 1;
}
100% {
transform: scale(1.0);
transform: scale(1);
opacity: 0;
}
}

@mixin ball-scale-multiple ($n: 3, $start: 2) {
@mixin ball-scale-multiple($n: 3, $start: 2) {
@for $i from $start through $n {
> div:nth-child(#{$i}) {
animation-delay: delay(0.2s, $n, $i - 1);
Expand All @@ -30,7 +31,7 @@ $size: 60px;
@include ball-scale-multiple();

position: relative;
transform: translateY(-$size / 2);
transform: translateY(math.div(-$size, 2));

> div {
@include balls();
Expand Down
73 changes: 37 additions & 36 deletions src/animations/pacman.scss
Original file line number Diff line number Diff line change
@@ -1,56 +1,57 @@
@import '../variables';
@import '../mixins';
@import '../functions';
@use "sass:math";
@import "../variables";
@import "../mixins";
@import "../functions";

$size: 25px;

@keyframes rotate_pacman_half_up {
0% {
transform:rotate(270deg);
}
50% {
transform:rotate(360deg);
}
100% {
transform:rotate(270deg);
}
@keyframes rotate_pacman_half_up {
0% {
transform: rotate(270deg);
}
50% {
transform: rotate(360deg);
}
100% {
transform: rotate(270deg);
}
}

@keyframes rotate_pacman_half_down {
0% {
transform:rotate(90deg);
}
50% {
transform:rotate(0deg);
}
100% {
transform:rotate(90deg);
}
@keyframes rotate_pacman_half_down {
0% {
transform: rotate(90deg);
}
50% {
transform: rotate(0deg);
}
100% {
transform: rotate(90deg);
}
}

@mixin pacman_design(){
width: 0px;
height: 0px;
border-right: $size solid transparent;
border-top: $size solid $primary-color;
border-left: $size solid $primary-color;
border-bottom: $size solid $primary-color;
border-radius: $size;
@mixin pacman_design() {
width: 0px;
height: 0px;
border-right: $size solid transparent;
border-top: $size solid $primary-color;
border-left: $size solid $primary-color;
border-bottom: $size solid $primary-color;
border-radius: $size;
}

@keyframes pacman-balls {
75% {
opacity: 0.7;
}
100% {
transform: translate(-4 * $size, -$size / 4);
transform: translate(-4 * $size, math.div(-$size, 4));
}
}

@mixin ball-placement($n:3, $start:0) {
@mixin ball-placement($n: 3, $start: 0) {
@for $i from $start through $n {
> div:nth-child(#{$i + 2}) {
animation: pacman-balls 1s delay(.33s, $n, $i) infinite linear;
animation: pacman-balls 1s delay(0.33s, $n, $i) infinite linear;
}
}
}
Expand Down Expand Up @@ -85,8 +86,8 @@ $size: 25px;
height: 10px;

position: absolute;
transform: translate(0, -$size / 4);
transform: translate(0, math.div(-$size, 4));
top: 25px;
left: 70px;
}
}
}