跳动的霓虹灯字片头

在这里插入图片描述

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Neon Glitch Text Animation</title>
    <style>
        body {
            margin: 0;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            background: #0a0a0a;
            overflow: hidden;
        }

        .neon-container {
            position: relative;
            font-family: 'Arial', sans-serif;
            font-size: 6vw;
            text-transform: uppercase;
            letter-spacing: 4px;
        }

        .neon-text {
            position: relative;
            color: #00ff99;
            text-shadow: 
                0 0 5px #00ff99,
                0 0 10px #00ff99,
                0 0 20px #00ff99,
                0 0 40px #00ff99,
                0 0 80px #00ff99;
            
            animation: flicker 2s infinite,
                       glitch 1s linear infinite,
                       float 3s ease-in-out infinite;
        }

        .neon-text::before,
        .neon-text::after {
            content: attr(data-text);
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            color: #ff00ff;
            text-shadow: 
                0 0 5px #ff00ff,
                0 0 10px #ff00ff,
                0 0 20px #ff00ff,
                0 0 40px #ff00ff;
            opacity: 0.8;
        }

        .neon-text::before {
            animation: glitch-left 1s linear infinite;
        }

        .neon-text::after {
            animation: glitch-right 1s linear infinite;
        }

        @keyframes flicker {
            0%, 18%, 22%, 25%, 53%, 57%, 100% {
                opacity: 1;
            }
            20%, 24%, 55% {
                opacity: 0;
            }
        }

        @keyframes glitch {
            0% { transform: translate(0); }
            20% { transform: translate(-2px, 2px); }
            40% { transform: translate(-2px, -2px); }
            60% { transform: translate(2px, 2px); }
            80% { transform: translate(2px, -2px); }
            100% { transform: translate(0); }
        }

        @keyframes glitch-left {
            0% { transform: translateX(-5px); }
            20% { transform: translateX(5px); }
            40% { transform: translateX(-3px); }
            60% { transform: translateX(3px); }
            80% { transform: translateX(-2px); }
            100% { transform: translateX(0); }
        }

        @keyframes glitch-right {
            0% { transform: translateX(5px); }
            20% { transform: translateX(-5px); }
            40% { transform: translateX(3px); }
            60% { transform: translateX(-3px); }
            80% { transform: translateX(2px); }
            100% { transform: translateX(0); }
        }

        @keyframes float {
            0% { transform: translateY(0); }
            50% { transform: translateY(-10px); }
            100% { transform: translateY(0); }
        }

        .scan-line {
            position: absolute;
            width: 100%;
            height: 2px;
            background: rgba(255, 255, 255, 0.1);
            animation: scan 2s linear infinite;
        }

        @keyframes scan {
            0% { transform: translateY(0); }
            100% { transform: translateY(100%); }
        }

        .background-glitches {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            pointer-events: none;
        }

        .glitch-line {
            position: absolute;
            width: 20%;
            height: 2px;
            background: #00ff99;
            opacity: 0;
            animation: line-fade 3s infinite;
        }

        @keyframes line-fade {
            0% { opacity: 0; transform: translateY(0); }
            50% { opacity: 0.5; transform: translateY(100px); }
            100% { opacity: 0; transform: translateY(200px); }
        }
    </style>
</head>
<body>
    <div class="neon-container">
        <div class="neon-text" data-text="container">container</div>
        <div class="neon-text" data-text="PUNK" style="margin-left: 20px; color: #ff00ff;">PUNK</div>
    </div>

    <div class="background-glitches">
        <div class="glitch-line" style="top: 20%; left: 10%; width: 15%; animation-delay: 0s;"></div>
        <div class="glitch-line" style="top: 40%; right: 5%; width: 25%; animation-delay: 0.5s;"></div>
        <div class="glitch-line" style="top: 60%; left: 30%; width: 10%; animation-delay: 1s;"></div>
        <div class="glitch-line" style="top: 80%; right: 15%; width: 30%; animation-delay: 1.5s;"></div>
    </div>

    <script>
        // 动态生成扫描线
        for(let i = 0; i < 10; i++) {
            const line = document.createElement('div');
            line.className = 'scan-line';
            line.style.animationDelay = `${Math.random()}s`;
            document.body.appendChild(line);
        }

        // 鼠标交互效果
        document.addEventListener('mousemove', (e) => {
            const sparks = document.createElement('div');
            sparks.className = 'glitch-line';
            sparks.style.position = 'fixed';
            sparks.style.left = `${e.clientX}px`;
            sparks.style.top = `${e.clientY}px`;
            sparks.style.width = '50px';
            sparks.style.transform = 'rotate(45deg)';
            sparks.style.animation = 'line-fade 1s forwards';
            document.body.appendChild(sparks);
            setTimeout(() => sparks.remove(), 1000);
        });
    </script>
</body>
</html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值