Skip to content

Commit 555a735

Browse files
author
Adam Argyle
committed
add multipart diamond effect
1 parent b6f73c8 commit 555a735

4 files changed

Lines changed: 36 additions & 1 deletion

File tree

src/polygons/_includes.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
@import "opposing-corners-in.css";
22
@import "opposing-corners-out.css";
33
@import "diamond-in-center.css";
4-
@import "diamond-out-center.css";
4+
@import "diamond-out-center.css";
5+
@import "diamond-in-height-width.css";
6+
@import "diamond-out-height-width.css";

src/polygons/_vars.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
:root {
22
--diamond-center-in: polygon(-50% 50%, 50% -50%, 150% 50%, 50% 150%);
33
--diamond-center-out: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%);
4+
--diamond-height-stretched: polygon(45% 50%, 50% 25%, 55% 50%, 50% 75%);
45

56
--opposing-corners-in: polygon(0 0, 0 100%, 100% 100%, 100% 0);
67
--opposing-corners-out: polygon(0 0, 50% 50%, 100% 100%, 50% 50%);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@keyframes diamond-in-double-scale {
2+
0% {
3+
clip-path: var(--diamond-center-out);
4+
}
5+
40% {
6+
clip-path: var(--diamond-height-stretched);
7+
}
8+
100% {
9+
clip-path: var(--diamond-center-in);
10+
}
11+
}
12+
13+
[transition="in:diamond:height-width"] {
14+
--transition__duration: 1.5s;
15+
animation-name: diamond-in-double-scale;
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
@keyframes diamond-out-double-scale {
2+
0% {
3+
clip-path: var(--diamond-center-in);
4+
}
5+
40% {
6+
clip-path: var(--diamond-height-stretched);
7+
}
8+
100% {
9+
clip-path: var(--diamond-center-out);
10+
}
11+
}
12+
13+
[transition="out:diamond:height-width"] {
14+
--transition__duration: 1.5s;
15+
animation-name: diamond-out-double-scale;
16+
}

0 commit comments

Comments
 (0)