SVG变色旋涡动画特效

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>SVG变色旋涡动画特效</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background: #000;
            overflow: hidden;
            font-family: Arial, sans-serif;
        }

        .container {
            position: relative;
            width: 100%;
            height: 100vh;
        }

        svg {
            width: 100%;
            height: 100%;
        }

        .spiral {
            transform-origin: center;
            animation: rotate 20s linear infinite, color-change 10s ease-in-out infinite alternate;
        }

        @keyframes rotate {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }

        @keyframes color-change {
            0% {
                filter: hue-rotate(0deg);
            }
            100% {
                filter: hue-rotate(360deg);
            }
        }

        /* 插入的链接样式 */
        .custom-link {
            position: fixed;
            bottom: 20px;
            right: 20px;
            color: rgba(255,255,255,0.7);
            text-decoration: none;
            font-size: 14px;
            background: rgba(0,0,0,0.3);
            padding: 8px 15px;
            border-radius: 20px;
            z-index: 10;
            transition: all 0.3s ease;
        }

        .custom-link:hover {
            color: white;
            background: rgba(0,0,0,0.5);
        }
    </style>
</head>
<body>
    <div class="container">
        <svg viewBox="0 0 800 800">
            <defs>
                <linearGradient id="spiralGradient" x1="50%" y1="0%" x2="50%" y2="100%">
                    <stop offset="0%" stop-color="#ff00cc" />
                    <stop offset="100%" stop-color="#3333ff" />
                </linearGradient>
            </defs>
            
            <path class="spiral" fill="none" stroke="url(#spiralGradient)" stroke-width="2" stroke-linecap="round"
                  d="M400,400 Q500,300 400,200 Q300,300 400,400 Q500,500 400,600 Q300,500 400,400 
                     Q500,300 400,200 Q300,100 400,0 Q500,100 400,200 Q300,300 400,400 
                     Q500,500 400,600 Q300,700 400,800 Q500,700 400,600 Q300,500 400,400 
                     Q500,300 400,200 Q300,100 400,0 Q500,-100 600,0 Q700,100 600,200 
                     Q500,300 600,400 Q700,500 600,600 Q500,700 600,800 Q700,900 600,1000 
                     Q500,900 600,800 Q700,700 600,600 Q500,500 600,400 Q700,300 600,200 
                     Q500,100 600,0 Q700,-100 800,0 Q900,100 800,200 Q700,300 800,400 
                     Q900,500 800,600 Q700,700 800,800 Q900,900 800,1000 Q700,900 800,800 
                     Q900,700 800,600 Q700,500 800,400 Q900,300 800,200 Q700,100 800,0" />
        </svg>
    </div>
    

</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值