Skip to content

Commit

Permalink
refactor(less): improve and format
Browse files Browse the repository at this point in the history
  • Loading branch information
nzbin committed Dec 2, 2021
1 parent b448be9 commit 61c9a38
Show file tree
Hide file tree
Showing 19 changed files with 112 additions and 115 deletions.
5 changes: 2 additions & 3 deletions less/_dot-bricks.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
@y2: -@spacing;

.dot-bricks {
.dot;

position: relative;
top: @top-pos;
left: @left-pos;

.dot;

box-shadow:
@x1 @y2 0 0 @dot-color,
@x1 @y1 0 0 @dot-color,
Expand Down
5 changes: 2 additions & 3 deletions less/_dot-carousel.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
@x3: -@left-pos + @dot-spacing;

.dot-carousel {
position: relative;
left: @left-pos;

.dot;

position: relative;
left: @left-pos;
box-shadow:
@x1 0 0 0 @dot-color,
@x2 0 0 0 @dot-color,
Expand Down
10 changes: 4 additions & 6 deletions less/_dot-collision.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/

.dot-collision {
position: relative;

.dot;

position: relative;

&::before,
&::after {
content: "";
Expand All @@ -18,18 +18,16 @@
}

&::before {
left: - @dot-width;

.dot(@bg-color: @dot-before-color);

left: - @dot-width;
animation: dot-collision-before 2s infinite ease-in;
}

&::after {
left: @dot-width;

.dot(@bg-color: @dot-after-color);

left: @dot-width;
animation: dot-collision-after 2s 1s infinite ease-in;
}
}
Expand Down
9 changes: 3 additions & 6 deletions less/_dot-elastic.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
*/

.dot-elastic {
position: relative;

.dot;

position: relative;
animation: dot-elastic 1s infinite linear;

&::before,
Expand All @@ -20,18 +19,16 @@
}

&::before {
left: -@dot-spacing;

.dot(@bg-color: @dot-before-color);

left: -@dot-spacing;
animation: dot-elastic-before 1s infinite linear;
}

&::after {
left: @dot-spacing;

.dot(@bg-color: @dot-after-color);

left: @dot-spacing;
animation: dot-elastic-after 1s infinite linear;
}
}
Expand Down
5 changes: 2 additions & 3 deletions less/_dot-falling.less
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
@color-after-1: rgba(@dot-after-color, 100%);

.dot-falling {
position: relative;
left: @left-pos;

.dot;

position: relative;
left: @left-pos;
box-shadow: @x2 0 0 0 @dot-color;
animation: dot-falling 1s infinite linear;
animation-delay: .1s;
Expand Down
9 changes: 4 additions & 5 deletions less/_dot-fire.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,22 @@
@y3: 1.5 * @dot-spacing;

.dot-fire {
position: relative;
left: @left-pos;

.dot;

position: relative;
left: @left-pos;
box-shadow: @x1 @y3 0 -5px @dot-color;
animation: dot-fire 1.5s infinite linear;
animation-delay: -.85s;

&::before,
&::after {
.dot;

content: "";
display: inline-block;
position: absolute;
top: 0;

.dot;
}

&::before {
Expand Down
9 changes: 3 additions & 6 deletions less/_dot-flashing.less
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
*/

.dot-flashing {
position: relative;

.dot;

position: relative;
animation: dot-flashing 1s .5s infinite linear alternate;

&::before,
Expand All @@ -20,18 +19,16 @@
}

&::before {
left: -@dot-spacing;

.dot(@bg-color: @dot-before-color);

left: -@dot-spacing;
animation: dot-flashing 1s infinite alternate;
}

&::after {
left: @dot-spacing;

.dot(@bg-color: @dot-after-color);

left: @dot-spacing;
animation: dot-flashing 1s 1s infinite alternate;
}
}
Expand Down
9 changes: 3 additions & 6 deletions less/_dot-floating.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
@d-min: 12px;

.dot-floating {
position: relative;

.dot;

position: relative;
animation: dot-floating 3s infinite cubic-bezier(.15, .6, .9, .1);

&::before,
Expand All @@ -23,18 +22,16 @@
}

&::before {
left: -@d-min;

.dot(@bg-color: @dot-before-color);

left: -@d-min;
animation: dot-floating-before 3s infinite ease-in-out;
}

&::after {
left: -@d-min*2;

.dot(@bg-color: @dot-after-color);

left: -@d-min*2;
animation: dot-floating-after 3s infinite cubic-bezier(.4, 0, 1, 1);
}
}
Expand Down
8 changes: 3 additions & 5 deletions less/_dot-gathering.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,21 @@
@d: 50px;

.dot-gathering {
position: relative;

.dot(@width: 12px, @height: 12px, @radius: 6px, @bg-color: @dot-color-hsl, @color: transparent);

position: relative;
margin: -1px 0;
filter: blur(2px);

&::before,
&::after {
.dot(@width: 12px, @height: 12px, @radius: 6px, @bg-color: @dot-color-hsl, @color: transparent);

content: '';
display: inline-block;
position: absolute;
top: 0;
left: -@d;

.dot(@width: 12px, @height: 12px, @radius: 6px, @bg-color: @dot-color-hsl, @color: transparent);

opacity: 0;
filter: blur(2px);
animation: dot-gathering 2s infinite ease-in;
Expand Down
5 changes: 2 additions & 3 deletions less/_dot-hourglass.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
@originY: @dot-height/2 + @r;

.dot-hourglass {
position: relative;
top: -@r;

.dot(@width: 12px, @height: 12px, @radius: 6px, @bg-color: @dot-color-hsl, @color: transparent);

position: relative;
top: -@r;
margin: -1px 0;
filter: blur(2px);
transform-origin: @originX @originY;
Expand Down
3 changes: 1 addition & 2 deletions less/_dot-overtaking.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
@dot-color-hsl: hsl(0, 100%, 0%);

.dot-overtaking {
position: relative;

.dot(@width: 12px, @height: 12px, @radius: 6px, @bg-color: transparent, @color: @dot-color-hsl);

position: relative;
margin: -1px 0;
filter: blur(2px);
box-shadow: 0 -20px 0 0;
Expand Down
13 changes: 5 additions & 8 deletions less/_dot-pulse.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,31 @@
@x3: -@left-pos + @dot-spacing;

.dot-pulse {
position: relative;
left: @left-pos;

.dot;

position: relative;
left: @left-pos;
box-shadow: @x2 0 0 -5px;
animation: dot-pulse 1.5s .25s infinite linear;

&::before,
&::after {
.dot;

content: "";
display: inline-block;
position: absolute;
top: 0;

.dot;
}

&::before {
box-shadow: @x1 0 0 -5px;
animation: dot-pulse-before 1.5s infinite linear;
animation-delay: 0s;
}

&::after {
box-shadow: @x3 0 0 -5px;
animation: dot-pulse-after 1.5s infinite linear;
animation-delay: .5s;
animation: dot-pulse-after 1.5s .5s infinite linear;
}
}

Expand Down
10 changes: 6 additions & 4 deletions less/_dot-revolution.less
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@

&::before,
&::after {
.dot;

content: "";
display: inline-block;
position: absolute;
top: 0;
}

&::before {
animation: dot-revolution 1.4s linear infinite;
.dot(@bg-color: @dot-before-color);

left: 0;
top: -@dot-spacing;
transform-origin: @dot-width/2 (@dot-spacing + @dot-width/2);
animation: dot-revolution 1.4s linear infinite;
}

&::after {
animation: dot-revolution 1s linear infinite;
.dot(@bg-color: @dot-after-color);

left: 0;
top: -@dot-spacing*2;
transform-origin: @dot-width/2 (@dot-spacing*2 + @dot-width/2);
animation: dot-revolution 1s linear infinite;
}
}

Expand Down
Loading

0 comments on commit 61c9a38

Please sign in to comment.