chatai/web/home.html

151 lines
4.2 KiB
HTML
Raw Normal View History

2025-01-11 04:31:04 +00:00
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp">
<meta name="google" content="notranslate">
<link rel="icon" type="image/png" href="/assets/logo.png">
<title>选择一个 AI Agent 开始聊天</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-family: -apple-system, 'Helvetica Neue', Helvetica, 'Nimbus Sans L', Arial, 'Liberation Sans',
'PingFang SC', 'Hiragino Sans GB', 'Source Han Sans CN', 'Source Han Sans SC', 'Microsoft YaHei', 'Wenquanyi Micro Hei', 'WenQuanYi Zen Hei',
'ST Heiti', SimHei, 'WenQuanYi Zen Hei Sharp', sans-serif;
background-color: #f0f0f0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100vh;
}
h1 {
margin: 0;
margin-bottom: 3rem;
font-size: 1.8rem;
color: #3c3c3c;
text-align: center;
font-weight: 400;
}
main {
width: 100%;
height: 40%;
min-height: 400px;
flex-wrap: nowrap;
padding: 0 2rem;
}
main .container {
height: 100%;
padding: 1rem;
display: flex;
flex-wrap: nowrap;
overflow-x: auto;
gap: 2.5rem;
justify-content: space-evenly;
align-items: center;
-ms-overflow-style: none;
scrollbar-width: none;
}
main .container::-webkit-scrollbar {
display: none;
}
section {
height: 100%;
background: #fcfcfc;
min-width: 300px;
max-width: 300px;
padding: 1rem;
border-radius: 1rem;
box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
text-align: center;
}
section img {
margin-top: 2rem;
margin-bottom: 1.5rem;
width: 3.5rem;
height: 3.5rem;
border-radius: .5rem;
}
section h2 {
margin: 0;
font-size: 1.5rem;
font-weight: 400;
margin-bottom: 1.5rem;
}
section span {
font-size: 0.8rem;
color: #666;
margin-bottom: 1.5rem;
}
section a {
display: block;
width: 100%;
padding: 0.5rem 1rem;
border-radius: 0.5rem;
text-decoration: none;
transition: all 0.3s;
justify-self: flex-end;
cursor: pointer;
margin-bottom: .5rem;
transition: all 0.3s ease;
}
{{range .}}
.chat-btn__{{.AgentID}} {
background: {{.PrimaryColor}};
color: white;
}
.chat-btn__{{.AgentID}}:hover {
background: {{.SecondaryColor}};
}
{{end}}
</style>
</head>
<body>
<h1>选择一个 AI Agent 开始聊天</h1>
<main>
<div class="container">
{{range .}}
<section>
<div>
<img src="/{{.AgentID}}/avatar.webp" alt="{{.AgentName}} 头像">
<h2>{{.AgentName}}</h2>
<span>{{.AgentDescription}}</span>
</div>
<a href="/{{.AgentID}}" class="chat-btn__{{.AgentID}}">开始聊天</a>
</section>
{{end}}
</div>
</main>
<script>
window.addEventListener("wheel", function (e) {
const container = document.querySelector(".container");
if (e.deltaY > 0) container.scrollLeft += 100;
else container.scrollLeft -= 100;
});
</script>
</body>
</html>