lynx-console 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +615 -120
- package/dist/index.css +0 -397
- package/dist/index.css.map +1 -1
- package/dist/index.mjs +616 -121
- package/dist/index.mjs.map +1 -1
- package/dist/setup.cjs +0 -1
- package/dist/setup.d.cts +0 -1
- package/dist/setup.d.cts.map +1 -1
- package/dist/setup.d.mts +0 -1
- package/dist/setup.d.mts.map +1 -1
- package/dist/setup.mjs +0 -1
- package/dist/setup.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/BottomSheet.css +0 -7
- package/src/components/BottomSheet.tsx +24 -3
- package/src/components/ConsolePanel.css +0 -141
- package/src/components/FloatingButton.css +0 -8
- package/src/components/FloatingButton.tsx +15 -2
- package/src/components/LogPanel.tsx +214 -26
- package/src/components/NetworkDetailSection.tsx +71 -9
- package/src/components/NetworkPanel.css +0 -91
- package/src/components/NetworkPanel.tsx +168 -20
- package/src/components/PerformancePanel.css +0 -60
- package/src/components/PerformancePanel.tsx +157 -35
- package/src/components/Tabs.css +0 -9
- package/src/components/Tabs.tsx +21 -3
- package/src/index.tsx +29 -23
- package/src/styles/ThemeContext.ts +10 -0
- package/src/styles/theme.ts +111 -0
- package/src/styles/global.css +0 -8
- package/src/styles/vars/color.ts +0 -41
- package/src/styles/vars/dimension.ts +0 -10
- package/src/styles/vars/index.css +0 -71
- package/src/styles/vars/index.ts +0 -18
- package/src/styles/vars/radius.ts +0 -2
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
bottom: 0;
|
|
18
18
|
left: 0;
|
|
19
19
|
z-index: 9998;
|
|
20
|
-
background: var(--lynx-console-color-bg-overlay);
|
|
21
|
-
transition: opacity var(--lynx-console-duration-d6) cubic-bezier(0.4, 0, 0.2, 1);
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
.bs-content {
|
|
@@ -28,10 +26,8 @@
|
|
|
28
26
|
flex-direction: column;
|
|
29
27
|
box-sizing: border-box;
|
|
30
28
|
word-break: break-all;
|
|
31
|
-
background: var(--lynx-console-color-bg-layer-floating);
|
|
32
29
|
border-top-left-radius: 24px;
|
|
33
30
|
border-top-right-radius: 24px;
|
|
34
|
-
transition: transform var(--lynx-console-duration-d6) cubic-bezier(0.4, 0, 0.2, 1);
|
|
35
31
|
height: 500px;
|
|
36
32
|
overflow: hidden;
|
|
37
33
|
}
|
|
@@ -50,7 +46,6 @@
|
|
|
50
46
|
.bs-handle {
|
|
51
47
|
width: 36px;
|
|
52
48
|
height: 4px;
|
|
53
|
-
background-color: var(--lynx-console-color-palette-gray-400);
|
|
54
49
|
border-radius: 9999px;
|
|
55
50
|
margin-top: 12px;
|
|
56
51
|
}
|
|
@@ -69,8 +64,6 @@
|
|
|
69
64
|
.bs-title {
|
|
70
65
|
font-size: 1.25rem;
|
|
71
66
|
line-height: 1.6875rem;
|
|
72
|
-
font-weight: var(--lynx-console-font-weight-bold);
|
|
73
|
-
color: var(--lynx-console-color-fg-neutral);
|
|
74
67
|
}
|
|
75
68
|
|
|
76
69
|
.bs-body {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { type ReactNode, useEffect, useState } from "@lynx-js/react";
|
|
2
2
|
import type { BaseTouchEvent, Target } from "@lynx-js/types";
|
|
3
|
+
import { useThemeColors } from "../styles/ThemeContext";
|
|
4
|
+
import { duration, fontWeight } from "../styles/theme";
|
|
3
5
|
import "./BottomSheet.css";
|
|
4
6
|
|
|
5
7
|
interface BottomSheetProps {
|
|
@@ -29,6 +31,7 @@ export default function BottomSheet({
|
|
|
29
31
|
shouldClose = false,
|
|
30
32
|
safeAreaInsetBottom = "25px",
|
|
31
33
|
}: BottomSheetProps) {
|
|
34
|
+
const colors = useThemeColors();
|
|
32
35
|
const [sheetHeight, setSheetHeight] = useState(savedHeight ?? DEFAULT_HEIGHT);
|
|
33
36
|
const [tempHeight, setTempHeight] = useState(savedHeight ?? DEFAULT_HEIGHT);
|
|
34
37
|
const [isDragging, setIsDragging] = useState(false);
|
|
@@ -100,7 +103,9 @@ export default function BottomSheet({
|
|
|
100
103
|
<scroll-view
|
|
101
104
|
className="bs-backdrop"
|
|
102
105
|
style={{
|
|
106
|
+
background: colors.bg.overlay,
|
|
103
107
|
opacity: isOpening || isClosing ? 0 : 1,
|
|
108
|
+
transition: `opacity ${duration.d6} cubic-bezier(0.4, 0, 0.2, 1)`,
|
|
104
109
|
}}
|
|
105
110
|
>
|
|
106
111
|
<view className="bs-overlay" bindtap={handleClose}>
|
|
@@ -108,10 +113,13 @@ export default function BottomSheet({
|
|
|
108
113
|
className="bs-content"
|
|
109
114
|
catchtap={() => {}}
|
|
110
115
|
style={{
|
|
116
|
+
background: colors.bg.layerFloating,
|
|
111
117
|
height: `${isDragging ? tempHeight : sheetHeight}px`,
|
|
112
118
|
transform:
|
|
113
119
|
isOpening || isClosing ? "translateY(100%)" : "translateY(0)",
|
|
114
|
-
transition: isDragging
|
|
120
|
+
transition: isDragging
|
|
121
|
+
? "none"
|
|
122
|
+
: `transform ${duration.d6} cubic-bezier(0.4, 0, 0.2, 1)`,
|
|
115
123
|
}}
|
|
116
124
|
>
|
|
117
125
|
{/* catchtap: 이벤트 버블링 차단 */}
|
|
@@ -121,10 +129,23 @@ export default function BottomSheet({
|
|
|
121
129
|
bindtouchmove={handleTouchMove}
|
|
122
130
|
bindtouchend={handleTouchEnd}
|
|
123
131
|
>
|
|
124
|
-
<view
|
|
132
|
+
<view
|
|
133
|
+
className="bs-handle"
|
|
134
|
+
style={{ backgroundColor: colors.palette.gray400 }}
|
|
135
|
+
/>
|
|
125
136
|
</view>
|
|
126
137
|
<view className="bs-header">
|
|
127
|
-
{title &&
|
|
138
|
+
{title && (
|
|
139
|
+
<text
|
|
140
|
+
className="bs-title"
|
|
141
|
+
style={{
|
|
142
|
+
fontWeight: fontWeight.bold,
|
|
143
|
+
color: colors.fg.neutral,
|
|
144
|
+
}}
|
|
145
|
+
>
|
|
146
|
+
{title}
|
|
147
|
+
</text>
|
|
148
|
+
)}
|
|
128
149
|
</view>
|
|
129
150
|
<view
|
|
130
151
|
className="bs-body"
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
.cp-placeholderText {
|
|
15
15
|
font-size: 0.875rem;
|
|
16
16
|
line-height: 1.1875rem;
|
|
17
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
18
|
-
color: var(--lynx-console-color-fg-disabled);
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
.cp-logContainer {
|
|
@@ -42,15 +40,12 @@
|
|
|
42
40
|
flex-direction: row;
|
|
43
41
|
align-items: center;
|
|
44
42
|
padding: 3px 6px;
|
|
45
|
-
background-color: var(--lynx-console-color-bg-neutral-weak);
|
|
46
43
|
border-radius: 4px;
|
|
47
44
|
}
|
|
48
45
|
|
|
49
46
|
.cp-filterButtonText {
|
|
50
47
|
font-size: 0.8125rem;
|
|
51
48
|
line-height: 1.125rem;
|
|
52
|
-
font-weight: var(--lynx-console-font-weight-medium);
|
|
53
|
-
color: var(--lynx-console-color-fg-neutral-muted);
|
|
54
49
|
}
|
|
55
50
|
|
|
56
51
|
.cp-filterDropdown {
|
|
@@ -58,9 +53,7 @@
|
|
|
58
53
|
top: 100%;
|
|
59
54
|
left: 0;
|
|
60
55
|
margin-top: 4px;
|
|
61
|
-
background-color: var(--lynx-console-color-bg-layer-floating);
|
|
62
56
|
border-width: 1px;
|
|
63
|
-
border-color: var(--lynx-console-color-stroke-neutral-subtle);
|
|
64
57
|
border-style: solid;
|
|
65
58
|
border-radius: 8px;
|
|
66
59
|
padding: 4px 0;
|
|
@@ -79,46 +72,12 @@
|
|
|
79
72
|
.cp-filterCheckbox {
|
|
80
73
|
font-size: 0.8125rem;
|
|
81
74
|
line-height: 1.125rem;
|
|
82
|
-
font-weight: var(--lynx-console-font-weight-medium);
|
|
83
75
|
width: 16px;
|
|
84
76
|
}
|
|
85
77
|
|
|
86
|
-
.cp-filterCheckbox--log {
|
|
87
|
-
color: var(--lynx-console-color-palette-green-600);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
.cp-filterCheckbox--info {
|
|
91
|
-
color: var(--lynx-console-color-palette-blue-600);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.cp-filterCheckbox--warn {
|
|
95
|
-
color: var(--lynx-console-color-palette-yellow-600);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.cp-filterCheckbox--error {
|
|
99
|
-
color: var(--lynx-console-color-palette-red-600);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
78
|
.cp-filterLabel {
|
|
103
79
|
font-size: 0.8125rem;
|
|
104
80
|
line-height: 1.125rem;
|
|
105
|
-
font-weight: var(--lynx-console-font-weight-medium);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.cp-filterLabel--log {
|
|
109
|
-
color: var(--lynx-console-color-palette-green-600);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.cp-filterLabel--info {
|
|
113
|
-
color: var(--lynx-console-color-palette-blue-600);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
.cp-filterLabel--warn {
|
|
117
|
-
color: var(--lynx-console-color-palette-yellow-600);
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
.cp-filterLabel--error {
|
|
121
|
-
color: var(--lynx-console-color-palette-red-600);
|
|
122
81
|
}
|
|
123
82
|
|
|
124
83
|
.cp-searchWrapper {
|
|
@@ -129,7 +88,6 @@
|
|
|
129
88
|
margin-left: 8px;
|
|
130
89
|
margin-right: 8px;
|
|
131
90
|
border-bottom-width: 1px;
|
|
132
|
-
border-bottom-color: var(--lynx-console-color-stroke-neutral-subtle);
|
|
133
91
|
border-bottom-style: solid;
|
|
134
92
|
gap: 8px;
|
|
135
93
|
}
|
|
@@ -137,17 +95,12 @@
|
|
|
137
95
|
.cp-searchPrompt {
|
|
138
96
|
font-size: 1.125rem;
|
|
139
97
|
line-height: 1.5rem;
|
|
140
|
-
font-weight: var(--lynx-console-font-weight-medium);
|
|
141
|
-
color: var(--lynx-console-color-fg-placeholder);
|
|
142
98
|
}
|
|
143
99
|
|
|
144
100
|
.cp-searchInput {
|
|
145
101
|
flex: 1;
|
|
146
102
|
font-size: 0.8125rem;
|
|
147
103
|
line-height: 1.125rem;
|
|
148
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
149
|
-
color: var(--lynx-console-color-fg-neutral);
|
|
150
|
-
caret-color: var(--lynx-console-color-palette-green-600);
|
|
151
104
|
}
|
|
152
105
|
|
|
153
106
|
.cp-searchClear {
|
|
@@ -157,21 +110,16 @@
|
|
|
157
110
|
.cp-searchClearText {
|
|
158
111
|
font-size: 0.8125rem;
|
|
159
112
|
line-height: 1.125rem;
|
|
160
|
-
font-weight: var(--lynx-console-font-weight-medium);
|
|
161
|
-
color: var(--lynx-console-color-fg-placeholder);
|
|
162
113
|
}
|
|
163
114
|
|
|
164
115
|
.cp-clearButton {
|
|
165
116
|
padding: 3px 6px;
|
|
166
|
-
background-color: var(--lynx-console-color-bg-neutral-weak);
|
|
167
117
|
border-radius: 4px;
|
|
168
118
|
}
|
|
169
119
|
|
|
170
120
|
.cp-clearButtonText {
|
|
171
121
|
font-size: 0.8125rem;
|
|
172
122
|
line-height: 1.125rem;
|
|
173
|
-
font-weight: var(--lynx-console-font-weight-medium);
|
|
174
|
-
color: var(--lynx-console-color-fg-neutral-muted);
|
|
175
123
|
}
|
|
176
124
|
|
|
177
125
|
.cp-logList {
|
|
@@ -183,18 +131,9 @@
|
|
|
183
131
|
.cp-logItem {
|
|
184
132
|
padding: 8px;
|
|
185
133
|
border-bottom-width: 1px;
|
|
186
|
-
border-bottom-color: var(--lynx-console-color-stroke-neutral-weak);
|
|
187
134
|
border-bottom-style: solid;
|
|
188
135
|
}
|
|
189
136
|
|
|
190
|
-
.cp-logItem--warn {
|
|
191
|
-
background-color: var(--lynx-console-color-palette-yellow-100);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.cp-logItem--error {
|
|
195
|
-
background-color: var(--lynx-console-color-palette-red-100);
|
|
196
|
-
}
|
|
197
|
-
|
|
198
137
|
.cp-logItemHeader {
|
|
199
138
|
display: flex;
|
|
200
139
|
flex-direction: row;
|
|
@@ -205,38 +144,17 @@
|
|
|
205
144
|
.cp-logLevel {
|
|
206
145
|
font-size: 0.75rem;
|
|
207
146
|
line-height: 1rem;
|
|
208
|
-
font-weight: var(--lynx-console-font-weight-bold);
|
|
209
147
|
margin-right: 8px;
|
|
210
148
|
}
|
|
211
149
|
|
|
212
|
-
.cp-logLevel--log {
|
|
213
|
-
color: var(--lynx-console-color-palette-green-600);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
.cp-logLevel--info {
|
|
217
|
-
color: var(--lynx-console-color-palette-blue-600);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
.cp-logLevel--warn {
|
|
221
|
-
color: var(--lynx-console-color-palette-yellow-600);
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
.cp-logLevel--error {
|
|
225
|
-
color: var(--lynx-console-color-palette-red-600);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
150
|
.cp-logTime {
|
|
229
151
|
font-size: 0.75rem;
|
|
230
152
|
line-height: 1rem;
|
|
231
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
232
|
-
color: var(--lynx-console-color-fg-neutral-subtle);
|
|
233
153
|
}
|
|
234
154
|
|
|
235
155
|
.cp-toggleIndicator {
|
|
236
156
|
font-size: 0.75rem;
|
|
237
157
|
line-height: 1rem;
|
|
238
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
239
|
-
color: var(--lynx-console-color-fg-neutral-subtle);
|
|
240
158
|
margin-left: 4px;
|
|
241
159
|
align-self: flex-start;
|
|
242
160
|
}
|
|
@@ -244,8 +162,6 @@
|
|
|
244
162
|
.cp-logMessage {
|
|
245
163
|
font-size: 0.8125rem;
|
|
246
164
|
line-height: 1.125rem;
|
|
247
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
248
|
-
color: var(--lynx-console-color-fg-neutral);
|
|
249
165
|
word-break: break-all;
|
|
250
166
|
}
|
|
251
167
|
|
|
@@ -259,59 +175,16 @@
|
|
|
259
175
|
.cp-logArgItem {
|
|
260
176
|
font-size: 0.8125rem;
|
|
261
177
|
line-height: 1.125rem;
|
|
262
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.cp-argNull {
|
|
266
|
-
color: var(--lynx-console-color-fg-neutral-subtle);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
.cp-argUndefined {
|
|
270
|
-
color: var(--lynx-console-color-fg-neutral-subtle);
|
|
271
178
|
}
|
|
272
179
|
|
|
273
180
|
.cp-argString {
|
|
274
181
|
font-size: 0.8125rem;
|
|
275
182
|
line-height: 1.125rem;
|
|
276
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
.cp-argString--log {
|
|
280
|
-
color: var(--lynx-console-color-fg-neutral);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
.cp-argString--info {
|
|
284
|
-
color: var(--lynx-console-color-fg-neutral);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.cp-argString--warn {
|
|
288
|
-
color: var(--lynx-console-color-palette-yellow-900);
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.cp-argString--error {
|
|
292
|
-
color: var(--lynx-console-color-palette-red-900);
|
|
293
183
|
}
|
|
294
184
|
|
|
295
185
|
.cp-argPrimitive {
|
|
296
186
|
font-size: 0.8125rem;
|
|
297
187
|
line-height: 1.125rem;
|
|
298
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
.cp-argPrimitive--log {
|
|
302
|
-
color: var(--lynx-console-color-palette-blue-600);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
.cp-argPrimitive--info {
|
|
306
|
-
color: var(--lynx-console-color-palette-blue-600);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
.cp-argPrimitive--warn {
|
|
310
|
-
color: var(--lynx-console-color-palette-yellow-900);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
.cp-argPrimitive--error {
|
|
314
|
-
color: var(--lynx-console-color-palette-red-900);
|
|
315
188
|
}
|
|
316
189
|
|
|
317
190
|
.cp-argObject {
|
|
@@ -329,8 +202,6 @@
|
|
|
329
202
|
.cp-argObjectPreview {
|
|
330
203
|
font-size: 0.8125rem;
|
|
331
204
|
line-height: 1.125rem;
|
|
332
|
-
font-weight: var(--lynx-console-font-weight-medium);
|
|
333
|
-
color: var(--lynx-console-color-fg-neutral);
|
|
334
205
|
}
|
|
335
206
|
|
|
336
207
|
.cp-argObjectContent {
|
|
@@ -349,15 +220,11 @@
|
|
|
349
220
|
.cp-argObjectKey {
|
|
350
221
|
font-size: 0.8125rem;
|
|
351
222
|
line-height: 1.125rem;
|
|
352
|
-
font-weight: var(--lynx-console-font-weight-medium);
|
|
353
|
-
color: var(--lynx-console-color-palette-purple-600);
|
|
354
223
|
}
|
|
355
224
|
|
|
356
225
|
.cp-argObjectJson {
|
|
357
226
|
font-size: 0.8125rem;
|
|
358
227
|
line-height: 1.125rem;
|
|
359
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
360
|
-
color: var(--lynx-console-color-fg-neutral);
|
|
361
228
|
}
|
|
362
229
|
|
|
363
230
|
.cp-replInputRow {
|
|
@@ -372,8 +239,6 @@
|
|
|
372
239
|
.cp-replPrompt {
|
|
373
240
|
font-size: 1.625rem;
|
|
374
241
|
line-height: 2.1875rem;
|
|
375
|
-
font-weight: var(--lynx-console-font-weight-medium);
|
|
376
|
-
color: var(--lynx-console-color-fg-placeholder);
|
|
377
242
|
padding-bottom: 8px;
|
|
378
243
|
}
|
|
379
244
|
|
|
@@ -381,15 +246,11 @@
|
|
|
381
246
|
flex: 1;
|
|
382
247
|
font-size: 1rem;
|
|
383
248
|
line-height: 1.375rem;
|
|
384
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
385
|
-
color: var(--lynx-console-color-fg-neutral);
|
|
386
|
-
caret-color: var(--lynx-console-color-palette-green-600);
|
|
387
249
|
padding-bottom: 8px;
|
|
388
250
|
}
|
|
389
251
|
|
|
390
252
|
.cp-replRunButton {
|
|
391
253
|
padding: 4px 10px;
|
|
392
|
-
background-color: var(--lynx-console-color-palette-green-100);
|
|
393
254
|
border-radius: 4px;
|
|
394
255
|
margin-bottom: 8px;
|
|
395
256
|
}
|
|
@@ -397,6 +258,4 @@
|
|
|
397
258
|
.cp-replRunButtonText {
|
|
398
259
|
font-size: 0.8125rem;
|
|
399
260
|
line-height: 1.125rem;
|
|
400
|
-
font-weight: var(--lynx-console-font-weight-medium);
|
|
401
|
-
color: var(--lynx-console-color-palette-green-600);
|
|
402
261
|
}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
align-items: center;
|
|
7
7
|
gap: 8px;
|
|
8
8
|
overflow: visible;
|
|
9
|
-
transition: transform var(--lynx-console-duration-d4) cubic-bezier(0.4, 0, 0.2, 1);
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
.fb-button {
|
|
@@ -17,7 +16,6 @@
|
|
|
17
16
|
padding-top: 4px;
|
|
18
17
|
padding-bottom: 4px;
|
|
19
18
|
border-radius: 12px;
|
|
20
|
-
background-color: var(--lynx-console-color-palette-green-600);
|
|
21
19
|
display: flex;
|
|
22
20
|
flex-direction: column;
|
|
23
21
|
align-items: center;
|
|
@@ -39,16 +37,12 @@
|
|
|
39
37
|
.fb-title {
|
|
40
38
|
font-size: 0.875rem;
|
|
41
39
|
line-height: 1.1875rem;
|
|
42
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
43
|
-
color: var(--lynx-console-color-palette-static-white);
|
|
44
40
|
text-align: center;
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
.fb-subtitle {
|
|
48
44
|
font-size: 0.8125rem;
|
|
49
45
|
line-height: 1.125rem;
|
|
50
|
-
font-weight: var(--lynx-console-font-weight-regular);
|
|
51
|
-
color: var(--lynx-console-color-palette-static-white);
|
|
52
46
|
text-align: center;
|
|
53
47
|
}
|
|
54
48
|
|
|
@@ -57,7 +51,6 @@
|
|
|
57
51
|
width: 32px;
|
|
58
52
|
height: 32px;
|
|
59
53
|
border-radius: 16px;
|
|
60
|
-
background-color: var(--lynx-console-color-palette-green-600);
|
|
61
54
|
display: flex;
|
|
62
55
|
align-items: center;
|
|
63
56
|
justify-content: center;
|
|
@@ -68,6 +61,5 @@
|
|
|
68
61
|
font-size: 20px;
|
|
69
62
|
line-height: 32px;
|
|
70
63
|
margin-bottom: 5px;
|
|
71
|
-
color: var(--lynx-console-color-palette-static-white);
|
|
72
64
|
text-align: center;
|
|
73
65
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "@lynx-js/react";
|
|
2
2
|
import { useLongPressDrag } from "../hooks/useLongPressDrag";
|
|
3
|
+
import { useThemeColors } from "../styles/ThemeContext";
|
|
4
|
+
import { duration } from "../styles/theme";
|
|
3
5
|
import "./FloatingButton.css";
|
|
4
6
|
|
|
5
7
|
interface FloatingButtonProps {
|
|
@@ -28,6 +30,7 @@ export const FloatingButton = ({
|
|
|
28
30
|
bindtap,
|
|
29
31
|
children,
|
|
30
32
|
}: FloatingButtonProps) => {
|
|
33
|
+
const colors = useThemeColors();
|
|
31
34
|
const { phase, right, bottom, clearTimer, handlers } =
|
|
32
35
|
useLongPressDrag(bindtap);
|
|
33
36
|
|
|
@@ -53,19 +56,29 @@ export const FloatingButton = ({
|
|
|
53
56
|
right: `${right}px`,
|
|
54
57
|
bottom: `${bottom}px`,
|
|
55
58
|
transform: isDragging ? "scale(1.05)" : "scale(1)",
|
|
59
|
+
transition: `transform ${duration.d4} cubic-bezier(0.4, 0, 0.2, 1)`,
|
|
56
60
|
}}
|
|
57
61
|
{...handlers}
|
|
58
62
|
>
|
|
59
|
-
<view
|
|
63
|
+
<view
|
|
64
|
+
className={"fb-button"}
|
|
65
|
+
style={{ backgroundColor: colors.palette.green600 }}
|
|
66
|
+
>
|
|
60
67
|
{children}
|
|
61
68
|
<view className={"fb-shineOverlay"} style={SHINE_STYLES[phase]} />
|
|
62
69
|
</view>
|
|
63
70
|
<view
|
|
64
71
|
className={"fb-reloadButton"}
|
|
72
|
+
style={{ backgroundColor: colors.palette.green600 }}
|
|
65
73
|
catchtouchstart={() => clearTimer()}
|
|
66
74
|
bindtap={handleReload}
|
|
67
75
|
>
|
|
68
|
-
<text
|
|
76
|
+
<text
|
|
77
|
+
className={"fb-reloadIcon"}
|
|
78
|
+
style={{ color: colors.palette.staticWhite }}
|
|
79
|
+
>
|
|
80
|
+
{"\u21BB"}
|
|
81
|
+
</text>
|
|
69
82
|
</view>
|
|
70
83
|
</view>
|
|
71
84
|
</>
|