CSS Compress Y animation effect
CSS Compress Y animation
Similar to compress-x , compress a HTML element in Y-direction with the transform#scale CSS transform function.
<style>
.compress-y {
/* Uncomment as needed. */
/* width: 100px; */
/* height: 100px; */
/* background-color: deeppink; */
animation-name: compress-y;
animation-duration: 4s;
animation-iteration-count: infinite;
animation-timing-function: linear;
}
@keyframes compress-y {
0% { transform: scale(1, 1); }
25% { transform: scale(1, 0.5); }
30% { transform: scale(1, 0.6); }
50% { transform: scale(1, .3); }
75% { transform: scale(1.5, 0.1) }
78% { transform: scale(1, 0.2) }
100% { transform: scale(1, 1); }
}
</style>
- If you cannot see your HTML element when using our code, you may need to set a width and or height, or background on your target HTML element using CSS. Just uncomment the CSS properties in our code as needed.
- Remove the HTML style tag as needed.
- Change values in the code such as animation-duration as needed.
Animation effects source code licenced under
MIT Licence