新年快乐文字描边动画效果

代码语言:html

所属分类:动画

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

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

    <style>
@keyframes stroke
        {
            10% {
                stroke-dashoffset: 600;
            }
            70% {
                stroke-dashoffset: 0;
                fill: #FFF;
            }
            80% {
                stroke-dashoffset: 0;
                fill: #092951;
            }
            100% {
                stroke-dashoffset: 0;
                fill: #092951;
            }
        }

@-webkit-keyframes stroke
        {
            10% {
                stroke-dashoffset: 600;
            }
            70% {
                stroke-dashoffset: 0;
                fill: #FFF;
            }
            80% {
                stroke-dashoffset: 0;
                fill: #092951;
            }
            100% {
                stroke-dashoffset: 0;
                fill: #092951;
            }
        }

        *
        {
            margin: 0;
            padding: 0;
            border: none;
        }

        body, html
        {
            width: 100%;
            min-width: 500px;
            height: 100%;
            min-height: 400px;
            overflow: hidden;
        }

        #wrap
        {
            width: 500px;
            height: 400px;
            position: absolute;
            top: 50%;
            left: 50%;
            margin: -200px 0 0 -250px;
        }

        #wrap path
        {
            stroke: #092951;
            fill: #FFF;
            stroke-width: 1;
            stroke-dasharray: 600;
            stroke-dashoffset: 600;
            animation: stroke 6s linear infinite alternate forwards;
            -webkit-animation: stroke 6s linear infinite alternate forwards;
        }
    </style>

</head>
<body translate="no">
    <div id="wrap">
        <svg width="500" height="400" version="1.1" id="hny" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 500 400" enable-background="new 0 0 500 400" xml:space="preserve">
            <g>
                <path d="M101.1,74h23.6v10.5h-5.1v15.5H143V84.5h-5.2V74h23.5v10.5h-5.1v43.8h5.1v10.6h-23.4v-10.6h5.1v-17.6h-23.5v17.6h5.2v10.6
                    h-23.6v-10.6l5.2-0.1V84.5h-5.2V74z"></path>
             .........完整代码请登录后点击上方下载按钮下载查看

网友评论0