openfree commited on
Commit
0a42d1f
·
verified ·
1 Parent(s): 51585e0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +44 -33
app.py CHANGED
@@ -115,39 +115,50 @@ def get_card(item: dict, index: int, card_type: str = "space") -> str:
115
  gpu_memory = gpu_info.get('memory', 'N/A')
116
  gpu_info = f"{gpu_type} ({gpu_memory}GB)"
117
 
118
- # 카드 타입별 그라데이션 설정
119
- if card_type == "space":
120
- gradient_colors = """
121
- rgba(255, 182, 193, 0.7), /* 파스텔 핑크 */
122
- rgba(173, 216, 230, 0.7), /* 파스텔 블루 */
123
- rgba(255, 218, 185, 0.7) /* 파스텔 피치 */
124
- """
125
- bg_content = f"""
126
- background-image: url(data:image/png;base64,{get_cached_screenshot(url) if get_cached_screenshot(url) else ''});
127
- background-size: cover;
128
- background-position: center;
129
- """
130
- elif card_type == "model":
131
- gradient_colors = """
132
- rgba(110, 142, 251, 0.7), /* 모델 블루 */
133
- rgba(130, 158, 251, 0.7),
134
- rgba(150, 174, 251, 0.7)
135
- """
136
- bg_content = f"""
137
- background: linear-gradient(135deg, #6e8efb, #4a6cf7);
138
- padding: 15px;
139
- """
140
- else: # dataset
141
- gradient_colors = """
142
- rgba(255, 107, 107, 0.7), /* 데이터셋 레드 */
143
- rgba(255, 127, 127, 0.7),
144
- rgba(255, 147, 147, 0.7)
145
- """
146
- bg_content = f"""
147
- background: linear-gradient(135deg, #ff6b6b, #ff8787);
148
- padding: 15px;
149
- """
150
-
 
 
 
 
 
 
 
 
 
 
 
151
 
152
 
153
  # 하드웨어 정보 HTML (모든 카드 타입에 대해 동일하게 적용)
 
115
  gpu_memory = gpu_info.get('memory', 'N/A')
116
  gpu_info = f"{gpu_type} ({gpu_memory}GB)"
117
 
118
+ # 카드 타입별 그라데이션 설정
119
+ if card_type == "space":
120
+ gradient_colors = """
121
+ rgba(255, 182, 193, 0.7), /* 파스텔 핑크 */
122
+ rgba(173, 216, 230, 0.7), /* 파스텔 블루 */
123
+ rgba(255, 218, 185, 0.7) /* 파스텔 피치 */
124
+ """
125
+ bg_content = f"""
126
+ background-image: url(data:image/png;base64,{get_cached_screenshot(url) if get_cached_screenshot(url) else ''});
127
+ background-size: cover;
128
+ background-position: center;
129
+ """
130
+ content_bg = f"""
131
+ background: linear-gradient(135deg, {gradient_colors});
132
+ backdrop-filter: blur(10px);
133
+ """
134
+ elif card_type == "model":
135
+ gradient_colors = """
136
+ rgba(110, 142, 251, 0.7), /* 모델 블루 */
137
+ rgba(130, 158, 251, 0.7),
138
+ rgba(150, 174, 251, 0.7)
139
+ """
140
+ bg_content = f"""
141
+ background: linear-gradient(135deg, #6e8efb, #4a6cf7);
142
+ padding: 15px;
143
+ """
144
+ content_bg = f"""
145
+ background: linear-gradient(135deg, {gradient_colors});
146
+ backdrop-filter: blur(10px);
147
+ """
148
+ else: # dataset
149
+ gradient_colors = """
150
+ rgba(255, 107, 107, 0.7), /* 데이터셋 레드 */
151
+ rgba(255, 127, 127, 0.7),
152
+ rgba(255, 147, 147, 0.7)
153
+ """
154
+ bg_content = f"""
155
+ background: linear-gradient(135deg, #ff6b6b, #ff8787);
156
+ padding: 15px;
157
+ """
158
+ content_bg = f"""
159
+ background: linear-gradient(135deg, {gradient_colors});
160
+ backdrop-filter: blur(10px);
161
+ """
162
 
163
 
164
  # 하드웨어 정보 HTML (모든 카드 타입에 대해 동일하게 적용)