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: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            font-family: 'Microsoft YaHei', sans-serif;
        }

        #container {
            width: 100vw;
            height: 100vh;
        }

        /* 控制面板 */
        .control-panel {
            position: fixed;
            top: 20px;
            left: 20px;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(10px);
            padding: 20px;
            border-radius: 15px;
            color: white;
            z-index: 100;
            min-width: 200px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .control-panel h2 {
            font-size: 18px;
            margin-bottom: 15px;
            color: #4fc3f7;
            display: flex;
            align-items: center;
            gap: 8px;
        }

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

        .control-group label {
            display: block;
            margin-bottom: 8px;
            font-size: 14px;
            color: #aaa;
        }

        .switch {
            position: relative;
            width: 60px;
            height: 30px;
            display: inline-block;
        }

        .switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: #333;
            transition: 0.4s;
            border-radius: 30px;
        }

        .slider:before {
            position: absolute;
            content: "";
            height: 22px;
            width: 22px;
            left: 4px;
            bottom: 4px;
            background: white;
            transition: 0.4s;
            border-radius: 50%;
        }

        input:checked + .slider {
            background: #4fc3f7;
        }

        input:checked + .slider:before {
            transform: translateX(30px);
        }

        .btn {
            width: 100%;
            padding: 10px;
            margin-top: 5px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            transition: all 0.3s;
        }

        .btn-feed {
            background: linear-gradient(135deg, #ff9a56, #ff6b6b);
            color: white;
        }

        .btn-feed:hover {
            transform: scale(1.02);
            box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
        }

        .btn-bubble {
            background: linear-gradient(135deg, #4fc3f7, #2196f3);
            color: white;
        }

        .btn-bubble:hover {
            transform: scale(1.02);
            box-shadow: 0 5px 20px rgba(33, 150, 243, 0.4);
        }

        .color-options {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

        .color-btn {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            border: 2px solid transparent;
            cursor: pointer;
            transition: all 0.3s;
        }

        .color-btn:hover {
            transform: scale(1.2);
        }

        .color-btn.active {
            border-color: white;
        }

        .slider-control {
            width: 100%;
            height: 6px;
            border-radius: 3px;
            -webkit-appearance: none;
            background: #333;
            outline: none;
        }

        .slider-control::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #4fc3f7;
            cursor: pointer;
        }

        /* 信息面板 */
        .info-panel {
          .........完整代码请登录后点击上方下载按钮下载查看

网友评论0