-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
176 lines (152 loc) · 4.52 KB
/
index.html
File metadata and controls
176 lines (152 loc) · 4.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Agent 信誉评分器</title>
<style>
:root {
--primary: #6366f1;
--bg: #0f172a;
--card: #1e293b;
--text: #f8fafc;
}
body {
font-family: 'Inter', system-ui, sans-serif;
background-color: var(--bg);
color: var(--text);
margin: 0;
padding: 20px;
display: flex;
justify-content: center;
}
.container {
width: 100%;
max-width: 600px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
}
h1 {
margin: 0;
font-size: 1.5rem;
}
.btn {
background: var(--primary);
color: white;
border: none;
padding: 10px 20px;
border-radius: 8px;
cursor: pointer;
font-weight: 600;
}
.btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.card {
background: var(--card);
padding: 24px;
border-radius: 12px;
margin-bottom: 20px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.form-group {
margin-bottom: 16px;
}
label {
display: block;
margin-bottom: 8px;
font-size: 0.9rem;
color: #94a3b8;
}
input,
textarea {
width: 100%;
background: #334155;
border: 1px solid #475569;
color: white;
padding: 12px;
border-radius: 8px;
box-sizing: border-box;
font-family: inherit;
}
.stars {
display: flex;
gap: 8px;
cursor: pointer;
}
.star {
font-size: 24px;
color: #475569;
transition: color 0.2s;
}
.star.active {
color: #fbbf24;
}
.review-item {
border-bottom: 1px solid #334155;
padding: 16px 0;
}
.review-header {
display: flex;
justify-content: space-between;
margin-bottom: 8px;
font-size: 0.85rem;
color: #94a3b8;
}
.review-score {
color: #fbbf24;
font-weight: bold;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>🤖 AI Agent 评分器</h1>
<button id="connectBtn" class="btn">连接钱包</button>
</div>
<!-- 打分区域 -->
<div class="card">
<h3>📝 提交评价</h3>
<div class="form-group">
<label>Agent ID (数字)</label>
<input type="number" id="agentIdInput" placeholder="例如: 1">
</div>
<div class="form-group">
<label>评分</label>
<div class="stars" id="starContainer">
<span class="star" data-value="1">★</span>
<span class="star" data-value="2">★</span>
<span class="star" data-value="3">★</span>
<span class="star" data-value="4">★</span>
<span class="star" data-value="5">★</span>
</div>
</div>
<div class="form-group">
<label>评论内容</label>
<textarea id="commentInput" rows="3" placeholder="这个 Agent 表现如何?"></textarea>
</div>
<button id="submitBtn" class="btn" disabled>提交评价</button>
</div>
<!-- 查询区域 -->
<div class="card">
<h3>🔍 查看历史评价</h3>
<div class="form-group">
<input type="number" id="queryIdInput" placeholder="输入 Agent ID 查询">
</div>
<button id="queryBtn" class="btn">查询</button>
<div id="reviewsList">
<!-- 评价列表会在这里显示 -->
</div>
</div>
</div>
<!-- 引入 Ethers.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/ethers/5.7.2/ethers.umd.min.js"></script>
<script src="app.js"></script>
</body>
</html>