Skip to content

Commit e899e80

Browse files
feat: add missing 3d animations into perspective category
1 parent 01e6de9 commit e899e80

File tree

6 files changed

+75
-1
lines changed

6 files changed

+75
-1
lines changed

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
</head>
1717
<body>
1818
<div class="a-perspective" style="margin: 10rem; width: 213px">
19-
<div style="width: 213px" class="a-rotate-flip">
19+
<!-- For 3d we need a div on top of the target element -->
20+
<!-- please remember to document that -->
21+
<div style="width: 213px" class="a-three-flip-up">
2022
<img src="./all-animation.png" id="element" />
2123
</div>
2224
</div>

scss/modules/modules.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
// Perspective
1616
@import './perspective/perspective.scss';
17+
@import './three-flip-down/three-flip-down.scss';
18+
@import './three-flip-up/three-flip-up.scss';
19+
@import './three-flip-right/three-flip-right.scss';
20+
@import './three-flip-left/three-flip-left.scss';
1721
@import './flip-left-bounce/flip-left-bounce.scss';
1822
@import './flip-right-bounce/flip-right-bounce.scss';
1923
@import './rotate-flip/rotate-flip.scss';
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.a-three-flip-down {
2+
@include keyframes(threeFlipDown) {
3+
0% {
4+
transform: rotateX(0);
5+
}
6+
7+
100% {
8+
transform: rotateX(-90deg);
9+
}
10+
}
11+
12+
transform: rotateX(90deg);
13+
transform-origin: 0 100%;
14+
15+
@include show();
16+
@include animate(threeFlipDown $perspective-bounce-timing ease-in-out 1);
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.a-three-flip-up {
2+
@include keyframes(threeFlipUp) {
3+
0% {
4+
transform: rotateX(0);
5+
}
6+
7+
100% {
8+
transform: rotateX(90deg);
9+
}
10+
}
11+
12+
transform: rotateX(90deg);
13+
transform-origin: 100% 0;
14+
15+
@include show();
16+
@include animate(threeFlipUp $perspective-bounce-timing ease-in-out 1);
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.a-three-flip-right {
2+
@include keyframes(threeFlipRight) {
3+
0% {
4+
transform: rotateY(0);
5+
}
6+
7+
100% {
8+
transform: rotateY(90deg);
9+
}
10+
}
11+
12+
transform: rotateY(90deg);
13+
transform-origin: 100% 0;
14+
15+
@include show();
16+
@include animate(threeFlipRight $perspective-bounce-timing ease-in-out 1);
17+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.a-three-flip-left {
2+
@include keyframes(threeFlipLeft) {
3+
0% {
4+
transform: rotateY(0);
5+
}
6+
7+
100% {
8+
transform: rotateY(-90deg);
9+
}
10+
}
11+
12+
transform: rotateY(-90deg);
13+
transform-origin: 0 0;
14+
15+
@include show();
16+
@include animate(threeFlipLeft $perspective-bounce-timing ease-in-out 1);
17+
}

0 commit comments

Comments
 (0)