Skip to content

Commit 4d22e85

Browse files
author
Adam Argyle
committed
polygons use vars to prepare for hackpacks
1 parent 2077c9f commit 4d22e85

6 files changed

Lines changed: 17 additions & 9 deletions

File tree

src/_vars.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
@import "circles/_vars.css";
22
@import "wipes/_vars.css";
3-
@import "squares/_vars.css";
3+
@import "squares/_vars.css";
4+
@import "polygons/_vars.css";

src/polygons/_vars.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:root {
2+
--diamond-center-in: polygon(-50% 50%, 50% -50%, 150% 50%, 50% 150%);
3+
--diamond-center-out: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
4+
5+
--opposing-corners-in: polygon(0 0, 0 100%, 100% 100%, 100% 0);
6+
--opposing-corners-out: polygon(0 0, 50% 50%, 100% 100%, 50% 50%);
7+
}

src/polygons/diamond-in-center.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@keyframes diamond-in-center {
22
from {
3-
clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
3+
clip-path: var(--diamond-center-out);
44
}
55
to {
6-
clip-path: polygon(-50% 50%, 50% -50%, 150% 50%, 50% 150%);
6+
clip-path: var(--diamond-center-in);
77
}
88
}
99

src/polygons/diamond-out-center.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@keyframes diamond-out-center {
22
from {
3-
clip-path: polygon(-50% 50%, 50% -50%, 150% 50%, 50% 150%);
3+
clip-path: var(--diamond-center-in);
44
}
55
to {
6-
clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
6+
clip-path: var(--diamond-center-out);
77
}
88
}
99

src/polygons/opposing-corners-in.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@keyframes polygon-in-opposing-corners {
22
from {
3-
clip-path: polygon(0 0, 50% 50%, 100% 100%, 50% 50%);
3+
clip-path: var(--opposing-corners-out);
44
}
55
to {
6-
clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 0);
6+
clip-path: var(--opposing-corners-in);
77
}
88
}
99

src/polygons/opposing-corners-out.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
@keyframes polygon-out-opposing-corners {
22
from {
3-
clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 0);
3+
clip-path: var(--opposing-corners-in);
44
}
55
to {
6-
clip-path: polygon(0 0, 50% 50%, 100% 100%, 50% 50%);
6+
clip-path: var(--opposing-corners-out);
77
}
88
}
99

0 commit comments

Comments
 (0)