Skip to content

Commit

Permalink
polygons use vars to prepare for hackpacks
Browse files Browse the repository at this point in the history
  • Loading branch information
argyleink committed Jul 31, 2020
1 parent 2077c9f commit 4d22e85
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/_vars.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import "circles/_vars.css";
@import "wipes/_vars.css";
@import "squares/_vars.css";
@import "squares/_vars.css";
@import "polygons/_vars.css";
7 changes: 7 additions & 0 deletions src/polygons/_vars.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:root {
--diamond-center-in: polygon(-50% 50%, 50% -50%, 150% 50%, 50% 150%);
--diamond-center-out: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);

--opposing-corners-in: polygon(0 0, 0 100%, 100% 100%, 100% 0);
--opposing-corners-out: polygon(0 0, 50% 50%, 100% 100%, 50% 50%);
}
4 changes: 2 additions & 2 deletions src/polygons/diamond-in-center.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@keyframes diamond-in-center {
from {
clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
clip-path: var(--diamond-center-out);
}
to {
clip-path: polygon(-50% 50%, 50% -50%, 150% 50%, 50% 150%);
clip-path: var(--diamond-center-in);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/polygons/diamond-out-center.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@keyframes diamond-out-center {
from {
clip-path: polygon(-50% 50%, 50% -50%, 150% 50%, 50% 150%);
clip-path: var(--diamond-center-in);
}
to {
clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
clip-path: var(--diamond-center-out);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/polygons/opposing-corners-in.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@keyframes polygon-in-opposing-corners {
from {
clip-path: polygon(0 0, 50% 50%, 100% 100%, 50% 50%);
clip-path: var(--opposing-corners-out);
}
to {
clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 0);
clip-path: var(--opposing-corners-in);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/polygons/opposing-corners-out.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@keyframes polygon-out-opposing-corners {
from {
clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 0);
clip-path: var(--opposing-corners-in);
}
to {
clip-path: polygon(0 0, 50% 50%, 100% 100%, 50% 50%);
clip-path: var(--opposing-corners-out);
}
}

Expand Down

0 comments on commit 4d22e85

Please sign in to comment.