Jimin Huang commited on
Commit
e1b75e6
Β·
1 Parent(s): 62853a5

Change settings

Browse files
Files changed (1) hide show
  1. src/views/LiveView.vue +41 -21
src/views/LiveView.vue CHANGED
@@ -49,29 +49,27 @@
49
  </header>
50
 
51
  <div class="card3__kpis">
52
- <div class="kpi">
53
- <div class="kpi__label">Net value</div>
54
- <div class="kpi__value">{{ fmtUSD(c.balance) }}</div>
 
55
  </div>
56
  </div>
57
- <div class="card3__kpis">
58
- <div class="kpi">
59
- <div class="kpi__label">Profit</div>
60
- <div class="pill" :class="{ pos: profitOf(c) >= 0, neg: profitOf(c) < 0 }">{{ signedMoney(profitOf(c)) }}</div>
61
- </div>
62
- <div class="kpi">
63
- <div class="kpi__label">Delta profit</div>
64
- <div class="pill" :class="{ pos: (c.gapUsd ?? 0) >= 0, neg: (c.gapUsd ?? 0) < 0 }">
65
  <template v-if="c.kind==='agent'">
66
  <template v-if="mode==='usd'">{{ signedMoney(c.gapUsd) }}</template>
67
  <template v-else>{{ signedPct(c.gapPct) }}</template>
68
  </template>
69
  <template v-else>β€”</template>
70
- </div>
71
  </div>
 
72
  </div>
73
-
74
- <footer class="card3__foot">EOD {{ c.date ? new Date(c.date).toLocaleDateString() : '–' }}</footer>
75
  </article>
76
  </div>
77
  </section>
@@ -321,26 +319,48 @@ watch(
321
  @media (max-width: 640px) { .cards-grid { grid-template-columns: 1fr; } }
322
 
323
  /* CARD v3 */
324
- .card3 { position: relative; display: grid; grid-template-rows: auto auto; gap: 16px; padding: 18px; min-height: 320px; margin-bottom: 60px; border: 1px solid #EEF1F6; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
325
  .card3:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
326
  .card3.is-winner { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
327
  .card3.is-bh { outline: 2px dashed rgba(15,23,42,.08); }
328
 
329
- .card3__crown { position: absolute; top: 10px; right: 12px; font-size: 18px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
330
 
331
  .card3__head { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 12px; }
332
  .logo { width: 48px; height: 48px; border-radius: 999px; background: #F3F4F6; display: grid; place-items: center; overflow: hidden; }
333
  .logo img { width: 100%; height: 100%; object-fit: contain; }
334
  .logo__fallback { width: 60%; height: 60%; border-radius: 999px; background: #E5E7EB; }
335
- .head__title { font-weight: 900; color: #0F172A; line-height: 1.1; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
336
- .head__subtitle { font-size: 13px; color: #64748B; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
337
 
338
- .card3__kpis { display: grid; grid-template-columns: 1.3fr .7fr .8fr; align-items: end; gap: 12px; }
 
 
 
339
  .kpi__label { font-size: 12px; color: #6B7280; margin-bottom: 4px; }
340
  .kpi__value { font-weight: 900; color: #0F172A; font-size: clamp(22px, 2.2vw, 28px); white-space: nowrap; }
341
- .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; }
 
 
342
  .pill.pos { background: #DCFCE7; color: #166534; }
343
  .pill.neg { background: #FEE2E2; color: #B91C1C; }
344
 
345
- .card3__foot { position: absolute; bottom: 16px; right: 14px; font-size: 12px; color: #5B6476; opacity: .9; }
 
 
346
  </style>
 
49
  </header>
50
 
51
  <div class="card3__kpis">
52
+ <!-- Modern body: single, strong Net value row -->
53
+ <div class="kpi kpi--net">
54
+ <span class="kpi__label">Net value</span>
55
+ <span class="kpi__value">{{ fmtUSD(c.balance) }}</span>
56
  </div>
57
  </div>
58
+
59
+ <!-- Bottom bar: Profit / Delta chips on the left, EOD on the right -->
60
+ <div class="card3__bottom">
61
+ <div class="chips">
62
+ <span class="pill" :class="{ pos: profitOf(c) >= 0, neg: profitOf(c) < 0 }">{{ signedMoney(profitOf(c)) }}</span>
63
+ <span class="pill" :class="{ pos: (c.gapUsd ?? 0) >= 0, neg: (c.gapUsd ?? 0) < 0 }">
 
 
64
  <template v-if="c.kind==='agent'">
65
  <template v-if="mode==='usd'">{{ signedMoney(c.gapUsd) }}</template>
66
  <template v-else>{{ signedPct(c.gapPct) }}</template>
67
  </template>
68
  <template v-else>β€”</template>
69
+ </span>
70
  </div>
71
+ <footer class="card3__foot">EOD {{ c.date ? new Date(c.date).toLocaleDateString() : '–' }}</footer>
72
  </div>
 
 
73
  </article>
74
  </div>
75
  </section>
 
319
  @media (max-width: 640px) { .cards-grid { grid-template-columns: 1fr; } }
320
 
321
  /* CARD v3 */
322
+ .card3 {
323
+ position: relative;
324
+ display: grid;
325
+ grid-template-rows: auto auto auto; /* head, kpis, bottom */
326
+ gap: 14px;
327
+ padding: 18px;
328
+ min-height: 228px;
329
+ border-radius: 18px;
330
+ border: 1px solid #E8ECF3;
331
+ background: radial-gradient(120% 140% at 0% 0%, #FFFFFF 0%, #FBFCFE 100%);
332
+ box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(15,23,42,.04);
333
+ transition: box-shadow .2s ease, transform .15s ease, border-color .2s ease;
334
+ }
335
+ .card3:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.08); border-color: #D9E2F0; }
336
+ .card3.is-winner { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.14); }
337
+ .card3.is-bh { outline: 2px dashed rgba(15,23,42,.08); background: radial-gradient(120% 140% at 0% 0%, #FFFFFF 0%, #F9FBFF 100%); }
338
  .card3:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
339
  .card3.is-winner { border-color: #16a34a; box-shadow: 0 0 0 3px rgba(22,163,74,.12); }
340
  .card3.is-bh { outline: 2px dashed rgba(15,23,42,.08); }
341
 
342
+ .card3__crown { position: absolute; top: 12px; right: 12px; font-size: 18px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
343
 
344
  .card3__head { display: grid; grid-template-columns: 48px minmax(0,1fr); align-items: center; gap: 12px; }
345
  .logo { width: 48px; height: 48px; border-radius: 999px; background: #F3F4F6; display: grid; place-items: center; overflow: hidden; }
346
  .logo img { width: 100%; height: 100%; object-fit: contain; }
347
  .logo__fallback { width: 60%; height: 60%; border-radius: 999px; background: #E5E7EB; }
348
+ .head__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; }
349
+ .head__subtitle { font-size: 12px; color: #8A94A7; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
350
 
351
+ .card3__kpis { display: grid; grid-template-columns: 1fr; align-items: center; }
352
+ .kpi--net { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
353
+ .kpi__label { font-size: 12px; color: #6B7280; margin: 0; }
354
+ .kpi__value { font-weight: 900; color: #0B1220; font-size: clamp(24px, 2.2vw, 34px); letter-spacing: -.01em; white-space: nowrap; }
355
  .kpi__label { font-size: 12px; color: #6B7280; margin-bottom: 4px; }
356
  .kpi__value { font-weight: 900; color: #0F172A; font-size: clamp(22px, 2.2vw, 28px); white-space: nowrap; }
357
+ .pill { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1; white-space: nowrap; background: #F1F5FB; color: #0F172A; display: inline-block; box-shadow: inset 0 -1px 0 rgba(15,23,42,.04); }
358
+ .pill.pos { background: #E6F7ED; color: #0E7A3A; }
359
+ .pill.neg { background: #FBE9E9; color: #B91C1C; }
360
  .pill.pos { background: #DCFCE7; color: #166534; }
361
  .pill.neg { background: #FEE2E2; color: #B91C1C; }
362
 
363
+ .card3__foot { font-size: 12px; color: #5B6476; opacity: .9; }
364
+ .card3__bottom { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; margin-top: 4px; }
365
+ .card3__bottom .chips { display: inline-flex; gap: 8px; align-items: center; }
366
  </style>