three实现三室二厅3d三维户型图代码

代码语言:html

所属分类:三维

代码描述:three实现三室二厅3d三维户型图代码,由claude-4.5-opus生成,有文字标签、每个房间的面积,家居,尺码,支持多种视图模式,非常强大。

代码标签: three 三室二厅 3d 三维 户型图 代码

下面为部分代码预览,完整代码请点击下载或在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>🏠 3D 三室二厅户型图</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
            background: #1a1a2e;
            overflow: hidden;
        }

        #canvas {
            width: 100vw;
            height: 100vh;
            display: block;
        }

        /* 侧边信息栏 */
        .sidebar {
            position: fixed;
            left: 20px;
            top: 20px;
            width: 280px;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 16px;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            z-index: 100;
            overflow: hidden;
        }

        .sidebar-header {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
            padding: 20px;
        }

        .sidebar-header h1 {
            font-size: 1.4em;
            margin-bottom: 5px;
        }

        .sidebar-header p {
            font-size: 0.85em;
            opacity: 0.9;
        }

        .info-section {
            padding: 15px 20px;
            border-bottom: 1px solid #eee;
        }

        .info-section h3 {
            font-size: 0.9em;
            color: #666;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .room-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .room-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            background: #f8f9fa;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.3s;
        }

        .room-item:hover {
            background: #e9ecef;
            transform: translateX(5px);
        }

        .room-item.active {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
        }

        .room-color {
            width: 16px;
            height: 16px;
            border-radius: 4px;
            margin-right: 10px;
        }

        .room-name {
            flex: 1;
            font-size: 0.9em;
        }

        .room-area {
            font-size: 0.85em;
            color: #888;
            font-weight: bold;
        }

        .room-item.active .room-area {
            color: rgba(255,255,255,0.9);
        }

        .total-area {
            display: flex;
            justify-content: space-between;
            padding: 15px 20px;
            background: #f8f9fa;
            font-weight: bold;
        }

        .total-area span:last-child {
            color: #667eea;
            font-size: 1.2em;
        }

        /* 控制面板 */
        .control-panel {
            position: fixed;
            right: 20px;
            top: 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            z-index: 100;
        }

        .ctrl-btn {
            width: 50px;
            height: 50px;
            border: none;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.95);
            color: #333;
            font-size: 20px;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .ctrl-btn:hover {
            transform: scale(1.1);
            background: #667eea;
            color: white;
        }

        .ctrl-btn.active {
            background: #667eea;
            color: white;
        }

        /* 视图切换 */
        .view-toggle {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 30px;
            padding: 5px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
            z-index: 100;
        }

        .view-btn {
            padding: 12px 30px;
            border: none;
            background: transparent;
            border-radius: 25px;
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
            color: #666;
            transition: all 0.3s;
        }

        .view-btn.active {
            background: linear-gradient(135deg, #667eea, #764ba2);
            color: white;
        }

        /* 楼层选择 */
        .floor-selector {
            position: fixed;
            left: 20px;
            bottom: 30px;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 12px;
            padding: 15px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
            z-index: 100;
        }

        .floor-selector h4 {
            font-size: 0.85em;
            color: #666;
            margin-bottom: 10px;
        }

        .floor-btns {
            display: flex;
            gap: 8px;
        }

        .floor-btn {
            padding: 8px 16px;
            border: 2px solid #ddd;
            background: white;
            border-radius: 8px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.3s;
        }

        .floor-btn.active {
            border-color: #667eea;
            background: #667eea;
            color: white;
        }

        /* 比例尺 */
        .scale-bar {
            position: fixed;
            right: 20px;
            bottom: 30px;
            background: rgba(255, 255, 255, 0.95);
            border-radius: 12px;
            padding: 15px 20px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
            z-index: 100;
        }

        .scale-line {
            width: 100px;
            height: 4px;
            background: #333;
            border-radius: 2px;
            position: relative;
            margin-bottom: 5px;
        }

        .scale-line::before,
        .scale-line::after {
            content: '';
            position: absolute;
            width: 4px;
            heigh.........完整代码请登录后点击上方下载按钮下载查看

网友评论0