Skip to content

Commit 56e0925

Browse files
committed
Revert "fix: chat style; login check; asset auto connect"
This reverts commit f791b11.
1 parent b277d6a commit 56e0925

11 files changed

Lines changed: 10116 additions & 14763 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ luna.tar.gz
4747
luna/
4848
package-lock.json
4949
.angular
50-
.yarn
5150

5251
# generated at build time by scripts/generate-build-info.mjs
5352
/src/environments/build-info.ts

.yarnrc.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,18 @@
1-
<div class="chat-overlay-root">
2-
<div #launcher [hidden]="chatAIShown" [ngStyle]="launcherStyle" class="chat-launcher">
3-
<button
4-
(keydown)="onLauncherKeydown($event)"
5-
(lostpointercapture)="onLauncherLostPointerCapture($event)"
6-
(pointerdown)="onLauncherPointerDown($event)"
7-
[class.dragging]="isDragging"
8-
aria-label="移动浮动工具栏"
9-
class="chat-drag-handle"
10-
type="button"
11-
>
12-
<nz-icon nzTheme="outline" nzType="holder" />
13-
</button>
1+
<div id="chatContainer" class="chat-container">
2+
<nz-float-button-group [hidden]="chatAIShown">
3+
@if(isShowSetting && subViews.length === 1) {
4+
<nz-float-button (click)="handleShowDrawer()" [nzIcon]="setting"></nz-float-button>
5+
}
6+
<nz-float-button (click)="showChatAI()" [hidden]="!chatAiApiEnabled" [nzIcon]="customer"> </nz-float-button>
7+
</nz-float-button-group>
8+
<ng-template #setting>
9+
<nz-icon nzTheme="outline" nzType="setting" />
10+
</ng-template>
11+
<ng-template #customer>
12+
<img alt="" class="chat-img" src="assets/icons/chat-ai.png" />
13+
</ng-template>
1414

15-
<div class="chat-action-group">
16-
@if (isShowSetting && subViews.length === 1) {
17-
<button
18-
(click)="handleShowDrawer()"
19-
aria-label="打开设置"
20-
class="chat-action-button"
21-
type="button"
22-
>
23-
<nz-icon nzTheme="outline" nzType="setting" />
24-
</button>
25-
}
26-
<button
27-
(click)="showChatAI()"
28-
[hidden]="!chatAiApiEnabled"
29-
aria-label="打开智能问答"
30-
class="chat-action-button"
31-
type="button"
32-
>
33-
<img alt="" class="chat-img" src="assets/icons/chat-ai.png" />
34-
</button>
35-
</div>
36-
</div>
37-
38-
<div
39-
*ngIf="chatAiApiEnabled"
40-
[class.chat-panel-expanded]="chatPanelExpanded"
41-
[style.display]="chatAIShown ? 'block' : 'none'"
42-
class="chat-panel"
43-
>
15+
<div *ngIf="chatAiApiEnabled" [style.display]="chatAIShown ? 'block' : 'none'" class="drawer-panel">
4416
<div class="content">
4517
<iframe
4618
#contentWindow
@@ -53,3 +25,16 @@
5325
</div>
5426
</div>
5527
</div>
28+
29+
<!-- <div [hidden]="!showBtn || chatAIShown || !isShowSetting" id="dragBox"> -->
30+
<!-- <div -->
31+
<!-- (click)="onSettingOpenDrawer()" -->
32+
<!-- [hidden]="!isShowSetting || subViews.length > 1" -->
33+
<!-- class="drag-setting" -->
34+
<!-- > -->
35+
<!-- <i class="fa fa-cog"></i> -->
36+
<!-- </div> -->
37+
<!-- <div (click)="showChatAI()" [hidden]="!chatAiEnabled" class="robot-button"> -->
38+
<!-- <img alt="" class="chat-img" src="assets/icons/chat-ai.png"/> -->
39+
<!-- </div> -->
40+
<!-- </div> -->
Lines changed: 86 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -1,147 +1,113 @@
1-
:host {
2-
pointer-events: none;
1+
nz-float-button-group,
2+
nz-float-button {
3+
position: absolute;
4+
right: 1px;
5+
top: 0;
36
}
47

5-
.chat-overlay-root {
8+
.chat-container {
69
position: fixed;
7-
inset: 0;
10+
bottom: 200px;
11+
right: 9px;
812
z-index: 99999;
9-
pointer-events: none;
10-
}
11-
12-
.chat-launcher {
13-
position: absolute;
14-
display: flex;
15-
flex-direction: column;
16-
align-items: center;
17-
gap: 2px;
18-
width: 40px;
19-
padding: 4px;
20-
border-radius: 20px;
21-
color: rgba(255, 255, 255, 0.5);
22-
background: rgba(255, 255, 255, 0.05);
23-
box-shadow: none;
24-
pointer-events: auto;
13+
cursor: move;
2514
user-select: none;
26-
z-index: 1;
27-
}
28-
29-
.chat-drag-handle,
30-
.chat-action-button {
15+
overflow: visible;
16+
padding: 10px 0;
3117
display: flex;
32-
align-items: center;
33-
justify-content: center;
34-
width: 32px;
35-
height: 28px;
36-
padding: 0;
37-
border: 0;
38-
border-radius: 12.5px;
39-
color: rgba(255, 255, 255, 0.5);
40-
background: transparent;
41-
cursor: pointer;
42-
transition:
43-
color 0.16s ease,
44-
background 0.16s ease;
45-
46-
&:hover,
47-
&:focus-visible {
48-
color: #fff;
49-
background: rgba(255, 255, 255, 0.08);
50-
}
51-
}
52-
53-
.chat-drag-handle {
54-
cursor: grab;
55-
touch-action: none;
18+
flex-direction: column;
19+
align-items: flex-end;
5620

57-
&.dragging {
58-
cursor: grabbing;
21+
.content {
22+
height: 100%;
23+
iframe {
24+
border: none;
25+
}
5926
}
60-
}
61-
62-
.chat-action-group {
63-
display: flex;
64-
flex-direction: column;
65-
align-items: center;
66-
gap: 2px;
67-
width: 32px;
68-
}
6927

70-
.chat-action-button {
71-
.anticon {
72-
font-size: 16px;
28+
.drawer-panel {
29+
background-color: transparent;
30+
position: fixed;
31+
top: 0;
32+
right: 440px;
33+
width: 440px;
34+
min-width: 260px;
35+
height: 100vh;
36+
user-select: none;
37+
border-radius: 10px 0 0 10px;
38+
transition: transform 0.25s cubic-bezier(0.7, 0.3, 0.1, 1);
39+
box-shadow: 0 0 8px 4px #00000014;
40+
transform: translate(100%);
41+
z-index: 1000;
42+
opacity: 0.95;
7343
}
7444

75-
.chat-img {
76-
width: 16px;
77-
height: 16px;
78-
opacity: 0.5;
79-
transition: opacity 0.16s ease;
45+
.show {
46+
transition: all 0.3s cubic-bezier(0.7, 0.3, 0.1, 1);
8047
}
8148

82-
&:hover .chat-img,
83-
&:focus-visible .chat-img {
49+
.show .modal {
50+
position: fixed;
51+
top: 0;
52+
width: 100%;
53+
height: 100%;
54+
z-index: 100;
8455
opacity: 1;
8556
}
86-
}
87-
88-
.chat-panel {
89-
position: fixed;
90-
right: 12px;
91-
bottom: 12px;
92-
width: min(440px, calc(100vw - 24px));
93-
min-width: 260px;
94-
height: min(400px, calc(100dvh - 24px));
95-
overflow: hidden;
96-
border-radius: 10px;
97-
background: #fff;
98-
box-shadow: 0 0 8px 4px #00000014;
99-
pointer-events: auto;
100-
transition:
101-
width 0.25s cubic-bezier(0.7, 0.3, 0.1, 1),
102-
height 0.25s cubic-bezier(0.7, 0.3, 0.1, 1),
103-
border-radius 0.25s cubic-bezier(0.7, 0.3, 0.1, 1);
104-
z-index: 2;
10557

106-
&.chat-panel-expanded {
107-
top: 0;
108-
right: 0;
109-
bottom: auto;
110-
width: min(440px, 100vw);
111-
height: 100dvh;
112-
border-radius: 10px 0 0 10px;
58+
.show .drawer-panel {
59+
transform: translate(0);
11360
}
11461

115-
.content {
116-
width: 100%;
117-
height: 100%;
62+
::ng-deep {
63+
.ant-float-btn-group {
64+
position: absolute;
65+
padding: 10px 0;
66+
opacity: 1;
67+
}
11868

119-
iframe {
120-
display: block;
121-
width: 100%;
122-
height: 100%;
69+
.ant-float-btn-group-circle .ant-float-btn-circle:not(:last-child) {
70+
margin-bottom: 5px;
71+
}
72+
73+
.ant-float-btn-default,
74+
.ant-float-btn-default .ant-float-btn-body {
75+
position: relative;
76+
background: rgba(30, 30, 30, 0.85);
77+
border-radius: 999px;
78+
box-shadow: 0 6px 16px rgba(0,0,0,.30);
79+
transition: background .2s ease, box-shadow .2s ease;
12380
border: none;
12481
}
125-
}
126-
}
82+
.ant-float-btn-default:hover,
83+
.ant-float-btn-default:hover .ant-float-btn-body {
84+
background: rgba(20, 20, 20, 0.92);
85+
box-shadow: 0 8px 22px rgba(0,0,0,.36);
86+
}
12787

128-
::ng-deep {
129-
.chat-drag-handle .anticon {
130-
font-size: 16px;
131-
}
132-
}
88+
.ant-float-btn-default .ant-float-btn-body::before,
89+
.ant-float-btn-default::before {
90+
content: "";
91+
position: absolute;
92+
inset: 0;
93+
border-radius: 999px;
94+
pointer-events: none;
95+
box-shadow:
96+
inset 0 0 0 1px rgba(255,255,255,.65),
97+
0 0 0 1px rgba(0,0,0,.75);
98+
}
13399

134-
@media (max-width: 480px) {
135-
.chat-panel {
136-
right: 6px;
137-
bottom: 6px;
138-
width: calc(100vw - 12px);
139-
height: min(400px, calc(100dvh - 12px));
100+
.ant-btn .anticon,
101+
.ant-float-btn .anticon {
102+
color: #fff;
103+
filter: drop-shadow(0 1px 1px rgba(0,0,0,.75));
104+
}
140105

141-
&.chat-panel-expanded {
142-
right: 0;
143-
width: 100vw;
144-
border-radius: 0;
106+
img.chat-img {
107+
width: 18px;
108+
height: 18px;
109+
opacity: .95;
110+
filter: drop-shadow(0 1px 1px rgba(0,0,0,.75));
145111
}
146112
}
147113
}

0 commit comments

Comments
 (0)