新年快乐祝福动画效果

代码语言:html

所属分类:动画

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

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <style>
@import url(https://fonts.googleapis.com/css?family=Roboto:400,300);

        body {
            text-align: center;
            background: #222;
            color: #fff;
            background-image: url("http://repo.bfw.wiki/bfwrepo/image/5e0404c255106.png");
            background-size: cover;
        }

        h1 {
            font-family: 'Lobster Two', cursive;
            font-weight: 300;
            font-size: 100px;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%,-50%);
            margin: 0;
            width: 100%;
        }

        .visually-hidden {
            position: absolute;
            overflow: hidden;
            clip: rect(0 0 0 0);
            height: 1px;
            width: 1px;
            margin: -1px;
            padding: 0;
            border: 0;
        }

        /* code for animated blinking cursor */
        .typed-cursor {
            opacity: 1;
            font-weight: 100;
            animation: blink 0.7s infinite;
        }

@keyframes blink {
            0% {
                opacity: 1;
            }
            50% {
                opacity: 0;
            }
            100% {
                opacity: 1;
            }
        }

        /*MEDIA QUERY*/
@media only screen and (max-width: 715px) {
            h1 {
                font-size: 70px;
            }
        }

@media only screen and (max-width: 500px) {
            h1 {
                font-size: 50px;
            }
        }
    </style>

</head>
<body translate="no">
    <div class="type-wrap">
        <h1>
            <span class="visually-hidden">Merry Christmas and a happy new year!</span>
            <span role="presentation" aria-hidden="true"></span>
        </h1>
    </div>
    <script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/typed.1.1.4.js"></script>


    <script>
        $(".type-wrap span:last").typed({
            strings: ["<strong>新 年 快 乐!</strong></br><strong>万 事 如 意!</strong>"],
            typeSpeed: 200,
            loop: false,
            contentType: 'html'
        });


        /*SNOW*/

        /** @license
        * DHTML Snowstorm! JavaScript-based snow for web pages
        * Making it snow on the internets since 2003. You're welcome.
        * -----------------------------------------------------------
        * Version 1.44.20131208 (Previous rev: 1.44.20131125)
        * Copyright (c) 2007, Scott Schiller. All rights reserved.
        * Code provided under the BSD License
        * http://schillmania.com/projects/snowstorm/license.txt
        */

        /*jslint nomen: true, plusplus: true, sloppy: true, vars: true, white: true */
        /*global window, document, navigator, clearInterval, setIn.........完整代码请登录后点击上方下载按钮下载查看

网友评论0