新年快乐祝福动画效果

代码语言: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, setInterval */

        var snowStorm = (function(window, document) {

            // --- common properties ---

            this.autoStart = true; // Whether the snow should start automatically or not.
            this.excludeMobile = true; // Snow is likely to be bad news for mobile phones' CPUs (and batteries.) Enable at your own risk.
            this.flakesMax = 200; // Limit total amount of snow made (falling + sticking)
            this.flakesMaxActive = 100; // Limit amount of snow falling at once (less = lower CPU use)
            this.animationInterval = 25; // Theoretical "miliseconds per frame" measurement. 20 = fast + smooth, but high CPU use. 50 = more conservative, but slower
            this.useGPU = true; // Enable transform-based hardware acceleration, reduce CPU load.
            this.className = null; // CSS class name for further customization on snow elements
            this.excludeMobile = true; // Snow is likely to be bad news for mobile phones' CPUs (and batteries.) By default, be nice.
            this.flakeBottom = null; // Integer for Y axis snow limit, 0 or null for "full-screen" snow effect
            this.followMouse = true; // Snow movement can respond to the user's mouse
            this.snowColor = '#fff'; // Don't eat (or use?) yellow snow.
            this.snowCharacter = '&bull;'; // &bull; = bullet, &middot; is square on some systems etc.
            this.snowStick = true; // Whether or not snow should "stick" at the bottom. When off, will never collect.
            this.targetElement = null; // element which snow will be appended to (null = document.body) - can be an element ID eg. 'myDiv', or a DOM node reference
            this.useMeltEffect = true; // When recycling fallen snow (or rarely, when falling), have it "melt" and fade out if browser supports it
            this.useTwinkleEffect = false; // Allow snow to randomly "flicker" in and out of view while falling
            this.usePositionFixed = false; // true = snow does not shift vertically when scrolling. May increase CPU load, disabl.........完整代码请登录后点击上方下载按钮下载查看

网友评论0