Spaces:
Running
Running
| <html lang="zh-CN"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>AI导师教学 - 中药饮片实训系统</title> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> | |
| <style> | |
| /* 继承 training.html 的大部分样式 */ | |
| :root { | |
| --primary-color: #4a90e2; /* 蓝色主题 */ | |
| --ai-bg: #f7f9fc; | |
| --user-msg-bg: #4a90e2; | |
| --ai-msg-bg: #e9ecef; | |
| --light-bg: #f0f2f5; | |
| --panel-bg: #ffffff; | |
| --text-color: #333333; | |
| --border-color: #e9ecef; | |
| } | |
| body, * { box-sizing: border-box; } | |
| body { | |
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; | |
| margin: 0; background-color: var(--light-bg); height: 100vh; | |
| overflow: hidden; display: flex; flex-direction: column; | |
| } | |
| .top-bar { | |
| background-color: var(--primary-color); color: white; padding: 12px 20px; | |
| display: flex; justify-content: space-between; align-items: center; | |
| box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 100; flex-shrink: 0; | |
| } | |
| .top-bar h1 { margin: 0; font-size: 1.4em; font-weight: 600; } | |
| .mode-switcher a, .mode-switcher button { | |
| background-color: transparent; border: 1px solid white; color: white; | |
| padding: 8px 16px; margin-left: 10px; border-radius: 5px; cursor: pointer; | |
| transition: all 0.3s; font-size: 14px; text-decoration: none; | |
| font-family: inherit; | |
| } | |
| .mode-switcher .active, .mode-switcher a:hover, .mode-switcher button:hover { | |
| background-color: white; color: var(--primary-color); | |
| } | |
| .main-content { display: flex; flex: 1; overflow: hidden; min-height: 0; } | |
| #sidebar { | |
| width: 220px; background-color: var(--panel-bg); padding: 16px; | |
| box-shadow: 2px 0 5px rgba(0,0,0,0.1); overflow-y: auto; flex-shrink: 0; | |
| } | |
| #sidebar h2 { margin: 0 0 16px 0; font-size: 1.1em; color: var(--text-color); } | |
| #herb-list { list-style: none; padding: 0; margin: 0; } | |
| #herb-list li { | |
| padding: 10px 12px; cursor: pointer; border-radius: 6px; | |
| margin-bottom: 6px; transition: all 0.2s; font-size: 14px; | |
| } | |
| #herb-list li:hover { background-color: #eaf2fb; } | |
| #herb-list li.active { background-color: var(--primary-color); color: white; font-weight: 500; } | |
| #viewer-container { flex: 1; position: relative; min-width: 0; } | |
| #c { display: block; width: 100%; height: 100%; } | |
| /* 加载覆盖层 */ | |
| #loading-overlay { | |
| position: absolute; top: 0; left: 0; width: 100%; height: 100%; | |
| background-color: rgba(0, 0, 0, 0.7); | |
| display: flex; justify-content: center; align-items: center; | |
| z-index: 20; transition: opacity 0.5s; | |
| pointer-events: none; opacity: 0; | |
| } | |
| #loading-overlay.visible { opacity: 1; pointer-events: auto; } | |
| .loading-box { | |
| text-align: center; color: white; background-color: rgba(40, 40, 40, 0.9); | |
| padding: 30px 40px; border-radius: 10px; | |
| } | |
| .loading-title { font-size: 1.2em; margin-bottom: 15px; } | |
| .progress-bar-container { | |
| width: 250px; height: 8px; background-color: #555; | |
| border-radius: 4px; overflow: hidden; margin: 0 auto; | |
| } | |
| #progress-bar { | |
| width: 0%; height: 100%; background-color: var(--primary-color); | |
| border-radius: 4px; transition: width 0.2s ease-in-out; | |
| } | |
| #progress-text { margin-top: 15px; font-size: 1em; font-family: monospace; } | |
| /* 缩放控制按钮 */ | |
| .zoom-controls { | |
| position: absolute; bottom: 20px; right: 20px; z-index: 10; | |
| display: flex; flex-direction: column; | |
| } | |
| .zoom-controls button { | |
| width: 40px; height: 40px; font-size: 18px; font-weight: bold; | |
| border: none; border-radius: 50%; background-color: rgba(0, 0, 0, 0.6); | |
| color: white; cursor: pointer; margin-top: 8px; transition: all 0.3s; | |
| display: flex; align-items: center; justify-content: center; | |
| } | |
| .zoom-controls button:hover { background-color: rgba(0, 0, 0, 0.8); transform: scale(1.1); } | |
| /* 特征点弹窗 */ | |
| #feature-popup { | |
| position: absolute; top: 20px; left: 20px; background: rgba(0,0,0,0.85); | |
| color: white; padding: 20px; border-radius: 8px; max-width: 300px; | |
| z-index: 100; border: 1px solid rgba(255,255,255,0.2); | |
| font-size: 14px; line-height: 1.5; transition: all 0.3s; | |
| transform: scale(0.95); opacity: 1; | |
| } | |
| #feature-popup.hidden { opacity: 0; pointer-events: none; transform: scale(0.9); } | |
| #feature-popup-content strong { color: #ffcc00; display: block; margin-bottom: 8px; } | |
| #feature-popup-close { | |
| display: block; width: 100%; margin-top: 15px; padding: 8px 12px; | |
| cursor: pointer; border: none; background: #555; | |
| color: white; border-radius: 5px; transition: background-color 0.3s; | |
| } | |
| #feature-popup-close:hover { background: #666; } | |
| /* --- AI 导师面板专属样式 --- */ | |
| #ai-teacher-panel { | |
| width: 380px; | |
| background-color: var(--ai-bg); | |
| box-shadow: -2px 0 5px rgba(0,0,0,0.1); | |
| flex-shrink: 0; | |
| display: flex; | |
| flex-direction: column; | |
| overflow: hidden; | |
| } | |
| .chat-header { | |
| padding: 15px 20px; | |
| background-color: var(--panel-bg); | |
| border-bottom: 1px solid var(--border-color); | |
| flex-shrink: 0; | |
| } | |
| .chat-header h3 { margin: 0; font-size: 1.1em; color: var(--text-color); text-align: center; } | |
| .chat-log { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; } | |
| .chat-message { display: flex; align-items: flex-end; gap: 10px; max-width: 90%; } | |
| .avatar { | |
| width: 36px; height: 36px; border-radius: 50%; background-color: #ccc; | |
| flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; | |
| } | |
| .message-bubble { padding: 12px 16px; border-radius: 18px; line-height: 1.5; font-size: 14px; word-wrap: break-word; } | |
| .ai-message { align-self: flex-start; } | |
| .ai-message .avatar { background-color: var(--primary-color); color: white; } | |
| .ai-message .message-bubble { background-color: var(--panel-bg); color: var(--text-color); border-top-left-radius: 4px; } | |
| .user-message { align-self: flex-end; flex-direction: row-reverse; } | |
| .user-message .avatar { background-color: #78c578; color: white; } | |
| .user-message .message-bubble { background-color: var(--user-msg-bg); color: white; border-top-right-radius: 4px; } | |
| .chat-input-area { padding: 15px; background-color: var(--panel-bg); border-top: 1px solid var(--border-color); flex-shrink: 0; } | |
| .input-wrapper { display: flex; align-items: center; border: 1px solid var(--border-color); border-radius: 25px; padding: 5px 5px 5px 15px; } | |
| #user-input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; } | |
| #send-btn { | |
| width: 36px; height: 36px; border-radius: 50%; border: none; | |
| background-color: var(--primary-color); color: white; font-size: 18px; cursor: pointer; | |
| transition: background-color 0.3s; | |
| } | |
| #send-btn:hover { background-color: #3a7ac2; } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="top-bar"> | |
| <h1>中药饮片AI三维鉴别实训系统</h1> | |
| <div class="mode-switcher"> | |
| <a href="index.html">返回首页</a> | |
| <a href="training.html">三维沉浸式学习</a> | |
| <button class="active">AI导师教学</button> | |
| <a href="#">AI主考测验</a> | |
| </div> | |
| </div> | |
| <div class="main-content"> | |
| <div id="sidebar"> | |
| <h2>饮片目录</h2> | |
| <ul id="herb-list"></ul> | |
| </div> | |
| <div id="viewer-container"> | |
| <canvas id="c"></canvas> | |
| <!-- 以下是与 training.html 相同的元素,确保它们存在 --> | |
| <div id="loading-overlay"> | |
| <div class="loading-box"> | |
| <div class="loading-title">正在加载模型...</div> | |
| <div class="progress-bar-container"> | |
| <div id="progress-bar"></div> | |
| </div> | |
| <div id="progress-text">0%</div> | |
| </div> | |
| </div> | |
| <div class="zoom-controls"> | |
| <button id="zoom-in-btn">+</button> | |
| <button id="zoom-out-btn">-</button> | |
| </div> | |
| <div id="feature-popup" class="hidden"> | |
| <div id="feature-popup-content"></div> | |
| <button id="feature-popup-close">关闭</button> | |
| </div> | |
| </div> | |
| <div id="ai-teacher-panel"> | |
| <div class="chat-header"> | |
| <h3>AI 智能导师</h3> | |
| </div> | |
| <div class="chat-log" id="chat-log"> | |
| <!-- 聊天消息将动态插入这里 --> | |
| </div> | |
| <div class="chat-input-area"> | |
| <div class="input-wrapper"> | |
| <input type="text" id="user-input" placeholder="输入您的问题..."> | |
| <button id="send-btn" title="发送"> | |
| <i class="fas fa-paper-plane"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <script type="importmap"> | |
| { | |
| "imports": { | |
| "three": "https://unpkg.com/three@0.160.0/build/three.module.js", | |
| "three/addons/": "https://unpkg.com/three@0.160.0/examples/jsm/" | |
| } | |
| } | |
| </script> | |
| <script type="module" src="ai3dchat.js"></script> | |
| </body> | |
| </html> |