File tree Expand file tree Collapse file tree 2 files changed +26
-12
lines changed Expand file tree Collapse file tree 2 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -75,10 +75,10 @@ export default defineConfig({
75
75
} ) ,
76
76
vue ( ) ,
77
77
svgLoader ( ) ,
78
- vueDevTools ( {
79
- // use export LAUNCH_EDITOR=cursor instead
80
- // launchEditor: 'cursor'
81
- } )
78
+ // vueDevTools({
79
+ // // use export LAUNCH_EDITOR=cursor instead
80
+ // // launchEditor: 'cursor'
81
+ // })
82
82
] ,
83
83
build : {
84
84
minify : 'esbuild' ,
Original file line number Diff line number Diff line change 1
1
<template >
2
- <div class =" w-screen h-screen bg-transparent overflow-hidden select-none flex items-center justify-center" >
2
+ <div class =" w-screen h-screen bg-transparent overflow-hidden select-none flex items-center justify-center drag-region " >
3
3
<div
4
4
ref =" floatingButton"
5
- class =" w-15 h-15 rounded-full border-2 border-white/30 flex items-center justify-center cursor-pointer transition-all duration-300 relative overflow-hidden select-none floating-button"
5
+ class =" w-15 h-15 rounded-full border-2 border-white/30 flex items-center justify-center cursor-pointer transition-all duration-300 relative overflow-hidden select-none floating-button no-drag "
6
6
:class =" { 'floating-button-pulse': isPulsing }"
7
7
@click =" handleClick"
8
8
@mouseenter =" handleMouseEnter"
9
9
@mouseleave =" handleMouseLeave"
10
10
>
11
- <svg class =" w-6 h-6 fill-white z-1 relative" viewBox =" 0 0 24 24" >
12
- <path d =" M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z" />
13
- </svg >
14
- <div class =" absolute bottom-full left-1/2 transform -translate-x-1/2 bg-black/80 text-white px-3 py-2 rounded-md text-xs whitespace-nowrap opacity-0 invisible transition-all duration-300 pointer-events-none mb-2 tooltip" >
15
- 点击打开 DeepChat
16
- </div >
11
+ <img src =" @/assets/logo.png" alt =" Floating Button Icon" class =" w-10 h-10 pointer-events-none" />
17
12
</div >
18
13
</div >
19
14
</template >
@@ -83,9 +78,28 @@ onUnmounted(() => {
83
78
</script >
84
79
85
80
<style scoped>
81
+ /* 拖拽区域 */
82
+ .drag-region {
83
+ -webkit-app-region : drag;
84
+ }
85
+
86
+ /* 禁用拖拽的元素 */
87
+ .no-drag {
88
+ -webkit-app-region : no-drag;
89
+ }
90
+
91
+ /* 确保图片不会阻止点击事件 */
92
+ .pointer-events-none {
93
+ pointer-events : none ;
94
+ }
95
+
86
96
/* 悬浮按钮基础样式 */
87
97
.floating-button {
88
98
background : linear-gradient (135deg , #667eea 0% , #764ba2 100% );
99
+ /* 按钮本身不可拖拽,只响应点击 */
100
+ -webkit-app-region : no-drag;
101
+ /* 确保按钮可以接收鼠标事件 */
102
+ pointer-events : auto ;
89
103
}
90
104
91
105
/* 悬浮按钮悬停效果 */
You can’t perform that action at this time.
0 commit comments