js+css实现红包雨动画效果代码

代码语言:html

所属分类:动画

代码描述:js+css实现红包雨动画效果代码

代码标签: 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
<style>
    /*petalbox*/
* {
    margin: 0;
    padding: 0;
}
.header {
    position: relative;
    z-index: 100;
    width: 100%;
    background: #ddd;
    height: 52px;
}
#petalbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 98;
    pointer-events: none;
}
#petalbox > div {
    position: absolute;
    -webkit-animation-iteration-count: 1, 1;
    -webkit-animation-direction: normal, normal;
    -webkit-animation-timing-function: linear, ease-in;
    -webkit-backface-visibility: hidden;
    animation-iteration-count: 1, 1;
    animation-direction: normal, normal;
    animation-timing-function: linear, ease-in;
    backface-visibility: hidden;
}
#petalbox > div > img {
    position: absolute;
    -webkit-animation-iteration-count: infinite;
    -webkit-animation-direction: alternate;
    -webkit-animation-timing-function: linear;
    -webkit-backface-visibility: hidden;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-timing-function: linear;
    backface-visibility: hidden;
}
@-webkit-keyframes fade {
    0%, 90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
@keyframes fade {
    0%, 90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}
@-webkit-keyframes drop {
    0% {
        -webkit-transform: translate3d(0, 0, 0);
    }
    100% {
        -webkit-transform: translate3d(0, 1100px, 0);
    }
}
@keyframes drop {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(0, 1100px, 0);
    }
}
@-webkit-keyframes clockwiseSpin {
    0% {
        -webkit-transform: none;
    }
    100% {
        -webkit-transform: rotate(480deg);
    }
}
@keyframes clockwiseSpin {
    0% {
        transform: none;
    }
    100% {
        .........完整代码请登录后点击上方下载按钮下载查看

网友评论0