svg遮罩动画效果

代码语言:html

所属分类:动画

代码描述:svg遮罩动画效果

代码标签: 效果

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

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

    <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700'>
    <style>
        body {
            background-color: #e0e0e0;
            font-family: 'Source Sans Pro', sans-serif;
            padding: 0;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100vh;
            overflow: hidden;
        }

        #demo {
            font-weight: 700;

        }
    </style>

</head>
<body translate="no">
    <svg id="demo" xmlns="http://www.w3.org/2000/svg" width="600" height="300" viewBox="0 0 200 100">
        <defs>
            <radialGradient id="centerGradient">
                <stop id="theStop" offset="10%" stop-color="#fff" />
                <stop offset="100%" stop-color="#000" />
            </radialGradient>
            <mask id="theMask">
                <circle id="circleMask" r="0" fill="url(#centerGradient)" cx="50" cy="50" />
            </mask>
            <clipPath id="theClipPath">
                <circle id="circleClip" r="0" fill="white" cx="150" cy="50" />
            </clipPath>
        </defs>
        <g id="maskReveal" mask="url(#theMask)">
            &l.........完整代码请登录后点击上方下载按钮下载查看

网友评论0