jquery模仿双十一红包雨动画效果代码

代码语言:html

所属分类:红包

代码描述:jquery模仿双十一红包雨动画效果代码

代码标签: 十一 红包 动画 效果

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

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1, minimum-scale=0.5, maximum-scale=1" />
    <style>


        /************ 悬浮导航 ************/
        .nov-float {
            position: fixed;
            top: 180px;
            left: calc(50% - 740px);
            z-index: 88;
        }
        .hob-inlet {
            position: relative;
            width: 110px;
            height: 113px;
            top: 0;
            background-repeat: no-repeat;
            background-position: center bottom;
            background-size: contain;
            background-image: url(//repo.bfw.wiki/bfwrepo/image/60da7680a341e.png);
            z-index: 1;
            cursor: pointer;
        }
        .hob-inlet-03 {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background-repeat: no-repeat;
            background-position: center bottom;
            background-size: contain;
            background-image: url(//repo.bfw.wiki/bfwrepo/image/60da76b6f1eef.png);
            z-index: 1;
        }
        .hob-inlet-02 {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background-repeat: no-repeat;
            background-position: center bottom;
            background-size: contain;
            background-image: url(//repo.bfw.wiki/bfwrepo/image/60da76d6813da.png);
            z-index: 2;
        }
        .hob-inlet-01 {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background-repeat: no-repeat;
            background-position: center bottom;
            background-size: contain;
            background-image: url(//repo.bfw.wiki/bfwrepo/image/60da76e919cfb.png);
            z-index: 3;
        }
        .hob-inlet:not(.disable) .hob-inlet-02 {
            animation: hob_shake 1s infinite
        }
        .hob-inlet:not(.disable):hover .hob-inlet-02 {
            animation: hob 1s 1
        }
        .for-get-now {
            z-index: 33;
            animation: hob_btn 2.5s infinite
        }
@keyframes hob_shake {
            15%, 45% {
                -webkit-transform: rotate(3deg);
                transform: rotate(3deg);
                transform-origin: 50% 100%;
            }
            30% {
                -webkit-transform: rotate(-3deg);
                transform: rotate(-3deg);
                transform-origin: 50% 100%;
            }
            60% ,100% {
                -webkit-transform: rotate(0deg);
                transform: rotate(0deg);
                transform-origin: 50% 100%;
            }
        }
@keyframes hob {
            10%, 30%, 50% {
                -webkit-transform: translateY(-10px);
                transform: translateY(-10px);
            }
            20%, 40% {
                -webkit-transform: translateY(-5px);
                transform: translateY(-5px);
            }
            60% ,100% {
                -webkit-transform: translateY(0);
                transform: translateY(0);
            }
        }
@keyframes hob_btn {
            10%, 30%, 50%, 70%, 90% {
                -webkit-transform: scale(1.1);
                transform: scale(1.1)
            }
            20%, 40%, 60%, 80% {
                -webkit-transform: scale(1);
                transform: scale(1)
            }
        }


        .hob-mb {
            display: none;
        }
@media(max-width: 1400px) {
            .nov-float {
                left: 0;
                transform: scale(0.7);
            }
        }
@media(max-width: 1199px) {
            .nov-float {
                display: none;
            }
        }
@media(max-width: 768px) {
            .mb-nav {
                position: fixed;
                top: 60px;
                left: 0;
                width: 100%;
                font-size: 0;
                text-align: center;
                z-index: 66;
                background-image: linear-gradient(0deg, #FFE6C8 0%, #FEFCF9 100%);
                box-shadow: 6px 2px 9px 0 rgba(110,33,12,0.34);
            }
            .mb-nav a {
                display: inline-block;
                width: 33.333333%;
                padding: 5px 0;
                color: #f66f6a;
                font-size: 14px;
                font-weight: bold;
                line-height: 20px;
            }
            .mb-nav a.active {
                color: #fff;
                background-image: linear-gradient(-13deg, #6A00FF 0%, #ED0F55 100%);
            }
            .hob-mb {
                display: block;
                position: fixed;
                width: 58px;
                height: 67px;
                right: 0;
                top: 30%;
                z-index: 8;
            }
            .hob-mb .hob-inlet {
                display: block;
        .........完整代码请登录后点击上方下载按钮下载查看

网友评论0