-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
54 lines (52 loc) · 1.48 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
/* 基本样式 */
.ai-helper {
position: fixed;
bottom: 10px;
right: 10px;
cursor: pointer;
}
.chat-box {
display: none;
position: fixed;
bottom: 50px;
right: 10px;
width: 300px;
height: 400px;
background: white;
border: 1px solid #ccc;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
</style>
<title>AI Helper</title>
</head>
<body>
<div class="ai-helper">
<img src="robot.jpeg" alt="AI Helper" id="aiHelper" class="robot-image">
</div>
<div class="chat-box" id="chatBox">
<iframe src="chat.html" style="width:100%; height:100%; border:none;"></iframe>
</div>
<script>
document.getElementById('aiHelper').addEventListener('click', function() {
const chatBox = document.getElementById('chatBox');
if (chatBox.style.display === 'none' || chatBox.style.display === '') {
chatBox.style.display = 'block';
} else {
chatBox.style.display = 'none';
}
});
</script>
</body>
</html>
<style>
.robot-image {
width: 100px; /* 设置宽度 */
height: auto; /* 高度自动调整,保持图片的原始宽高比 */
}
</style>