Jimin Huang commited on
Commit
5d66707
·
1 Parent(s): a1c02fd

Change settings

Browse files
Files changed (1) hide show
  1. src/views/LiveView.vue +41 -13
src/views/LiveView.vue CHANGED
@@ -266,7 +266,19 @@ watch(
266
  const gapUsd = perf.stratLast - perf.bhLast
267
  const gapPct = perf.bhLast > 0 ? (perf.stratLast / perf.bhLast - 1) : 0
268
  const profitUsd = (perf.stratLast ?? 0) - 100000
269
- return { => {
 
 
 
 
 
 
 
 
 
 
 
 
270
  const gapUsd = perf.stratLast - perf.bhLast
271
  const gapPct = perf.bhLast > 0 ? (perf.stratLast / perf.bhLast - 1) : 0
272
  return {
@@ -320,17 +332,21 @@ watch(
320
  /* empty */
321
  .empty { padding: 14px; border: 1px dashed #D6DAE1; border-radius: 12px; color: #6B7280; font-size: .92rem; }
322
 
323
- /* NEW GRID: fluid, auto-fit tiles */
324
  .cards-grid { display: grid; gap: 16px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
 
 
 
 
325
 
326
  /* CARD v2 */
327
  .card2 {
328
  position: relative;
329
  display: grid;
330
- grid-template-rows: auto auto auto; /* rows: top, meta, foot */
331
- gap: 14px;
332
- padding: 16px;
333
- min-height: 200px;
334
  border: 1px solid #EEF1F6;
335
  border-radius: 16px;
336
  background: #fff;
@@ -340,18 +356,30 @@ watch(
340
  .card2:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
341
  .card2.is-bh { outline: 2px dashed rgba(15,23,42,.08); }
342
  .card2.is-winner { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
 
 
 
343
 
344
  /* ribbon */
345
- .card2__ribbon { position: absolute; top: 10px; right: 10px; font-size: 18px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
346
 
347
  /* row layout */
348
  .card2__row { display: grid; align-items: center; }
349
- .card2__row--top {
350
- grid-template-columns: 1fr auto; /* info | metrics */
351
- column-gap: 12px;
352
- }
353
- .card2__row--meta { grid-template-columns: 1fr; }
354
- .card2__row--foot { grid-template-columns: 1fr auto; font-size: 12px; color: #5B6476; opacity: .9; margin-top: -4px; }
 
 
 
 
 
 
 
 
 
355
 
356
  /* avatar */
357
  .avatar { width: 56px; height: 56px; border-radius: 999px; background: #F3F4F6; display: grid; place-items: center; overflow: hidden; }
 
266
  const gapUsd = perf.stratLast - perf.bhLast
267
  const gapPct = perf.bhLast > 0 ? (perf.stratLast / perf.bhLast - 1) : 0
268
  const profitUsd = (perf.stratLast ?? 0) - 100000
269
+ return {
270
+ key: `agent|${sel.agent_name}|${sel.model}`,
271
+ kind: 'agent',
272
+ title: sel.agent_name,
273
+ subtitle: sel.model,
274
+ balance: perf.stratLast,
275
+ date: perf.date,
276
+ logo: AGENT_LOGOS[sel.agent_name] || null,
277
+ gapUsd, gapPct,
278
+ profitUsd,
279
+ isWinner: false
280
+ }
281
+ }) => {
282
  const gapUsd = perf.stratLast - perf.bhLast
283
  const gapPct = perf.bhLast > 0 ? (perf.stratLast / perf.bhLast - 1) : 0
284
  return {
 
332
  /* empty */
333
  .empty { padding: 14px; border: 1px dashed #D6DAE1; border-radius: 12px; color: #6B7280; font-size: .92rem; }
334
 
335
+ /* NEW GRID: five fixed columns on wide screens */
336
  .cards-grid { display: grid; gap: 16px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
337
+ @media (max-width: 1400px) { .cards-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
338
+ @media (max-width: 1100px) { .cards-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
339
+ @media (max-width: 900px) { .cards-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
340
+ @media (max-width: 640px) { .cards-grid { grid-template-columns: 1fr; } }
341
 
342
  /* CARD v2 */
343
  .card2 {
344
  position: relative;
345
  display: grid;
346
+ grid-template-rows: auto auto; /* header, kpis */
347
+ gap: 16px;
348
+ padding: 18px;
349
+ min-height: 220px;
350
  border: 1px solid #EEF1F6;
351
  border-radius: 16px;
352
  background: #fff;
 
356
  .card2:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
357
  .card2.is-bh { outline: 2px dashed rgba(15,23,42,.08); }
358
  .card2.is-winner { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
359
+ .card2:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
360
+ .card2.is-bh { outline: 2px dashed rgba(15,23,42,.08); }
361
+ .card2.is-winner { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
362
 
363
  /* ribbon */
364
+ .card2__ribbon { position: absolute; top: 10px; right: 12px; font-size: 18px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
365
 
366
  /* row layout */
367
  .card2__row { display: grid; align-items: center; }
368
+ .card2__header { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 12px; }
369
+ .avatar { width: 48px; height: 48px; border-radius: 999px; background: #F3F4F6; display: grid; place-items: center; overflow: hidden; }
370
+ .avatar img { width: 100%; height: 100%; object-fit: contain; }
371
+ .avatar__fallback { width: 60%; height: 60%; border-radius: 999px; background: #E5E7EB; }
372
+ .titleblock { min-width: 0; }
373
+ .title { font-weight: 900; color: #0F172A; line-height: 1.1; font-size: clamp(18px, 1.6vw, 22px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
374
+ .subtitle { font-size: 13px; color: #64748B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
375
+ .card2__kpis { display: grid; grid-template-columns: 1.3fr .7fr .8fr; align-items: end; gap: 12px; }
376
+ .kpi { min-width: 0; }
377
+ .kpi__label { font-size: 12px; color: #6B7280; margin-bottom: 4px; }
378
+ .kpi__value { font-weight: 900; color: #0F172A; font-size: clamp(22px, 2.2vw, 28px); white-space: nowrap; }
379
+ .pill { padding: 6px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; line-height: 1; white-space: nowrap; background: #EEF2F7; color: #0F172A; display: inline-block; }
380
+ .pill.pos { background: #DCFCE7; color: #166534; }
381
+ .pill.neg { background: #FEE2E2; color: #B91C1C; }
382
+ .card2__eod { position: absolute; bottom: 12px; right: 14px; font-size: 12px; color: #5B
383
 
384
  /* avatar */
385
  .avatar { width: 56px; height: 56px; border-radius: 999px; background: #F3F4F6; display: grid; place-items: center; overflow: hidden; }