Skip to content

Commit 5c8b32d

Browse files
committed
Added Jelly Animation
1 parent 65eab90 commit 5c8b32d

File tree

4 files changed

+87
-1
lines changed

4 files changed

+87
-1
lines changed

neptune-animations.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010
/* Scaling Animations */
1111
@import url('./src/css/neptune_scale.css');
1212

13+
/* 3D Animations */
14+
@import url('./src/css/neptune_3d.css');
15+
16+
/* Other Animations */
17+
@import url('./src/css/neptune_other.css');
1318

1419
:root {
1520
--nep-animation-duration: 1s;

src/css/neptune_3d.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* 3D Animations */
2+
/* Flip X */
3+
.nep-flip-x {
4+
animation: nep-flip-x var(--nep-animation-duration) var(--nep-animation-delay) var(--nep-animation-direction) var(--nep-animation-fillmode);
5+
}
6+
7+
@keyframes nep-flip-x {
8+
50% { transform: rotateX(180deg);}
9+
100% { transform: rotateX(180deg);}
10+
}
11+
12+
/* Flip Y */
13+
.nep-flip-y {
14+
animation: nep-flip-y var(--nep-animation-duration) var(--nep-animation-delay) var(--nep-animation-direction) var(--nep-animation-fillmode);
15+
}
16+
17+
@keyframes nep-flip-y {
18+
50% { transform: rotateY(180deg);}
19+
100% { transform: rotateY(180deg);}
20+
}

src/css/neptune_other.css

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
/* Some Other Animations */
2+
/* Pulse */
3+
.nep-pulse {
4+
animation: nep-pulse var(--nep-animation-duration) var(--nep-animation-delay) var(--nep-animation-direction) var(--nep-animation-fillmode);
5+
}
6+
7+
@keyframes nep-pulse {
8+
35% { transform: scale(1.2);}
9+
50% { transform: scale(1);}
10+
85% { transform: scale(1.2);}
11+
100% { transform: scale(1);}
12+
}
13+
14+
/* Shake X */
15+
.nep-shake-x {
16+
animation: nep-shake-x var(--nep-animation-duration) var(--nep-animation-delay) var(--nep-animation-direction) var(--nep-animation-fillmode);
17+
}
18+
19+
@keyframes nep-shake-x {
20+
12.5% { transform: translateX(1rem);}
21+
/* 25% { transform: translateX(0);} */
22+
37.5% { transform: translateX(-1rem);}
23+
/* 50% { transform: translateX(0);} */
24+
62.5% { transform: translateX(1rem);}
25+
/* 75% { transform: translateX(0);} */
26+
87.5% { transform: translateX(-1rem);}
27+
100% { transform: translateX(0);}
28+
}
29+
30+
/* Shake Y */
31+
.nep-shake-y {
32+
animation: nep-shake-y var(--nep-animation-duration) var(--nep-animation-delay) var(--nep-animation-direction) var(--nep-animation-fillmode);
33+
}
34+
35+
@keyframes nep-shake-y {
36+
12.5% { transform: translateY(1rem);}
37+
/* 25% { transform: translateY(0);} */
38+
37.5% { transform: translateY(-1rem);}
39+
/* 50% { transform: translateY(0);} */
40+
62.5% { transform: translateY(1rem);}
41+
/* 75% { transform: translateY(0);} */
42+
87.5% { transform: translateY(-1rem);}
43+
100% { transform: translateY(0);}
44+
}
45+
46+
/* Jelly */
47+
.nep-jelly {
48+
animation: nep-jelly var(--nep-animation-duration) var(--nep-animation-delay) var(--nep-animation-direction) var(--nep-animation-fillmode);
49+
}
50+
51+
@keyframes nep-jelly {
52+
20% {
53+
transform: scale(1.3, .9);
54+
}
55+
50% {
56+
transform: scale(.8, 1);
57+
}
58+
80% {
59+
transform: scale(1.2, .8);
60+
}
61+
}

test/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import NeptuneAnimate from "../neptune-animations.js"
1717

1818
const myElement = document.getElementById("test");
19-
const neptuneAnimate = new NeptuneAnimate(myElement, "nep-scale-down");
19+
const neptuneAnimate = new NeptuneAnimate(myElement, "nep-jelly");
2020

2121
neptuneAnimate.startAnimation();
2222
</script>

0 commit comments

Comments
 (0)