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>3D 可视化房屋设计器</title>
<style>
:root {
--primary: #2c3e50;
--accent: #3498db;
--bg: #f8f9fa;
--text: #333;
}
body { margin: 0; overflow: hidden; background-color: var(--bg); font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
canvas { display: block; }
/* UI 布局 */
#ui-container {
position: absolute; top: 0; left: 0; width: 100%; height: 100%;
pointer-events: none; display: flex; flex-direction: column;
}
/* 顶部工具栏 */
#top-bar {
background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
padding: 15px 30px; display: flex; justify-content: space-between; align-items: center;
box-shadow: 0 2px 10px rgba(0,0,0,0.05); pointer-events: auto; z-index: 10;
}
.logo { font-size: 20px; font-weight: bold; color: var(--primary); letter-spacing: 1px; }
.mode-switch { display: flex; gap: 10px; }
button {
padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; font-weight: 600;
cursor: pointer; transition: all 0.2s; background: #eee; color: var(--text);
}
button.active { background: var(--accent); color: white; box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3); }
button:hover:not(.active) { background: #ddd; }
#btn-clear { background: #e74c3c; color: white; }
#btn-clear:hover { background: #c0392b; }
/* 主体区域 (侧边栏 + 提示) */
#main-area { flex: 1; display: flex; position: relative; }
/* 左侧家具栏 */
#sidebar {
width: 250px; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(10px);
padding: 20px; box-shadow: 2px 0 10px rgba(0,0,0,0.05); pointer-events: auto;
display: none; flex-direction: column; gap: 15px; overflow-y: auto; z-index: 10;
}
.furniture-item {
background: var(--bg); border: 1px solid #eee; border-radius: 8px; padding: 15px;
text-align: center; cursor: pointer; transition: all 0.2s; font-weight: 500; color: var(--primary);
}
.furniture-item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.05); }
/* 底部提示信息 */
#hint {
position: absolute;.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0