three模拟宇宙黑洞粒子动画三维效果代码

代码语言:html

所属分类:三维

代码描述:three模拟宇宙黑洞粒子动画三维效果代码

代码标签: three 模拟 宇宙 黑洞 粒子 动画 三维

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

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三维宇宙黑洞模拟</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            overflow: hidden;
            background: #000;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            color: #fff;
        }

        canvas {
            display: block;
            cursor: grab;
        }

        canvas:active {
            cursor: grabbing;
        }

        #controls {
            position: fixed;
            top: 20px;
            right: 20px;
            background: rgba(0, 0, 0, 0.85);
            border: 1px solid rgba(100, 140, 255, 0.3);
            border-radius: 12px;
            padding: 20px;
            width: 320px;
            max-height: 90vh;
            overflow-y: auto;
            backdrop-filter: blur(10px);
            z-index: 100;
            box-shadow: 0 0 30px rgba(80, 120, 255, 0.15);
        }

        #controls::-webkit-scrollbar {
            width: 4px;
        }

        #controls::-webkit-scrollbar-thumb {
            background: rgba(100, 140, 255, 0.4);
            border-radius: 2px;
        }

        #controls h2 {
            text-align: center;
            margin-bottom: 15px;
            font-size: 18px;
            background: linear-gradient(90deg, #6af, #f6a);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            letter-spacing: 2px;
        }

        .control-section {
            margin-bottom: 15px;
            padding-bottom: 12px;
            border-bottom: 1px solid rgba(100, 140, 255, 0.15);
        }

        .control-section:last-child {
            border-bottom: none;
        }

        .section-title {
            font-size: 13px;
            color: #6af;
            margin-bottom: 10px;
            font-weight: bold;
            letter-spacing: 1px;
        }

        .control-group {
            margin-bottom: 10px;
        }

        .control-group label {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 12px;
            color: #aac;
            margin-bottom: 4px;
        }

        .control-group label span.value {
            color: #6df;
            font-weight: bold;
            min-width: 40px;
            text-align: right;
        }

        input[type="range"] {
            width: 100%;
            height: 4px;
            -webkit-appearance: none;
            appearance: none;
            background: rgba(100, 140, 255, 0.2);
            border-radius: 2px;
            outline: none;
        }

        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 14px;
            height: 14px;
            background: radial-gradient(circle, #8bf, #46a);
            border-radius: 50%;
            cursor: pointer;
            box-shadow: 0 0 8px rgba(100, 160, 255, 0.5);
        }

        input[type="range"]::-moz-range-thumb {
            width: 14px;
            height: 14px;
            background: radial-gradient(circle, #8bf, #46a);
            border-radius: 50%;
            cursor: pointer;
            border: none;
        }

        .btn-row {
            display: flex;
            gap: 8px;
            margin-top: 10px;
        }

        .btn {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid rgba(100, 140, 255, 0.4);
            background: rgba(100, 140, 255, 0.1);
            color: #8bf;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s;
            text-align: center;
        }

        .btn:hover {
            background: rgba(100, 140, 255, 0.3);
            box-shadow: 0 0 15px rgba(100, 140, 255, 0.2);
        }

        .btn.active {
            background: rgba(100, 180, 255, 0.3);
            border-color: #6af;
        }

        #info {
            position: fixed;
            bottom: 20px;
            left: 20px;
            background: rgba(0, 0, 0, 0.7);
        .........完整代码请登录后点击上方下载按钮下载查看

网友评论0