Spaces:
Sleeping
Sleeping
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>
|