Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -142,12 +142,23 @@ def get_card(item: dict, index: int, card_type: str = "space") -> str:
|
|
| 142 |
<span>🛠️ {sdk}</span>
|
| 143 |
</div>
|
| 144 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 145 |
else:
|
| 146 |
# Models와 Datasets 처리
|
| 147 |
url = f"https://huggingface.co/{item_id}" if card_type == "model" else f"https://huggingface.co/datasets/{item_id}"
|
| 148 |
type_icon = "🤖" if card_type == "model" else "📊"
|
| 149 |
type_label = "MODEL" if card_type == "model" else "DATASET"
|
| 150 |
bg_color = "#6e8efb" if card_type == "model" else "#ff6b6b"
|
|
|
|
| 151 |
|
| 152 |
# 태그 기반 배경
|
| 153 |
bg_content = f"""
|
|
@@ -251,8 +262,9 @@ def get_card(item: dict, index: int, card_type: str = "space") -> str:
|
|
| 251 |
<!-- 콘텐츠 영역 -->
|
| 252 |
<div style='
|
| 253 |
padding: 20px;
|
| 254 |
-
|
| 255 |
-
border-radius: 0 0 20px 20px;
|
|
|
|
| 256 |
<h3 style='
|
| 257 |
margin: 0 0 15px 0;
|
| 258 |
color: #333;
|
|
@@ -262,7 +274,8 @@ def get_card(item: dict, index: int, card_type: str = "space") -> str:
|
|
| 262 |
-webkit-line-clamp: 2;
|
| 263 |
-webkit-box-orient: vertical;
|
| 264 |
overflow: hidden;
|
| 265 |
-
text-overflow: ellipsis;
|
|
|
|
| 266 |
{title}
|
| 267 |
</h3>
|
| 268 |
|
|
@@ -271,14 +284,17 @@ def get_card(item: dict, index: int, card_type: str = "space") -> str:
|
|
| 271 |
grid-template-columns: repeat(2, 1fr);
|
| 272 |
gap: 10px;
|
| 273 |
margin-bottom: 20px;
|
| 274 |
-
font-size: 0.9em;
|
| 275 |
-
|
|
|
|
|
|
|
|
|
|
| 276 |
<span style='margin-right: 5px;'>👤</span> {author}
|
| 277 |
</div>
|
| 278 |
-
<div style='color: #
|
| 279 |
<span style='margin-right: 5px;'>❤️</span> {likes}
|
| 280 |
</div>
|
| 281 |
-
<div style='color: #
|
| 282 |
<span style='margin-right: 5px;'>📅</span> {created}
|
| 283 |
</div>
|
| 284 |
</div>
|
|
|
|
| 142 |
<span>🛠️ {sdk}</span>
|
| 143 |
</div>
|
| 144 |
"""
|
| 145 |
+
|
| 146 |
+
# Spaces용 파스텔톤 그라데이션 배경
|
| 147 |
+
content_bg = """
|
| 148 |
+
background: linear-gradient(135deg,
|
| 149 |
+
rgba(255, 182, 193, 0.7), /* 파스텔 핑크 */
|
| 150 |
+
rgba(173, 216, 230, 0.7), /* 파스텔 블루 */
|
| 151 |
+
rgba(255, 218, 185, 0.7) /* 파스텔 피치 */
|
| 152 |
+
);
|
| 153 |
+
backdrop-filter: blur(10px);
|
| 154 |
+
"""
|
| 155 |
else:
|
| 156 |
# Models와 Datasets 처리
|
| 157 |
url = f"https://huggingface.co/{item_id}" if card_type == "model" else f"https://huggingface.co/datasets/{item_id}"
|
| 158 |
type_icon = "🤖" if card_type == "model" else "📊"
|
| 159 |
type_label = "MODEL" if card_type == "model" else "DATASET"
|
| 160 |
bg_color = "#6e8efb" if card_type == "model" else "#ff6b6b"
|
| 161 |
+
content_bg = "background: #f5f5f5;"
|
| 162 |
|
| 163 |
# 태그 기반 배경
|
| 164 |
bg_content = f"""
|
|
|
|
| 262 |
<!-- 콘텐츠 영역 -->
|
| 263 |
<div style='
|
| 264 |
padding: 20px;
|
| 265 |
+
{content_bg}
|
| 266 |
+
border-radius: 0 0 20px 20px;
|
| 267 |
+
border-top: 1px solid rgba(255,255,255,0.5);'>
|
| 268 |
<h3 style='
|
| 269 |
margin: 0 0 15px 0;
|
| 270 |
color: #333;
|
|
|
|
| 274 |
-webkit-line-clamp: 2;
|
| 275 |
-webkit-box-orient: vertical;
|
| 276 |
overflow: hidden;
|
| 277 |
+
text-overflow: ellipsis;
|
| 278 |
+
text-shadow: 1px 1px 1px rgba(255,255,255,0.8);'>
|
| 279 |
{title}
|
| 280 |
</h3>
|
| 281 |
|
|
|
|
| 284 |
grid-template-columns: repeat(2, 1fr);
|
| 285 |
gap: 10px;
|
| 286 |
margin-bottom: 20px;
|
| 287 |
+
font-size: 0.9em;
|
| 288 |
+
background: rgba(255,255,255,0.3);
|
| 289 |
+
padding: 10px;
|
| 290 |
+
border-radius: 10px;'>
|
| 291 |
+
<div style='color: #444;'>
|
| 292 |
<span style='margin-right: 5px;'>👤</span> {author}
|
| 293 |
</div>
|
| 294 |
+
<div style='color: #444;'>
|
| 295 |
<span style='margin-right: 5px;'>❤️</span> {likes}
|
| 296 |
</div>
|
| 297 |
+
<div style='color: #444; grid-column: span 2;'>
|
| 298 |
<span style='margin-right: 5px;'>📅</span> {created}
|
| 299 |
</div>
|
| 300 |
</div>
|