旋转动画网页特效

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>旋转动画网页特效</title>
    <style>
        body {
            margin: 0;
            padding: 0;
            background-color: #000;
            overflow: hidden;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            font-family: Arial, sans-serif;
        }
        
        .portal-container {
            position: relative;
            width: 300px;
            height: 300px;
        }
        
        .portal {
            position: absolute;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: radial-gradient(circle, #00ffff 0%, #0088ff 50%, #0000ff 100%);
            box-shadow: 0 0 50px #00ffff, 0 0 100px #0088ff;
            animation: pulse 2s infinite alternate;
            overflow: hidden;
        }
        
        .portal-inner {
            position: absolute;
            width: 100%;
            height: 100%;
            background: conic-gradient(
                from 0deg,
                transparent 0%,
                rgba(0, 255, 255, 0.5) 10%,
                transparent 20%,
                transparent 30%,
                rgba(0, 200, 255, 0.5) 40%,
                transparent 50%,
                transparent 60%,
                rgba(0, 150, 255, 0.5) 70%,
                transparent 80%,
                transparent 90%,
                rgba(0, 100, 255, 0.5) 100%
            );
            animation: spin 4s linear infinite;
        }
        
        .particles {
            position: absolute;
            width: 100%;
            height: 100%;
        }
        
        .particle {
            position: absolute;
            width: 4px;
            height: 4px;
            background-color: #fff;
            border-radius: 50%;
            opacity: 0;
            animation: float 3s infinite;
        }
        
        .link-container {
            position: absolute;
            bottom: -50px;
            width: 100%;
            text-align: center;
            color: white;
        }
        
        .link-container a {
            color: #00ffff;
            text-decoration: none;
            font-size: 14px;
        }
        
        @keyframes pulse {
            0% {
                transform: scale(1);
                box-shadow: 0 0 50px #00ffff, 0 0 100px #0088ff;
            }
            100% {
                transform: scale(1.05);
                box-shadow: 0 0 70px #00ffff, 0 0 140px #0088ff;
            }
        }
        
        @keyframes spin {
            0% {
                transform: rotate(0deg);
            }
            100% {
                transform: rotate(360deg);
            }
        }
        
        @keyframes float {
            0% {
                transform: translateY(0) translateX(0);
                opacity: 0;
            }
            10% {
                opacity: 1;
            }
            90% {
                opacity: 1;
            }
            100% {
                transform: translateY(-150px) translateX(random(100) - 50px);
                opacity: 0;
            }
        }
    </style>
</head>
<body>
    <div class="portal-container">
        <div class="portal">
            <div class="portal-inner"></div>
            <div class="particles" id="particles"></div>
        </div>

    </div>

    <script>
        // Create particles
        const particlesContainer = document.getElementById('particles');
        const particleCount = 30;
        
        for (let i = 0; i < particleCount; i++) {
            const particle = document.createElement('div');
            particle.classList.add('particle');
            
            // Random position
            const x = Math.random() * 100;
            const y = Math.random() * 100;
            particle.style.left = `${x}%`;
            particle.style.top = `${y}%`;
            
            // Random delay
            const delay = Math.random() * 5;
            particle.style.animationDelay = `${delay}s`;
            
            // Random size
            const size = Math.random() * 3 + 2;
            particle.style.width = `${size}px`;
            particle.style.height = `${size}px`;
            
            particlesContainer.appendChild(particle);
        }
    </script>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值