Skip to content

Commit 790e618

Browse files
feat : Cards Style Sync
1 parent 1c58064 commit 790e618

File tree

4 files changed

+51
-8
lines changed

4 files changed

+51
-8
lines changed

client/components/MainChart.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,9 @@ const chartOptions = computed(() => {
169169
// min: yAxisMin,
170170
// max: yAxisMax,
171171
// tickAmount: Math.ceil((yAxisMax - yAxisMin) / 5000),
172-
min: 7500,
173-
max: 12500,
174-
tickAmount: 6,
172+
min: 7000,
173+
max: 12000,
174+
tickAmount: 5,
175175
labels: {
176176
style: {
177177
colors: '#000000',

client/components/activity/partials/MessageCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
v-if="modelIcon"
1111
:src="modelIcon"
1212
:alt="message.model_name"
13-
class="w-6 h-6 object-contain rounded-sm flex-shrink-0 rounded-full border border-gray-300 p-0.5"
13+
class="w-6 h-6 object-contain rounded-full border border-gray-300 p-0.5"
1414
@error="handleImageError"
1515
/>
1616
<span class="font-bold text-xs text-primary uppercase">{{ message.model_name }}</span>

client/components/activity/partials/PositionsCard.vue

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<div class="bg-blue-50 p-4 border-b-2 border-mono-border flex flex-col space-y-4">
2+
<div :class="[backgroundColorClass, 'p-4 border-b-2 border-mono-border flex flex-col space-y-4']">
33

44
<!-- Model Header -->
55
<div class="flex items-center space-x-2">
@@ -10,7 +10,7 @@
1010
class="w-8 h-8 object-contain rounded-full border border-gray-300 p-0.5"
1111
@error="handleImageError"
1212
/>
13-
<span class="font-bold text-sm text-blue-800 uppercase tracking-tight">{{ modelPositions.model.name }}</span>
13+
<span :class="['font-bold text-sm uppercase tracking-tight', textColorClass]">{{ modelPositions.model.name }}</span>
1414
</div>
1515

1616
<!-- Positions Table -->
@@ -75,7 +75,7 @@
7575
<div class="text-secondary text-[10px]">
7676
AVAILABLE CASH: {{ formatPrice(modelPositions.availableCash) }}
7777
</div>
78-
<div :class="['text-xs', modelPositions.totalUnrealizedPnl >= 0 ? 'text-blue-600' : 'text-red-600']">
78+
<div :class="['text-xs', modelPositions.totalUnrealizedPnl >= 0 ? 'text-green-600' : 'text-red-600']">
7979
TOTAL UNREALIZED P&L: {{ formatPnl(modelPositions.totalUnrealizedPnl) }}
8080
</div>
8181
</div>
@@ -87,7 +87,7 @@
8787
import { computed } from 'vue'
8888
import type { ModelPositions } from '~/types'
8989
import { formatNumber } from '~/composables/useNumberFormat'
90-
import { getCoinIcon, getModelIcon } from '~/config/assets'
90+
import { getCoinIcon, getModelIcon, getModelColor } from '~/config/assets'
9191
9292
interface Props {
9393
modelPositions: ModelPositions
@@ -96,6 +96,32 @@ interface Props {
9696
const props = defineProps<Props>()
9797
9898
const modelIcon = computed(() => getModelIcon(props.modelPositions.model.name))
99+
const modelColor = computed(() => getModelColor(props.modelPositions.model.name))
100+
101+
// Map color names to Tailwind classes
102+
const backgroundColorClass = computed(() => {
103+
const colorMap: Record<string, string> = {
104+
gray: 'bg-gray-50',
105+
green: 'bg-green-50',
106+
orange: 'bg-orange-50',
107+
sky: 'bg-sky-50',
108+
blue: 'bg-blue-50',
109+
purple: 'bg-purple-50',
110+
}
111+
return colorMap[modelColor.value] || 'bg-blue-50'
112+
})
113+
114+
const textColorClass = computed(() => {
115+
const colorMap: Record<string, string> = {
116+
gray: 'text-gray-800',
117+
green: 'text-green-800',
118+
orange: 'text-orange-800',
119+
sky: 'text-sky-800',
120+
blue: 'text-blue-800',
121+
purple: 'text-purple-800',
122+
}
123+
return colorMap[modelColor.value] || 'text-blue-800'
124+
})
99125
100126
const formatPrice = (price: number): string => {
101127
const formatted = formatNumber(price)

client/config/assets.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export interface ModelConfig {
2929
identifier: string | string[] // Pattern(s) to match in model name
3030
fullName: string
3131
icon: string
32+
color?: string // Color theme for the model
3233
}
3334

3435
/**
@@ -77,31 +78,37 @@ export const MODELS: ModelConfig[] = [
7778
identifier: ['groq', 'grok'],
7879
fullName: 'Groq',
7980
icon: groqIcon,
81+
color: 'gray',
8082
},
8183
{
8284
identifier: ['gpt', 'openai'],
8385
fullName: 'GPT',
8486
icon: gptIcon,
87+
color: 'green',
8588
},
8689
{
8790
identifier: ['claude', 'anthropic'],
8891
fullName: 'Claude',
8992
icon: claudeIcon,
93+
color: 'orange',
9094
},
9195
{
9296
identifier: ['gemini', 'google'],
9397
fullName: 'Gemini',
9498
icon: geminiIcon,
99+
color: 'sky',
95100
},
96101
{
97102
identifier: ['deepseek'],
98103
fullName: 'DeepSeek',
99104
icon: deepseekIcon,
105+
color: 'blue',
100106
},
101107
{
102108
identifier: ['qwen'],
103109
fullName: 'Qwen',
104110
icon: qwenIcon,
111+
color: 'purple',
105112
},
106113
]
107114

@@ -176,3 +183,13 @@ export function getModelFullName(modelName: string): string {
176183
const config = getModelConfig(modelName)
177184
return config?.fullName || modelName
178185
}
186+
187+
/**
188+
* Get model color by model name
189+
* @param modelName - Model name
190+
* @returns Color name or 'blue' as default if not found
191+
*/
192+
export function getModelColor(modelName: string): string {
193+
const config = getModelConfig(modelName)
194+
return config?.color || 'blue'
195+
}

0 commit comments

Comments
 (0)