canvas实现炫酷新年快乐粒子烟花绽放动画效果代码

代码语言:html

所属分类:粒子

代码描述:canvas实现炫酷新年快乐粒子烟花绽放动画效果代码

代码标签: canvas 炫酷 新年 快乐 粒子 烟花 绽放 动画

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

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> New Year's Eve Fireworks 2026</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            overflow: hidden;
            background: linear-gradient(to bottom, #0a0a1a 0%, #1a1a3a 50%, #2a1a2a 100%);
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            user-select: none;
        }

        canvas {
            display: block;
            cursor: crosshair;
        }

        .ui-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            pointer-events: none;
            z-index: 100;
        }

        .title {
            color: #fff;
            text-shadow: 0 0 20px #ff6b6b, 0 0 40px #ff6b6b, 0 0 60px #ff6b6b;
            font-size: 2.5em;
            font-weight: bold;
            letter-spacing: 3px;
            animation: glow 2s ease-in-out infinite alternate;
        }

        @keyframes glow {
            from { text-shadow: 0 0 20px #ff6b6b, 0 0 40px #ff6b6b; }
            to { text-shadow: 0 0 30px #ffd93d, 0 0 60px #ffd93d, 0 0 80px #ffd93d; }
        }

        .controls {
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: auto;
        }

        .btn {
            padding: 15px 30px;
            font-size: 1.1em;
            font-weight: bold;
            border: none;
            border-radius: 50px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        .btn-finale {
            background: linear-gradient(135deg, #ff6b6b, #ffd93d, #6bcb77, #4d96ff, #9b59b6);
            background-size: 300% 300%;
            animation: rainbow 3s ease infinite;
            color: #fff;
            box-shadow: 0 0 20px rgba(255, 107, 107, 0.5), 0 0 40px rgba(255, 217, 61, 0.3);
        }

        .btn-finale:hover {
            transform: scale(1.1);
            box-shadow: 0 0 30px rgba(255, 107, 107, 0.8), 0 0 60px rgba(255, 217, 61, 0.5);
        }

        .btn-finale:active {
            transform: scale(0.95);
        }

        .btn-finale.active {
            animation: rainbow 0.5s ease infinite, pulse 0.3s ease infinite;
        }

        @keyframes rainbow {
            0% { background-position: 0% 50%; }
            50% .........完整代码请登录后点击上方下载按钮下载查看

网友评论0