CSS - Fade Out Up Big Effect
Description
The image come or cause to come gradually into or out of view, or to merge into another shot.
Syntax
@keyframes fadeOutUpBig {
0% {
opacity: 1;
transform: translateY(0);
}
100% {
opacity: 0;
transform: translateY(-2000px);
}
}
Parameters
Transform − Transform applies to 2d and 3d transformation to an element.
Opacity − Opacity applies to an element to make translucence.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<style>
.foubAnimated {
background-image: url(/html/images/test.png);
background-repeat: no-repeat;
background-position: left top;
padding-top: 95px;
margin-bottom: 60px;
-webkit-animation-duration: 2s;
animation-duration: 2s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
.btn {
text-align: center;
}
@-webkit-keyframes fadeOutUpBig {
0% {
opacity: 1;
-webkit-transform: translateY(400px);
}
100% {
opacity: 0;
-webkit-transform: translateY(0);
}
}
@keyframes fadeOutUpBig {
0% {
opacity: 1;
transform: translateY(400px);
}
100% {
opacity: 0;
transform: translateY(0);
}
}
.fadeOutUpBig {
-webkit-animation-name: fadeOutUpBig;
animation-name: fadeOutUpBig;
}
</style>
</head>
<body>
<div id="foubAnimates" class="foubAnimated"></div>
<div class="btn">
<button onclick="foubFunc()">Click</button>
</div>
<script>
function foubFunc() {
document.getElementById("foubAnimates").classList.add('fadeOutUpBig');
}
</script>
</body>
</html>
Output
It will produce the following result:
css_animation.htm
Advertisements