js+css实现ai智能聊天窗口对话效果代码
代码语言:html
所属分类:其他
代码描述:js+css实现ai智能聊天窗口对话效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.6.4.0.css">
<style>
:root {
--primary-color: #6c5ce7;
--primary-light: #a29bfe;
--primary-dark: #5649c0;
--ai-bubble: #f1f3ff;
--user-bubble: #6c5ce7;
--text-dark: #2d3436;
--text-light: #636e72;
--bg-color: #f9f9ff;
--card-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
--border-radius: 16px;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Noto Sans SC', sans-serif;
background-color: var(--bg-color);
color: var(--text-dark);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.chat-app {
width: 100%;
max-width: 420px;
height: 90vh;
max-height: 800px;
background: white;
border-radius: var(--border-radius);
box-shadow: var(--card-shadow);
display: flex;
flex-direction: column;
overflow: hidden;
position: relative;
}
.chat-header {
background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
color: white;
padding: 18px 20px;
display: flex;
align-items: center;
gap: 12px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
z-index: 10;
}
.avatar {
width: 36px;
height: 36px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.2);
display: flex;
align-items: center;
justify-content: center;
}
.header-info {
flex: 1;
}
.header-info h2 {
font-size: 16px;
font-weight: 700;
margin-bottom: 2px;
}
.header-info p {
font-size: 12px;
opacity: 0.8;
}
.status-dot {
width: 8px;
height: 8px;
background: #00b894;
border-radius: 50%;
margin-left: auto;
position: relative;
}
.status-dot::after {
content: '';
position: absolute;
width:.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0