three实现炫酷三维粒子宇宙空间代码

代码语言:html

所属分类:三维

代码描述:three实现炫酷三维粒子宇宙空间代码

代码标签: three 炫酷 三维 粒子 宇宙 空间 代码

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

<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>粒子宇宙空间 - Three.js</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            overflow: hidden;
            background: #000;
            font-family: 'Segoe UI', Arial, sans-serif;
        }
        #canvas {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
        #ui {
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 100;
            color: white;
        }
        #title {
            font-size: 28px;
            font-weight: 300;
            letter-spacing: 8px;
            text-transform: uppercase;
            background: linear-gradient(90deg, #00d9ff, #ff00ff, #00d9ff);
            background-size: 200% 100%;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: gradientMove 3s linear infinite;
            margin-bottom: 15px;
        }
        @keyframes gradientMove {
            0% { background-position: 0% 50%; }
            100% { background-position: 200% 50%; }
        }
        #controls {
            background: rgba(0, 20, 40, 0.7);
            backdrop-filter: blur(10px);
            padding: 20px;
            border-radius: 15px;
            border: 1px solid rgba(0, 217, 255, 0.3);
            max-width: 300px;
        }
        #controls h3 {
            color: #00d9ff;
            margin-bottom: 15px;
            font-weight: 400;
            font-size: 14px;
            letter-spacing: 2px;
        }
        .control-item {
            margin: 12px 0;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .control-item label {
            flex: 1;
            font-size: 13px;
            opacity: 0.8;
        }
        .control-item input[type="range"] {
            width: 120px;
            accent-color: #00d9ff;
        }
        .btn {
            background: linear-gradient(135deg, rgba(0,217,255,0.2), rgba(255,0,255,0.2));
            border: 1px solid rgba(0,217,255,0.5);
            color: white;
            padding: 10px 20px;
            border-radius: 25px;
            cursor: pointer;
            font-size: 12px;
            letter-spacing: 1px;
            transition: all 0.3s;
            margin: 5px;
        }
        .btn:hover {
            background: linear-gradient(135deg, rgba(0,217,255,0.4), rgba(255,0,255,0.4));
            transform: scale(1.05);
            box-shadow: 0 0 20px rgba(0,217,255,0.5);
        }
        #info {
            position: fixed;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            color: rgba(255,255,255,0.6);
            font-size: 12px;
            text-align: center;
            letter-spacing: 1px;
        }
        #stats {
            position: fixed;
            top: 20px;
            right: 20px;
            background: rgba(0, 20, 40, 0.7);
            backdrop-filter: blur(10px);
            padding: 15px 20px;
            border-radius: 10px;
            border: 1px solid rgba(0, 217, 255, 0.3);
            color: white;
            font-size: 12px;
        }
        #stats div {
            margin: 5px 0;
            display: flex;
            justify-content: space-between;
            gap: 20px;
        }
        #stats span {
            color: #00d9ff;
        }
        .mode-indicator {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 48px;
            color: white;
            text-shadow: 0 0 30px #00d9ff, 0 0 60px #ff00ff;
            opacity: 0;
            transition: opacity 0.5s;
            pointer-events: none;
            z-index: 1000;
        }
        .mode-indicator.visible {
            opacity: 1;
        }
        #crosshair {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 30px;
            height: 30px;
            border: 2px solid rgba(0,217,255,0.3);
            border-radius: 50%;
            pointer-events: none;
            z-index: 50;
        }
        #crosshair::before, #crosshair::after {
            content: '';
            position: absolute;
            background: rgba(0,217,255,0.5);
        }
        #crosshair::before {
            width: 10px;
            height: 2px;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
        }
        #crosshair::after {
            width: 2px;
            height: 10px;
            top: 50%;
            left: 50%;
            transform: transl.........完整代码请登录后点击上方下载按钮下载查看

网友评论0