js+css实现ai多agent可视化运行展示代码
代码语言:html
所属分类:布局界面
代码描述:js+css实现ai多agent可视化运行展示代码,鼠标悬浮单个agent可看到工作内容及进度。
代码标签: js css ai agent 可视化 运行 展示 代码
下面为部分代码预览,完整代码请点击下载或在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>AI 牛牛智能体数字孪生空间</title>
<style>
:root {
--bg-color: #f3f4f6;
--card-bg: #ffffff;
--text-main: #1f2937;
--text-muted: #4b5563;
--border-color: #e5e7eb;
/* Agent 各自的主题色 */
--color-devops: #10b981; /* 绿色 */
--color-analyst: #f43f5e; /* 红色 */
--color-writer: #a855f7; /* 紫色 */
--color-sleeper: #3b82f6; /* 蓝色 */
--color-tester: #f59e0b; /* 黄色 */
--color-researcher: #06b6d4;/* 青色 */
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background-color: var(--bg-color);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
color: var(--text-main);
padding: 40px 20px;
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
}
/* 顶部导航与仪表盘 */
header {
text-align: center;
margin-bottom: 30px;
width: 100%;
max-width: 1200px;
}
header h1 {
font-size: 2rem;
font-weight: 800;
color: #111827;
margin-bottom: 8px;
}
header p {
color: var(--text-muted);
font-size: 1rem;
}
/* 顶部全局监控面板 */
.dashboard-summary {
display: flex;
justify-content: space-around;
background: #fff;
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 15px 25px;
margin-bottom: 30px;
width: 100%;
max-width: 1200px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.summary-item {
text-align: center;
}
.summary-item .label {
font-size: 0.85rem;
color: var(--text-muted);
margin-bottom: 4px;
}
.summary-item .value {
font-size: 1.25rem;
font-weight: 700;
color: #111827;
}
/* 工位网格系统 */
.workspace-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 30px;
width: 100%;
max-width: 1200px;
}
@media (max-width: 1024px) {
.workspace-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 768px) {
.workspace-grid {
grid-template-columns: 1fr;
}
}
/* 单个工位卡片 */
.agent-card {
position: relative;
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 20px;
height: 380px;
overflow: hidden;
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
cursor: pointer;
}
.agent-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
border-color: var(--theme-color);
}
/* 办公环境层叠结构 */
.workstation-view {
position: relative;
width: 100%;
height: 100%;
background: radial-gradient(circle at center, #ffffff 0%, #f9fafb 100%);
overflow: hidden;
}
/* 1. 电脑桌子 */
.desk-surface {
position: absolute;
bottom: 70px;
left: 50%;
transform: translateX(-50%);
width: 280px;
height: 10px;
background: #ffffff;
border-radius: 4px;
box-shadow: 0 4px 10px rgba(0,0,0,0.06);
border-bottom: 2px solid #eaeaea;
z-index: 10;
}
.desk-leg-l, .desk-leg-r {
position: absolute;
bottom: 0;
width: 6px;
height: 70px;
background: #e5e7eb;
z-index: 5;
}
.desk-leg-l { left: 55px; }
.desk-leg-r { right: 110px; }
.desk-cabinet {
position: absolute;
bottom: 0;
right: 45px;
width: 55px;
height: 65px;
background: #fcfcfc;
border: 1px solid #e5e7eb;
border-radius: 4px;
z-index: 6;
}
/* 2. 键盘与鼠标 */
.keyboard {
position: absolute;
bottom: 82px;
left: 50%;
transform: translateX(-50%);
width: 70px;
height: 4px;
background: #d1d5db;
border-radius: 1px;
z-index: 11;
}
/* 拟人化牛蹄打字动画(分层在最前面,覆盖在键盘上方) */
.typing-hands {
position: absolute;
bottom: 78px;
left: 50%;
transform: translateX(-50%);
width: 80px;
height: 35px;
z-index: 16; /* 在椅子(15)和键盘(11)前方 */
pointer-events: none;
}
.hoof-l, .hoof-r {
fill: #111827;
transform-origin: bottom center;
}
/* 为各个工位设置不同步的打字节奏,让动画更逼真 */
.hoof-l { animation: type-l 0.18s infinite alternate ease-in-out; }
.hoof-r { animation: type-r 0.22s infinite alternate ease-in-out; }
#agent-1 .hoof-l { animation-delay: 0.05s; }
#agent-1 .hoof-r { animation-delay: 0.15s; }
#agent-2 .hoof-l { animation-delay: 0.1s; }
#agent-2 .hoof-r { animation-delay: 0.02s; }
#agent-3 .hoof-l { animation-delay: 0s; }
#agent-3 .hoof-r { animation-delay: 0.12s; }
#agent-5 .hoof-l { animation-delay: 0.08s; }
#agent-5 .hoof-r { animation-delay: 0.04s; }
#agent-6 .hoof-l { animation-delay: 0.14s; }
#agent-6 .hoof-r { animation-delay: 0.07s; }
@keyframes type-l {
0% { transform: translateY(0) scaleY(1); }
100% { transform: translateY(-3px) scaleY(1.05); }
}
@keyframes type-r {
0% { transform: translateY(-2px) scaleY(1.03); }
100% { transform: translateY(1px) scaleY(0.97); }
}
/* 3. 显示器 */
.monitor-group {
position: absolute;
bottom: 145px;
left: 50%;
transfo.........完整代码请登录后点击上方下载按钮下载查看















网友评论0