Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -99,35 +99,160 @@ def get_space_card(space: dict, index: int) -> str:
|
|
99 |
|
100 |
return f"""
|
101 |
<div class="space-card" style='
|
|
|
102 |
border: none;
|
103 |
-
padding:
|
104 |
-
margin: 10px;
|
105 |
-
border-radius:
|
106 |
-
box-shadow: 0
|
107 |
-
background
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
|
|
114 |
|
|
|
115 |
<div style='
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
<
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
</div>
|
132 |
</div>
|
133 |
"""
|
|
|
99 |
|
100 |
return f"""
|
101 |
<div class="space-card" style='
|
102 |
+
position: relative;
|
103 |
border: none;
|
104 |
+
padding: 0;
|
105 |
+
margin: 10px;
|
106 |
+
border-radius: 20px;
|
107 |
+
box-shadow: 0 10px 20px rgba(0,0,0,0.1);
|
108 |
+
background: white;
|
109 |
+
transition: all 0.3s ease;
|
110 |
+
overflow: hidden;
|
111 |
+
min-height: 400px;
|
112 |
+
cursor: pointer;
|
113 |
+
transform-origin: center;'
|
114 |
+
onmouseover="this.style.transform='scale(1.02)'; this.style.boxShadow='0 15px 30px rgba(0,0,0,0.15)';"
|
115 |
+
onmouseout="this.style.transform='scale(1)'; this.style.boxShadow='0 10px 20px rgba(0,0,0,0.1)';"
|
116 |
+
onclick="window.open('{url}', '_blank')">
|
117 |
|
118 |
+
<!-- μ€ν¬λ¦°μ· μμ -->
|
119 |
<div style='
|
120 |
+
width: 100%;
|
121 |
+
height: 200px;
|
122 |
+
background-image: url(data:image/png;base64,{screenshot if screenshot else ''});
|
123 |
+
background-size: cover;
|
124 |
+
background-position: center;
|
125 |
+
border-bottom: 3px solid {bg_color};
|
126 |
+
position: relative;'>
|
127 |
+
|
128 |
+
<!-- μμ λ±μ§ -->
|
129 |
+
<div style='
|
130 |
+
position: absolute;
|
131 |
+
top: 10px;
|
132 |
+
left: 10px;
|
133 |
+
background: rgba(0,0,0,0.7);
|
134 |
+
color: white;
|
135 |
+
padding: 5px 15px;
|
136 |
+
border-radius: 20px;
|
137 |
+
font-weight: bold;
|
138 |
+
font-size: 0.9em;
|
139 |
+
backdrop-filter: blur(5px);'>
|
140 |
+
#{index + 1}
|
141 |
+
</div>
|
142 |
+
|
143 |
+
<!-- SDK λ±μ§ -->
|
144 |
+
<div style='
|
145 |
+
position: absolute;
|
146 |
+
top: 10px;
|
147 |
+
right: 10px;
|
148 |
+
background: {bg_color};
|
149 |
+
padding: 5px 15px;
|
150 |
+
border-radius: 20px;
|
151 |
+
font-weight: bold;
|
152 |
+
font-size: 0.8em;
|
153 |
+
backdrop-filter: blur(5px);'>
|
154 |
+
π οΈ {sdk}
|
155 |
+
</div>
|
156 |
+
</div>
|
157 |
+
|
158 |
+
<!-- μ½ν
μΈ μμ -->
|
159 |
+
<div style='
|
160 |
+
padding: 20px;
|
161 |
+
background: white;'>
|
162 |
+
|
163 |
+
<!-- μ λͺ© -->
|
164 |
+
<h3 style='
|
165 |
+
margin: 0 0 15px 0;
|
166 |
+
color: #333;
|
167 |
+
font-size: 1.3em;
|
168 |
+
line-height: 1.4;
|
169 |
+
display: -webkit-box;
|
170 |
+
-webkit-line-clamp: 2;
|
171 |
+
-webkit-box-orient: vertical;
|
172 |
+
overflow: hidden;
|
173 |
+
text-overflow: ellipsis;'>
|
174 |
+
{title}
|
175 |
+
</h3>
|
176 |
+
|
177 |
+
<!-- λ©ν μ 보 그리λ -->
|
178 |
+
<div style='
|
179 |
+
display: grid;
|
180 |
+
grid-template-columns: repeat(2, 1fr);
|
181 |
+
gap: 10px;
|
182 |
+
margin-bottom: 20px;
|
183 |
+
font-size: 0.9em;'>
|
184 |
+
|
185 |
+
<div style='
|
186 |
+
display: flex;
|
187 |
+
align-items: center;
|
188 |
+
color: #666;'>
|
189 |
+
<span style='margin-right: 5px;'>π€</span> {author}
|
190 |
+
</div>
|
191 |
+
|
192 |
+
<div style='
|
193 |
+
display: flex;
|
194 |
+
align-items: center;
|
195 |
+
color: #666;'>
|
196 |
+
<span style='margin-right: 5px;'>β€οΈ</span> {likes}
|
197 |
+
</div>
|
198 |
+
|
199 |
+
<div style='
|
200 |
+
display: flex;
|
201 |
+
align-items: center;
|
202 |
+
color: #666;
|
203 |
+
grid-column: span 2;'>
|
204 |
+
<span style='margin-right: 5px;'>π
</span> {created}
|
205 |
+
</div>
|
206 |
+
</div>
|
207 |
+
|
208 |
+
<!-- μ‘μ
λ²νΌ -->
|
209 |
+
<div style='
|
210 |
+
display: flex;
|
211 |
+
justify-content: space-between;
|
212 |
+
align-items: center;'>
|
213 |
+
|
214 |
+
<a href='{url}' target='_blank'
|
215 |
+
style='
|
216 |
+
display: inline-flex;
|
217 |
+
align-items: center;
|
218 |
+
padding: 8px 20px;
|
219 |
+
background: linear-gradient(135deg, #6e8efb, #4a6cf7);
|
220 |
+
color: white;
|
221 |
+
text-decoration: none;
|
222 |
+
border-radius: 25px;
|
223 |
+
font-weight: 500;
|
224 |
+
transition: all 0.3s ease;
|
225 |
+
box-shadow: 0 4px 15px rgba(74,108,247,0.2);'
|
226 |
+
onmouseover="this.style.transform='translateY(-2px)'; this.style.boxShadow='0 6px 20px rgba(74,108,247,0.3)';"
|
227 |
+
onmouseout="this.style.transform='translateY(0)'; this.style.boxShadow='0 4px 15px rgba(74,108,247,0.2)';">
|
228 |
+
View Space <span style='margin-left: 8px;'>β</span>
|
229 |
+
</a>
|
230 |
+
|
231 |
+
<div style='
|
232 |
+
display: flex;
|
233 |
+
gap: 10px;'>
|
234 |
+
<div style='
|
235 |
+
padding: 8px;
|
236 |
+
background: #f5f5f5;
|
237 |
+
border-radius: 50%;
|
238 |
+
cursor: pointer;
|
239 |
+
transition: all 0.3s ease;'
|
240 |
+
onmouseover="this.style.background='#ebebeb';"
|
241 |
+
onmouseout="this.style.background='#f5f5f5';">
|
242 |
+
β
|
243 |
+
</div>
|
244 |
+
<div style='
|
245 |
+
padding: 8px;
|
246 |
+
background: #f5f5f5;
|
247 |
+
border-radius: 50%;
|
248 |
+
cursor: pointer;
|
249 |
+
transition: all 0.3s ease;'
|
250 |
+
onmouseover="this.style.background='#ebebeb';"
|
251 |
+
onmouseout="this.style.background='#f5f5f5';">
|
252 |
+
π
|
253 |
+
</div>
|
254 |
+
</div>
|
255 |
+
</div>
|
256 |
</div>
|
257 |
</div>
|
258 |
"""
|