three+gemini api实现三维可爱交互ai机器人语音对话小助理代码
代码语言:html
所属分类:三维
代码描述:three+gemini api实现三维可爱交互ai机器人语音对话小助理代码,他能听到你说话,并说话回复你的问题,会开口眨眼睛,三维卡通可爱机器人小助理,眼睛跟随鼠标移动,时刻在关注你。
代码标签: three gemini api 可爱 三维 交互 机器人 语音 对话 小助理 代码
下面为部分代码预览,完整代码请点击下载或在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>Gemini 3D 呆萌黄色机器人</title>
<style>
body { margin: 0; overflow: hidden; background-color: #FFF8E1; font-family: 'Segoe UI', sans-serif; }
#canvas-container { width: 100%; height: 100vh; display: block; }
/* 悬浮控制面板 */
#ui-panel {
position: absolute;
bottom: 30px;
left: 50%;
transform: translateX(-50%);
width: 90%;
max-width: 400px;
background: rgba(255, 255, 255, 0.9);
backdrop-filter: blur(12px);
padding: 20px;
border-radius: 24px;
box-shadow: 0 8px 32px rgba(255, 160, 0, 0.15);
border: 1px solid rgba(255, 255, 255, 0.5);
display: flex;
flex-direction: column;
gap: 10px;
transition: all 0.3s ease;
}
/* 标题与状态 */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
h1 { margin: 0; font-size: 16px; color: #F57C00; display: flex; align-items: center; gap: 5px; }
.status-badge { font-size: 12px; padding: 4px 8px; border-radius: 12px; background: #eee; color: #666; font-weight: bold; }
.status-talking { background: #E6FFFA; color: #00A3BF; }
.status-listening { background: #FFF7E6; color: #FA8C16; }
/* 输入框与按钮 */
input[type="password"] {
width: 100%; padding: 10px; border: 1px solid #FFD8A8; border-radius: 12px;
background: #FFFBF0; outline: none; box-sizing: border-box; font-size: 14px;
}
input:focus { border-color: #FA8C16; background: #fff; }
.btn-group { display: flex; gap: 10px; }
button {
flex: 1; padding: 12px; border: none; border-radius: 12px; cursor: pointer;
font-weight: 600; font-size: 14px; transition: transform 0.1s;
}
#call-btn { background: linear-gradient(135deg, #FFBB33 0%, #FF9F00 100%); color: white; box-shadow: 0 4px 12px rgba(255, 159, 0, 0.3); }
#voice-select { flex: 1; padding: 10px; border-radius: 12px; border: 1px solid #eee; background: white; outline: none; }
button:active { transform: scale(0.96); }
/* 聊天气泡区 */
#bubble-area {
position: absolute;
top: 20%;
left: 50%;
transform: translateX(-50%);
width: 300px;
pointer-events: none;
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
}
.bubble {
background: white; padding: 10px 15px; border-radius: 15px;
box-shadow: 0 4px 15px rgba(0,0,0,0.05);
max-width: 100%; opacity: 0; transform: translateY(20px);
animation: popIn 0.4s forwards; font-size: 13px; line-height: 1.4;
color: #444; text-align: center;
}
.bubble.user { background: #E6F7FF; color: #0050B3; border-bottom-right-radius: 2px; align-self: flex-end; margin-right: -40px; }
.bubble.ai { background: #FFF7E6; color: #873800; border-bottom-left-radius: 2px; align-self: flex-start; margin-left: -40px; font-weight: bold;}
@keyframes popIn { to { opacity: 1; transform: trans.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0