verce-vue-test 0.0.41 → 0.0.42
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/package.json +1 -1
- package/src/router/index.ts +0 -1
- package/src/utils/homeBalance.ts +415 -0
- package/src/views/HomeView.vue +102 -46
package/package.json
CHANGED
package/src/router/index.ts
CHANGED
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
export type HomeBalanceFieldConfig = {
|
|
2
|
+
id: string
|
|
3
|
+
title?: string
|
|
4
|
+
unit: string
|
|
5
|
+
keys: string[]
|
|
6
|
+
currencyCodes?: string[]
|
|
7
|
+
amountKeys?: string[]
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export type NormalizedHomeBalance = {
|
|
11
|
+
id: string
|
|
12
|
+
title?: string
|
|
13
|
+
unit: string
|
|
14
|
+
amount: string
|
|
15
|
+
decimal: string
|
|
16
|
+
rawValue?: unknown
|
|
17
|
+
sourceKey?: string
|
|
18
|
+
found: boolean
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type HomeBalanceTarget = {
|
|
22
|
+
id: string
|
|
23
|
+
amount: string
|
|
24
|
+
decimal: string
|
|
25
|
+
unit: string
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type NormalizeHomeBalanceOptions = {
|
|
29
|
+
fields?: HomeBalanceFieldConfig[]
|
|
30
|
+
fractionDigits?: number
|
|
31
|
+
preserveWhenMissing?: boolean
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const DEFAULT_AMOUNT_KEYS = [
|
|
35
|
+
'mainAcctAmt',
|
|
36
|
+
'mainAcctAmount',
|
|
37
|
+
'mainAccountAmt',
|
|
38
|
+
'mainAccountAmount',
|
|
39
|
+
'acctAmt',
|
|
40
|
+
'accountAmt',
|
|
41
|
+
'accountAmount',
|
|
42
|
+
'availableBalance',
|
|
43
|
+
'balanceAmount',
|
|
44
|
+
'availableAmt',
|
|
45
|
+
'availableAmount',
|
|
46
|
+
'amount',
|
|
47
|
+
'amt',
|
|
48
|
+
'balance',
|
|
49
|
+
'value',
|
|
50
|
+
]
|
|
51
|
+
|
|
52
|
+
export const DEFAULT_HOME_BALANCE_FIELDS: HomeBalanceFieldConfig[] = [
|
|
53
|
+
{
|
|
54
|
+
id: 'rmb',
|
|
55
|
+
title: '人民币',
|
|
56
|
+
unit: 'CNY',
|
|
57
|
+
currencyCodes: ['CNY', 'RMB', '人民币'],
|
|
58
|
+
keys: [
|
|
59
|
+
'body.balanceAmount',
|
|
60
|
+
'body.availableBalance',
|
|
61
|
+
'balanceAmount',
|
|
62
|
+
'availableBalance',
|
|
63
|
+
'rmbAmount',
|
|
64
|
+
'rmbBalance',
|
|
65
|
+
'cnyAmount',
|
|
66
|
+
'cnyBalance',
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
id: 'usd',
|
|
71
|
+
title: '美元',
|
|
72
|
+
unit: 'USD',
|
|
73
|
+
currencyCodes: ['USD', '美元'],
|
|
74
|
+
keys: ['usdAmount', 'usdBalance', 'usdAvailableBalance', 'usdAvailableAmt'],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'clearing',
|
|
78
|
+
title: '城银清',
|
|
79
|
+
unit: 'CNY',
|
|
80
|
+
currencyCodes: ['CLEARING', '城银清'],
|
|
81
|
+
keys: ['clearingAmount', 'clearingBalance', 'settleAmount', 'settleAccount'],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'eur',
|
|
85
|
+
title: '欧元',
|
|
86
|
+
unit: 'EUR',
|
|
87
|
+
currencyCodes: ['EUR', '欧元'],
|
|
88
|
+
keys: ['eurAmount', 'eurBalance', 'eurAvailableBalance', 'eurAvailableAmt'],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'cross-border-rmb',
|
|
92
|
+
title: '跨境人民币',
|
|
93
|
+
unit: 'CNY',
|
|
94
|
+
currencyCodes: ['CROSS_BORDER_RMB', '跨境人民币'],
|
|
95
|
+
keys: [
|
|
96
|
+
'crossBorderRmbAmount',
|
|
97
|
+
'crossBorderRmbBalance',
|
|
98
|
+
'crossBorderAmount',
|
|
99
|
+
'crossBorderBalance',
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: 'hkd',
|
|
104
|
+
title: '港币',
|
|
105
|
+
unit: 'HKD',
|
|
106
|
+
currencyCodes: ['HKD', '港币'],
|
|
107
|
+
keys: ['hkdAmount', 'hkdBalance', 'hkdAvailableBalance', 'hkdAvailableAmt'],
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: 'digital-currency',
|
|
111
|
+
title: '数字货币',
|
|
112
|
+
unit: 'CNY',
|
|
113
|
+
currencyCodes: ['DCCY', 'DCNY', '数字货币'],
|
|
114
|
+
keys: [
|
|
115
|
+
'dccyAvailableAmt',
|
|
116
|
+
'dccyAvailableAmount',
|
|
117
|
+
'digitalCurrencyAmount',
|
|
118
|
+
'digitalCurrencyBalance',
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
id: 'jpy',
|
|
123
|
+
title: '日元',
|
|
124
|
+
unit: 'JPY',
|
|
125
|
+
currencyCodes: ['JPY', '日元'],
|
|
126
|
+
keys: ['jpyAmount', 'jpyBalance', 'jpyAvailableBalance', 'jpyAvailableAmt'],
|
|
127
|
+
},
|
|
128
|
+
]
|
|
129
|
+
|
|
130
|
+
export function normalizeHomeBalanceResponse(
|
|
131
|
+
payload: unknown,
|
|
132
|
+
options: NormalizeHomeBalanceOptions = {},
|
|
133
|
+
): NormalizedHomeBalance[] {
|
|
134
|
+
const fields = options.fields ?? DEFAULT_HOME_BALANCE_FIELDS
|
|
135
|
+
const fractionDigits = options.fractionDigits ?? 2
|
|
136
|
+
const objects = collectObjects(payload)
|
|
137
|
+
|
|
138
|
+
return fields.map((field) => {
|
|
139
|
+
const foundValue =
|
|
140
|
+
findValueByCurrencyRecord(objects, field) ??
|
|
141
|
+
findValueByKeys(payload, objects, field.keys)
|
|
142
|
+
const formatted = formatAmountParts(foundValue?.value, fractionDigits)
|
|
143
|
+
|
|
144
|
+
return {
|
|
145
|
+
id: field.id,
|
|
146
|
+
title: field.title,
|
|
147
|
+
unit: field.unit,
|
|
148
|
+
amount: formatted.amount,
|
|
149
|
+
decimal: formatted.decimal,
|
|
150
|
+
rawValue: foundValue?.value,
|
|
151
|
+
sourceKey: foundValue?.sourceKey,
|
|
152
|
+
found: foundValue !== undefined,
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function applyHomeBalancePayload<T extends HomeBalanceTarget>(
|
|
158
|
+
cards: readonly T[],
|
|
159
|
+
payload: unknown,
|
|
160
|
+
options: NormalizeHomeBalanceOptions = {},
|
|
161
|
+
): T[] {
|
|
162
|
+
const preserveWhenMissing = options.preserveWhenMissing ?? true
|
|
163
|
+
const normalized = normalizeHomeBalanceResponse(payload, options)
|
|
164
|
+
const byId = new Map(normalized.map((item) => [normalizeKey(item.id), item]))
|
|
165
|
+
|
|
166
|
+
return cards.map((card) => {
|
|
167
|
+
const normalizedCard = byId.get(normalizeKey(card.id))
|
|
168
|
+
|
|
169
|
+
if (!normalizedCard?.found && preserveWhenMissing) {
|
|
170
|
+
return { ...card }
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (!normalizedCard) {
|
|
174
|
+
return { ...card, amount: '0', decimal: '.00' }
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return {
|
|
178
|
+
...card,
|
|
179
|
+
amount: normalizedCard.amount,
|
|
180
|
+
decimal: normalizedCard.decimal,
|
|
181
|
+
unit: normalizedCard.unit || card.unit,
|
|
182
|
+
}
|
|
183
|
+
})
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export function formatAmountParts(
|
|
187
|
+
value: unknown,
|
|
188
|
+
fractionDigits = 2,
|
|
189
|
+
): { amount: string; decimal: string } {
|
|
190
|
+
const numericText = normalizeNumericText(value)
|
|
191
|
+
|
|
192
|
+
if (!numericText) {
|
|
193
|
+
return {
|
|
194
|
+
amount: '0',
|
|
195
|
+
decimal: fractionDigits > 0 ? `.${'0'.repeat(fractionDigits)}` : '',
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const unsignedText = numericText.startsWith('-')
|
|
200
|
+
? numericText.slice(1)
|
|
201
|
+
: numericText
|
|
202
|
+
const [integer = '0', ...decimalParts] = unsignedText.split('.')
|
|
203
|
+
const normalizedInteger = integer.replace(/^0+(?=\d)/, '') || '0'
|
|
204
|
+
const decimalText = decimalParts.join('')
|
|
205
|
+
const decimal = fractionDigits > 0
|
|
206
|
+
? `.${decimalText.padEnd(fractionDigits, '0').slice(0, fractionDigits)}`
|
|
207
|
+
: ''
|
|
208
|
+
|
|
209
|
+
return {
|
|
210
|
+
amount: `${numericText.startsWith('-') ? '-' : ''}${groupInteger(normalizedInteger)}`,
|
|
211
|
+
decimal,
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function findValueByKeys(
|
|
216
|
+
payload: unknown,
|
|
217
|
+
objects: readonly Record<string, unknown>[],
|
|
218
|
+
keys: readonly string[],
|
|
219
|
+
): { value: unknown; sourceKey: string } | undefined {
|
|
220
|
+
for (const key of keys) {
|
|
221
|
+
if (key.includes('.')) {
|
|
222
|
+
const pathValue = readPath(payload, key)
|
|
223
|
+
|
|
224
|
+
if (isUsableValue(pathValue)) {
|
|
225
|
+
return { value: pathValue, sourceKey: key }
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
const normalizedKey = normalizeKey(key)
|
|
230
|
+
|
|
231
|
+
for (const object of objects) {
|
|
232
|
+
const entry = Object.entries(object).find(
|
|
233
|
+
([objectKey]) => normalizeKey(objectKey) === normalizedKey,
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
if (entry && isUsableValue(entry[1])) {
|
|
237
|
+
return { value: entry[1], sourceKey: entry[0] }
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
return undefined
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
function findValueByCurrencyRecord(
|
|
246
|
+
objects: readonly Record<string, unknown>[],
|
|
247
|
+
field: HomeBalanceFieldConfig,
|
|
248
|
+
): { value: unknown; sourceKey: string } | undefined {
|
|
249
|
+
const shouldUseUnitAsAlias = normalizeKey(field.unit) !== 'cny'
|
|
250
|
+
const currencyCodes = new Set(
|
|
251
|
+
[
|
|
252
|
+
field.id,
|
|
253
|
+
field.title,
|
|
254
|
+
...(shouldUseUnitAsAlias ? [field.unit] : []),
|
|
255
|
+
...(field.currencyCodes ?? []),
|
|
256
|
+
]
|
|
257
|
+
.filter((item): item is string => Boolean(item))
|
|
258
|
+
.map(normalizeKey),
|
|
259
|
+
)
|
|
260
|
+
|
|
261
|
+
const matches: Array<{ value: unknown; sourceKey: string }> = []
|
|
262
|
+
|
|
263
|
+
for (const object of objects) {
|
|
264
|
+
const recordCurrency = findRecordCurrency(object)
|
|
265
|
+
|
|
266
|
+
if (!recordCurrency || !currencyCodes.has(normalizeKey(recordCurrency))) {
|
|
267
|
+
continue
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const amountKeys = [...(field.amountKeys ?? []), ...DEFAULT_AMOUNT_KEYS]
|
|
271
|
+
const amountValue = findValueByKeys(object, [object], amountKeys)
|
|
272
|
+
|
|
273
|
+
if (amountValue) {
|
|
274
|
+
matches.push(amountValue)
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
if (!matches.length) {
|
|
279
|
+
return undefined
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (matches.length === 1) {
|
|
283
|
+
return matches[0]
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const numericValues = matches
|
|
287
|
+
.map((match) => parseAmountValue(match.value))
|
|
288
|
+
.filter((value): value is number => Number.isFinite(value))
|
|
289
|
+
|
|
290
|
+
if (!numericValues.length) {
|
|
291
|
+
return matches[0]
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
return {
|
|
295
|
+
value: numericValues.reduce((total, value) => total + value, 0),
|
|
296
|
+
sourceKey: Array.from(new Set(matches.map((match) => match.sourceKey))).join('+'),
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
function findRecordCurrency(object: Record<string, unknown>) {
|
|
301
|
+
const currencyKeys = [
|
|
302
|
+
'currency',
|
|
303
|
+
'currencyCode',
|
|
304
|
+
'currencyType',
|
|
305
|
+
'currencyName',
|
|
306
|
+
'ccy',
|
|
307
|
+
'ccyCode',
|
|
308
|
+
'curr',
|
|
309
|
+
'currCode',
|
|
310
|
+
'unit',
|
|
311
|
+
]
|
|
312
|
+
|
|
313
|
+
for (const key of currencyKeys) {
|
|
314
|
+
const value = findValueByKeys(object, [object], [key])?.value
|
|
315
|
+
|
|
316
|
+
if (typeof value === 'string' && value.trim()) {
|
|
317
|
+
return value.trim()
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
return undefined
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
function collectObjects(
|
|
325
|
+
value: unknown,
|
|
326
|
+
depth = 0,
|
|
327
|
+
seen = new Set<object>(),
|
|
328
|
+
): Record<string, unknown>[] {
|
|
329
|
+
if (!isPlainObject(value) && !Array.isArray(value)) {
|
|
330
|
+
return []
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if (typeof value === 'object' && value !== null) {
|
|
334
|
+
if (seen.has(value)) {
|
|
335
|
+
return []
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
seen.add(value)
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if (depth > 8) {
|
|
342
|
+
return []
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
if (Array.isArray(value)) {
|
|
346
|
+
return value.flatMap((item) => collectObjects(item, depth + 1, seen))
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const object = value as Record<string, unknown>
|
|
350
|
+
const children = Object.entries(object).flatMap(([, child]) =>
|
|
351
|
+
collectObjects(child, depth + 1, seen),
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
return [object, ...children]
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function readPath(value: unknown, path: string) {
|
|
358
|
+
return path.split('.').reduce<unknown>((current, segment) => {
|
|
359
|
+
if (!isPlainObject(current) && !Array.isArray(current)) {
|
|
360
|
+
return undefined
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return (current as Record<string, unknown>)[segment]
|
|
364
|
+
}, value)
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
function normalizeNumericText(value: unknown) {
|
|
368
|
+
if (value === null || value === undefined) {
|
|
369
|
+
return ''
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const raw = String(value).trim()
|
|
373
|
+
|
|
374
|
+
if (!raw || raw === '-' || raw === '--' || raw === '—') {
|
|
375
|
+
return ''
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
const isNegative = raw.startsWith('-') || /^\(.+\)$/.test(raw)
|
|
379
|
+
const text = raw.replace(/,/g, '').replace(/[^\d.]/g, '')
|
|
380
|
+
|
|
381
|
+
if (!/\d/.test(text)) {
|
|
382
|
+
return ''
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const [integer = '0', ...decimalParts] = text.split('.')
|
|
386
|
+
const decimal = decimalParts.length ? `.${decimalParts.join('')}` : ''
|
|
387
|
+
|
|
388
|
+
return `${isNegative ? '-' : ''}${integer || '0'}${decimal}`
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
function parseAmountValue(value: unknown) {
|
|
392
|
+
const text = normalizeNumericText(value)
|
|
393
|
+
|
|
394
|
+
if (!text) {
|
|
395
|
+
return Number.NaN
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return Number(text)
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
function groupInteger(value: string) {
|
|
402
|
+
return value.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
function normalizeKey(value: string) {
|
|
406
|
+
return value.toLowerCase().replace(/[\s_\-./]/g, '')
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
function isUsableValue(value: unknown) {
|
|
410
|
+
return value !== null && value !== undefined && value !== ''
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
414
|
+
return Object.prototype.toString.call(value) === '[object Object]'
|
|
415
|
+
}
|
package/src/views/HomeView.vue
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
2
3
|
import type { Component } from 'vue'
|
|
3
4
|
import { useRouter } from 'vue-router'
|
|
4
5
|
import {
|
|
@@ -22,6 +23,7 @@ import cardCrossBorderBg from '@/assets/home/card-cross-border-map.png'
|
|
|
22
23
|
import cardHkdBg from '@/assets/home/card-hkd-skyline.png'
|
|
23
24
|
import cardDigitalBg from '@/assets/home/card-digital-currency.png'
|
|
24
25
|
import cardJpyBg from '@/assets/home/card-jpy-fuji.png'
|
|
26
|
+
import { applyHomeBalancePayload } from '@/utils/homeBalance'
|
|
25
27
|
|
|
26
28
|
type BalanceCard = {
|
|
27
29
|
id: string
|
|
@@ -47,10 +49,10 @@ type HomeMenuItem = {
|
|
|
47
49
|
active?: boolean
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
const updatedAt =
|
|
52
|
+
const updatedAt = ref(formatDateTime(new Date()))
|
|
51
53
|
const router = useRouter()
|
|
52
54
|
|
|
53
|
-
const balanceCards
|
|
55
|
+
const balanceCards = ref<BalanceCard[]>([
|
|
54
56
|
{
|
|
55
57
|
id: 'rmb',
|
|
56
58
|
title: '人民币',
|
|
@@ -164,7 +166,7 @@ const balanceCards: BalanceCard[] = [
|
|
|
164
166
|
border: 'rgba(115, 63, 216, 0.56)',
|
|
165
167
|
glow: 'rgba(88, 41, 191, 0.27)',
|
|
166
168
|
},
|
|
167
|
-
]
|
|
169
|
+
])
|
|
168
170
|
|
|
169
171
|
const menuItems: HomeMenuItem[] = [
|
|
170
172
|
{ label: '总览', route: '/', icon: HomeFilled, active: true },
|
|
@@ -178,6 +180,28 @@ function openMenu(item: HomeMenuItem) {
|
|
|
178
180
|
router.push(item.route)
|
|
179
181
|
}
|
|
180
182
|
}
|
|
183
|
+
|
|
184
|
+
function isLongAmount(card: BalanceCard) {
|
|
185
|
+
return `${card.amount}${card.decimal}`.length >= 16
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
function updateBalanceCardsFromApi(payload: unknown) {
|
|
189
|
+
balanceCards.value = applyHomeBalancePayload(balanceCards.value, payload)
|
|
190
|
+
updatedAt.value = formatDateTime(new Date())
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
defineExpose({
|
|
194
|
+
updateBalanceCardsFromApi,
|
|
195
|
+
})
|
|
196
|
+
|
|
197
|
+
function formatDateTime(date: Date) {
|
|
198
|
+
const pad = (value: number) => String(value).padStart(2, '0')
|
|
199
|
+
|
|
200
|
+
return [
|
|
201
|
+
`${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`,
|
|
202
|
+
`${pad(date.getHours())}:${pad(date.getMinutes())}:${pad(date.getSeconds())}`,
|
|
203
|
+
].join(' ')
|
|
204
|
+
}
|
|
181
205
|
</script>
|
|
182
206
|
|
|
183
207
|
<template>
|
|
@@ -210,6 +234,7 @@ function openMenu(item: HomeMenuItem) {
|
|
|
210
234
|
v-for="card in balanceCards"
|
|
211
235
|
:key="card.id"
|
|
212
236
|
class="balance-card"
|
|
237
|
+
:class="{ 'is-long-amount': isLongAmount(card) }"
|
|
213
238
|
:style="{
|
|
214
239
|
'--card-bg': `url(${card.background})`,
|
|
215
240
|
'--accent': card.accent,
|
|
@@ -278,8 +303,8 @@ function openMenu(item: HomeMenuItem) {
|
|
|
278
303
|
--card-radius: clamp(0.65rem, 0.85vw, 1rem);
|
|
279
304
|
position: relative;
|
|
280
305
|
width: 100%;
|
|
281
|
-
|
|
282
|
-
min-height:
|
|
306
|
+
height: 100%;
|
|
307
|
+
min-height: 100%;
|
|
283
308
|
padding: var(--edge-pad-y) var(--edge-pad-x);
|
|
284
309
|
overflow: hidden;
|
|
285
310
|
color: var(--navy);
|
|
@@ -297,8 +322,7 @@ function openMenu(item: HomeMenuItem) {
|
|
|
297
322
|
grid-template-columns: minmax(0, 1fr) var(--menu-width);
|
|
298
323
|
gap: var(--page-gap);
|
|
299
324
|
width: 100%;
|
|
300
|
-
height:
|
|
301
|
-
height: calc(100dvh - var(--edge-pad-y) * 2);
|
|
325
|
+
height: 100%;
|
|
302
326
|
min-height: 0;
|
|
303
327
|
}
|
|
304
328
|
|
|
@@ -322,22 +346,12 @@ function openMenu(item: HomeMenuItem) {
|
|
|
322
346
|
backdrop-filter: blur(2px);
|
|
323
347
|
}
|
|
324
348
|
|
|
325
|
-
.balance-panel::before {
|
|
326
|
-
position: absolute;
|
|
327
|
-
inset: clamp(0.55rem, 1.15vw, 1.35rem);
|
|
328
|
-
content: "";
|
|
329
|
-
pointer-events: none;
|
|
330
|
-
border: 1px solid rgba(187, 217, 247, 0.62);
|
|
331
|
-
border-radius: calc(var(--panel-radius) * 0.78);
|
|
332
|
-
box-shadow: inset 0 0 clamp(0.8rem, 1.8vw, 2rem) rgba(255, 255, 255, 0.72);
|
|
333
|
-
}
|
|
334
|
-
|
|
335
349
|
.panel-head {
|
|
336
350
|
position: relative;
|
|
337
351
|
z-index: 1;
|
|
338
352
|
display: grid;
|
|
339
|
-
min-height: clamp(
|
|
340
|
-
padding: clamp(
|
|
353
|
+
min-height: clamp(4.75rem, 11.2vh, 6.8rem);
|
|
354
|
+
padding: clamp(0.9rem, 2.05vh, 1.75rem) clamp(1.25rem, 3.75vw, 4rem) 0;
|
|
341
355
|
}
|
|
342
356
|
|
|
343
357
|
.page-heading {
|
|
@@ -349,9 +363,9 @@ function openMenu(item: HomeMenuItem) {
|
|
|
349
363
|
.page-heading h1 {
|
|
350
364
|
margin: 0;
|
|
351
365
|
color: #06195a;
|
|
352
|
-
font-size: clamp(
|
|
366
|
+
font-size: clamp(1.65rem, 2.55vw, 3rem);
|
|
353
367
|
font-weight: 900;
|
|
354
|
-
line-height:
|
|
368
|
+
line-height: 1;
|
|
355
369
|
letter-spacing: 0;
|
|
356
370
|
text-shadow:
|
|
357
371
|
0 0.08rem 0 rgba(255, 255, 255, 0.86),
|
|
@@ -360,10 +374,10 @@ function openMenu(item: HomeMenuItem) {
|
|
|
360
374
|
|
|
361
375
|
.heading-rule {
|
|
362
376
|
display: grid;
|
|
363
|
-
grid-template-columns: minmax(
|
|
377
|
+
grid-template-columns: minmax(3rem, 8vw) clamp(0.8rem, 1vw, 1.2rem) minmax(3rem, 8vw);
|
|
364
378
|
align-items: center;
|
|
365
379
|
gap: clamp(0.32rem, 0.55vw, 0.65rem);
|
|
366
|
-
margin-top: clamp(0.
|
|
380
|
+
margin-top: clamp(0.28rem, 0.58vw, 0.68rem);
|
|
367
381
|
color: #1f57e2;
|
|
368
382
|
}
|
|
369
383
|
|
|
@@ -380,8 +394,8 @@ function openMenu(item: HomeMenuItem) {
|
|
|
380
394
|
|
|
381
395
|
.heading-rule i {
|
|
382
396
|
display: grid;
|
|
383
|
-
width: clamp(
|
|
384
|
-
height: clamp(
|
|
397
|
+
width: clamp(0.8rem, 1vw, 1.2rem);
|
|
398
|
+
height: clamp(0.8rem, 1vw, 1.2rem);
|
|
385
399
|
place-items: center;
|
|
386
400
|
color: #2466ec;
|
|
387
401
|
}
|
|
@@ -394,7 +408,7 @@ function openMenu(item: HomeMenuItem) {
|
|
|
394
408
|
|
|
395
409
|
.updated-at {
|
|
396
410
|
position: absolute;
|
|
397
|
-
top: clamp(1.
|
|
411
|
+
top: clamp(1.3rem, 3.9vh, 2.55rem);
|
|
398
412
|
right: clamp(1.25rem, 3.75vw, 4rem);
|
|
399
413
|
display: flex;
|
|
400
414
|
align-items: center;
|
|
@@ -426,22 +440,22 @@ function openMenu(item: HomeMenuItem) {
|
|
|
426
440
|
position: relative;
|
|
427
441
|
display: grid;
|
|
428
442
|
grid-template-columns:
|
|
429
|
-
clamp(
|
|
430
|
-
minmax(clamp(
|
|
443
|
+
clamp(3.85rem, 5.9vmin, 5.9rem)
|
|
444
|
+
minmax(clamp(4.7rem, 7.2vw, 8.2rem), 0.42fr)
|
|
431
445
|
minmax(0, 1fr);
|
|
432
446
|
align-items: center;
|
|
433
447
|
min-width: 0;
|
|
434
448
|
min-height: 0;
|
|
435
449
|
overflow: hidden;
|
|
436
|
-
padding: 0 clamp(0.
|
|
437
|
-
border:
|
|
450
|
+
padding: 0 clamp(0.55rem, 1vw, 1.05rem) 0 clamp(0.5rem, 0.9vw, 0.95rem);
|
|
451
|
+
border: none;
|
|
438
452
|
border-radius: var(--card-radius);
|
|
439
453
|
background:
|
|
440
454
|
linear-gradient(90deg, rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.28)),
|
|
441
455
|
#ffffff;
|
|
442
456
|
box-shadow:
|
|
443
|
-
0 0.
|
|
444
|
-
0 0 clamp(0.
|
|
457
|
+
0 0.12rem clamp(0.28rem, 0.5vw, 0.55rem) color-mix(in srgb, var(--card-glow) 55%, transparent),
|
|
458
|
+
0 0 clamp(0.4rem, 0.75vw, 0.85rem) rgba(255, 255, 255, 0.76) inset,
|
|
445
459
|
-0.16rem 0 0 var(--accent) inset;
|
|
446
460
|
}
|
|
447
461
|
|
|
@@ -488,7 +502,7 @@ function openMenu(item: HomeMenuItem) {
|
|
|
488
502
|
|
|
489
503
|
.badge-shell {
|
|
490
504
|
display: grid;
|
|
491
|
-
width: clamp(3.
|
|
505
|
+
width: clamp(3.55rem, 5.75vmin, 5.9rem);
|
|
492
506
|
aspect-ratio: 1;
|
|
493
507
|
place-items: center;
|
|
494
508
|
border-radius: 50%;
|
|
@@ -551,6 +565,7 @@ function openMenu(item: HomeMenuItem) {
|
|
|
551
565
|
|
|
552
566
|
.amount-block {
|
|
553
567
|
display: grid;
|
|
568
|
+
width: 100%;
|
|
554
569
|
justify-items: end;
|
|
555
570
|
min-width: 0;
|
|
556
571
|
padding-top: clamp(0.2rem, 0.55vw, 0.6rem);
|
|
@@ -592,6 +607,7 @@ function openMenu(item: HomeMenuItem) {
|
|
|
592
607
|
}
|
|
593
608
|
|
|
594
609
|
.unit-label {
|
|
610
|
+
max-width: 100%;
|
|
595
611
|
margin-top: clamp(0.35rem, 0.75vw, 0.85rem);
|
|
596
612
|
color: color-mix(in srgb, var(--accent-deep) 88%, #00164e);
|
|
597
613
|
font-size: clamp(0.95rem, 1.35vw, 1.55rem);
|
|
@@ -601,6 +617,15 @@ function openMenu(item: HomeMenuItem) {
|
|
|
601
617
|
text-align: right;
|
|
602
618
|
}
|
|
603
619
|
|
|
620
|
+
.balance-card.is-long-amount .amount-main {
|
|
621
|
+
font-size: clamp(1.65rem, 2.23vw, 3rem);
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.balance-card.is-long-amount .amount-decimal {
|
|
625
|
+
margin-top: clamp(0.28rem, 0.58vw, 0.66rem);
|
|
626
|
+
font-size: clamp(0.85rem, 1.1vw, 1.3rem);
|
|
627
|
+
}
|
|
628
|
+
|
|
604
629
|
.right-menu {
|
|
605
630
|
position: relative;
|
|
606
631
|
z-index: 2;
|
|
@@ -672,16 +697,16 @@ function openMenu(item: HomeMenuItem) {
|
|
|
672
697
|
}
|
|
673
698
|
|
|
674
699
|
.panel-head {
|
|
675
|
-
min-height: clamp(
|
|
700
|
+
min-height: clamp(4rem, 9vh, 5.35rem);
|
|
676
701
|
padding-inline: clamp(1rem, 2.4vw, 2rem);
|
|
677
702
|
}
|
|
678
703
|
|
|
679
704
|
.page-heading h1 {
|
|
680
|
-
font-size: clamp(
|
|
705
|
+
font-size: clamp(1.45rem, 2.5vw, 2.2rem);
|
|
681
706
|
}
|
|
682
707
|
|
|
683
708
|
.updated-at {
|
|
684
|
-
top: clamp(
|
|
709
|
+
top: clamp(1rem, 3vh, 1.7rem);
|
|
685
710
|
right: clamp(1rem, 2.4vw, 2rem);
|
|
686
711
|
font-size: clamp(0.72rem, 1vw, 0.9rem);
|
|
687
712
|
}
|
|
@@ -693,9 +718,37 @@ function openMenu(item: HomeMenuItem) {
|
|
|
693
718
|
|
|
694
719
|
.balance-card {
|
|
695
720
|
grid-template-columns:
|
|
696
|
-
clamp(3.
|
|
697
|
-
minmax(clamp(4.
|
|
721
|
+
clamp(3.45rem, 5.6vmin, 4.8rem)
|
|
722
|
+
minmax(clamp(4.25rem, 7.4vw, 6.45rem), 0.38fr)
|
|
698
723
|
minmax(0, 1fr);
|
|
724
|
+
padding-inline: clamp(0.42rem, 1vw, 0.75rem);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
.badge-shell {
|
|
728
|
+
width: clamp(3rem, 5.15vmin, 4.65rem);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.amount-main {
|
|
732
|
+
font-size: clamp(1.3rem, 2.22vw, 2.1rem);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.amount-decimal {
|
|
736
|
+
margin-top: clamp(0.25rem, 0.55vw, 0.58rem);
|
|
737
|
+
font-size: clamp(0.72rem, 1.12vw, 1.1rem);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
.unit-label {
|
|
741
|
+
margin-top: clamp(0.25rem, 0.58vw, 0.65rem);
|
|
742
|
+
font-size: clamp(0.82rem, 1.2vw, 1.2rem);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.balance-card.is-long-amount .amount-main {
|
|
746
|
+
font-size: clamp(1.15rem, 1.95vw, 1.85rem);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.balance-card.is-long-amount .amount-decimal {
|
|
750
|
+
margin-top: clamp(0.2rem, 0.48vw, 0.52rem);
|
|
751
|
+
font-size: clamp(0.68rem, 0.98vw, 1rem);
|
|
699
752
|
}
|
|
700
753
|
|
|
701
754
|
.menu-label {
|
|
@@ -710,8 +763,7 @@ function openMenu(item: HomeMenuItem) {
|
|
|
710
763
|
}
|
|
711
764
|
|
|
712
765
|
.home-layout {
|
|
713
|
-
height:
|
|
714
|
-
height: calc(100dvh - var(--edge-pad-y) * 2);
|
|
766
|
+
height: 100%;
|
|
715
767
|
}
|
|
716
768
|
|
|
717
769
|
.balance-panel {
|
|
@@ -740,10 +792,14 @@ function openMenu(item: HomeMenuItem) {
|
|
|
740
792
|
|
|
741
793
|
.balance-card {
|
|
742
794
|
grid-template-columns:
|
|
743
|
-
clamp(3.
|
|
744
|
-
minmax(clamp(
|
|
795
|
+
clamp(3.25rem, 9.5vw, 4.55rem)
|
|
796
|
+
minmax(clamp(4.65rem, 15.5vw, 6.75rem), 0.42fr)
|
|
745
797
|
minmax(0, 1fr);
|
|
746
|
-
padding-inline: clamp(0.
|
|
798
|
+
padding-inline: clamp(0.42rem, 1.5vw, 0.75rem);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
.badge-shell {
|
|
802
|
+
width: clamp(2.9rem, 8.5vw, 4.2rem);
|
|
747
803
|
}
|
|
748
804
|
|
|
749
805
|
.amount-main {
|
|
@@ -770,12 +826,12 @@ function openMenu(item: HomeMenuItem) {
|
|
|
770
826
|
}
|
|
771
827
|
|
|
772
828
|
.panel-head {
|
|
773
|
-
min-height: clamp(
|
|
774
|
-
padding-top: clamp(0.
|
|
829
|
+
min-height: clamp(3.75rem, 8.8vh, 4.65rem);
|
|
830
|
+
padding-top: clamp(0.75rem, 1.7vh, 1rem);
|
|
775
831
|
}
|
|
776
832
|
|
|
777
833
|
.page-heading h1 {
|
|
778
|
-
font-size: clamp(
|
|
834
|
+
font-size: clamp(1.45rem, 2.35vw, 2.55rem);
|
|
779
835
|
}
|
|
780
836
|
|
|
781
837
|
.heading-rule {
|