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;
            font-family: 'Segoe UI', Arial, sans-serif;
            background: #0a0a0a;
        }
        #ui {
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 100;
            display: flex;
            gap: 15px;
            align-items: center;
        }
        .switch-container {
            display: flex;
            align-items: center;
            gap: 15px;
            background: rgba(0,0,0,0.7);
            padding: 15px 25px;
            border-radius: 50px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.1);
        }
        .switch-label {
            color: white;
            font-size: 16px;
            font-weight: 500;
        }
        .switch {
            position: relative;
            width: 70px;
            height: 36px;
            cursor: pointer;
        }
        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        .slider {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: #333;
            border-radius: 36px;
            transition: all 0.4s;
            box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
        }
        .slider:before {
            position: absolute;
            content: "";
            height: 28px;
            width: 28px;
            left: 4px;
            bottom: 4px;
            background: white;
            border-radius: 50%;
            transition: all 0.4s;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
        }
        input:checked + .slider {
            background: linear-gradient(135deg, #f59e0b, #fbbf24);
            box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
        }
        input:checked + .slider:before {
            transform: translateX(34px);
        }
        .status {
            font-size: 24px;
            transition: all 0.3s;
        }
        .brightness-control {
            display: flex;
            align-items: center;
            gap: 10px;
            background: rgba(0,0,0,0.7);
            padding: 15px 20px;
            border-radius: 50px;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.1);
        }
        .brightness-control label {
            color: white;
            font-size: 14px;
        }
        .brightness-slider {
            width: 100px;
            height: 6px;
            -webkit-appearance: none;
            background: #333;
            border-radius: 3px;
            outline: none;
        }
        .brightness-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            background: #fbbf24;
            border-radius: 50%;
            cur.........完整代码请登录后点击上方下载按钮下载查看

网友评论0