Skip to content

Commit

Permalink
refactor(scss): replace divide with multiply (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
nzbin committed Nov 20, 2021
1 parent 6af5ab8 commit d43d42b
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion sass/_dot-bricks.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

$spacing: $dot-width + 6px;
$top-pos: $spacing/2;
$top-pos: $spacing * .5;
$left-pos: -9999px;
$x1: -$left-pos - $top-pos;
$x2: -$left-pos - $top-pos + $spacing;
Expand Down
2 changes: 1 addition & 1 deletion sass/_dot-fire.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
$left-pos: -9999px;
$x1: -$left-pos;
$y1: -1.5 * $dot-spacing;
$y2: -1.5 * $dot-spacing/4;
$y2: -1.5 * $dot-spacing * .25;
$y3: 1.5 * $dot-spacing;

.dot-fire {
Expand Down
6 changes: 3 additions & 3 deletions sass/_dot-floating.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ $d-min: 12px;

@keyframes dot-floating {
0% {
left: calc(-50% - #{$dot-width/2});
left: calc(-50% - #{$dot-width * .5});
}

75% {
left: calc(50% + #{$d-max * 2 + $dot-width/2});
left: calc(50% + #{$d-max * 2 + $dot-width * .5});
}

100% {
left: calc(50% + #{$d-max * 2 + $dot-width/2});
left: calc(50% + #{$d-max * 2 + $dot-width * .5});
}
}

Expand Down
4 changes: 2 additions & 2 deletions sass/_dot-hourglass.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
$dot-color-hsl: hsl(0, 100%, 0%);

$r: $dot-spacing;
$origin-x: $dot-width/2;
$origin-y: $dot-height/2 + $r;
$origin-x: $dot-width * .5;
$origin-y: $dot-height * .5 + $r;

.dot-hourglass {
position: relative;
Expand Down
4 changes: 2 additions & 2 deletions sass/_dot-revolution.scss
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

@include dot($bg-color: $dot-before-color);

transform-origin: $dot-width/2 ($dot-spacing + $dot-width/2);
transform-origin: ($dot-width * .5) ($dot-spacing + $dot-width * .5);
animation: dot-revolution 1.4s linear infinite;
}

Expand All @@ -32,7 +32,7 @@

@include dot($bg-color: $dot-after-color);

transform-origin: $dot-width/2 ($dot-spacing * 2 + $dot-width/2);
transform-origin: ($dot-width * .5) ($dot-spacing * 2 + $dot-width * .5);
animation: dot-revolution 1s linear infinite;
}
}
Expand Down
4 changes: 2 additions & 2 deletions sass/_dot-spin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ $y1: $dot-spacing * 1.2;
$-x1: -$x1;
$-y1: -$y1;

$x2: $x1/1.414;
$y2: $y1/1.414;
$x2: $x1 * .707107; // 1/√2
$y2: $y1 * .707107; // 1/√2
$-x2: -$x2;
$-y2: -$y2;

Expand Down
8 changes: 4 additions & 4 deletions sass/_dot-windmill.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ $origin-y: 5px + $r;
}

&::before {
left: -($r/2 * 1.732);
top: $r + $r/2;
left: -($r * .5 * 1.732508); // √3
top: $r + $r * .5;

@include dot($bg-color: $dot-before-color);
}

&::after {
left: $r/2 * 1.732;
top: $r + $r/2;
left: $r * .5 * 1.732508; // √3
top: $r + $r * .5;

@include dot($bg-color: $dot-after-color);
}
Expand Down
4 changes: 2 additions & 2 deletions sass/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

$dot-width: 10px !default;
$dot-height: 10px !default;
$dot-radius: $dot-width/2 !default;
$dot-radius: $dot-width * .5 !default;

$dot-color: #9880ff !default;
$dot-bg-color: $dot-color !default;
$dot-before-color: $dot-color !default;
$dot-after-color: $dot-color !default;

$dot-spacing: $dot-width + $dot-width/2 !default;
$dot-spacing: $dot-width + $dot-width * .5 !default;

0 comments on commit d43d42b

Please sign in to comment.