File tree 2 files changed +101
-0
lines changed
2 files changed +101
-0
lines changed Original file line number Diff line number Diff line change 5
5
<router-view class =" body" />
6
6
<QrCode ></QrCode >
7
7
<Footer />
8
+ <AiChatbot />
8
9
</div >
9
10
</template >
10
11
11
12
<script >
12
13
import Header from " ./views/Header.vue" ;
13
14
import Footer from " ./views/Footer.vue" ;
14
15
import QrCode from " ./views/QrCode.vue" ;
16
+ import AiChatbot from " ./components/AiChatbot.vue" ;
15
17
16
18
export default {
17
19
name: " App" ,
@@ -20,6 +22,7 @@ export default {
20
22
Header,
21
23
Footer,
22
24
QrCode,
25
+ AiChatbot,
23
26
},
24
27
};
25
28
</script >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div class =" ai-chatbot" >
3
+ <div class =" chatbot-icon" @click =" toggleChat" >
4
+ <img src =" https://www.svgrepo.com/show/306500/robot.svg" alt =" AI" />
5
+ </div >
6
+ <div class =" chatbot-dialog" v-show =" isOpen" >
7
+ <div class =" dialog-header" >
8
+ <span >AI</span >
9
+ <span class =" close-btn" @click =" toggleChat" >×</span >
10
+ </div >
11
+ <iframe
12
+ src =" http://localhost/chatbot/88n14yNFATs9MNtT"
13
+ frameborder =" 0"
14
+ allow =" microphone"
15
+ ></iframe >
16
+ </div >
17
+ </div >
18
+ </template >
19
+
20
+ <script setup>
21
+ import { ref } from ' vue' ;
22
+
23
+ const isOpen = ref (false );
24
+
25
+ const toggleChat = () => {
26
+ isOpen .value = ! isOpen .value ;
27
+ };
28
+ </script >
29
+
30
+ <style scoped>
31
+ .ai-chatbot {
32
+ position : fixed ;
33
+ right : 20px ;
34
+ bottom : 20px ;
35
+ z-index : 1000 ;
36
+ }
37
+
38
+ .chatbot-icon {
39
+ width : 60px ;
40
+ height : 60px ;
41
+ background : #32ca99 ;
42
+ border-radius : 50% ;
43
+ cursor : pointer ;
44
+ display : flex ;
45
+ align-items : center ;
46
+ justify-content : center ;
47
+ box-shadow : 0 2px 12px rgba (0 , 0 , 0 , 0.1 );
48
+ transition : transform 0.3s ease ;
49
+ }
50
+
51
+ .chatbot-icon :hover {
52
+ transform : scale (1.1 );
53
+ }
54
+
55
+ .chatbot-icon img {
56
+ width : 32px ;
57
+ height : 32px ;
58
+ filter : brightness (0 ) invert (1 );
59
+ }
60
+
61
+ .chatbot-dialog {
62
+ position : fixed ;
63
+ right : 20px ;
64
+ bottom : 100px ;
65
+ width : 380px ;
66
+ height : 600px ;
67
+ background : #fff ;
68
+ border-radius : 12px ;
69
+ box-shadow : 0 4px 12px rgba (0 , 0 , 0 , 0.15 );
70
+ overflow : hidden ;
71
+ }
72
+
73
+ .dialog-header {
74
+ display : flex ;
75
+ justify-content : space-between ;
76
+ align-items : center ;
77
+ padding : 12px 16px ;
78
+ background : #32ca99 ;
79
+ color : #fff ;
80
+ font-size : 16px ;
81
+ }
82
+
83
+ .close-btn {
84
+ cursor : pointer ;
85
+ font-size : 24px ;
86
+ line-height : 1 ;
87
+ }
88
+
89
+ .close-btn :hover {
90
+ opacity : 0.8 ;
91
+ }
92
+
93
+ iframe {
94
+ width : 100% ;
95
+ height : calc (100% - 44px );
96
+ border : none ;
97
+ }
98
+ </style >
You can’t perform that action at this time.
0 commit comments