openfree commited on
Commit
9c0a3cf
β€’
1 Parent(s): 047cbf6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +151 -26
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: 20px;
104
- margin: 10px;
105
- border-radius: 15px;
106
- box-shadow: 0 4px 8px rgba(0,0,0,0.1);
107
- background-image: linear-gradient({bg_color}, {bg_color}),
108
- url(data:image/png;base64,{screenshot if screenshot else ''});
109
- background-size: cover;
110
- background-position: center;
111
- background-blend-mode: overlay;
112
- transition: transform 0.3s ease;
113
- min-height: 200px;'>
 
 
114
 
 
115
  <div style='
116
- background: rgba(255, 255, 255, 0.95);
117
- padding: 15px;
118
- border-radius: 10px;
119
- backdrop-filter: blur(5px);'>
120
- <div style='font-size: 1.2em; font-weight: bold; color: #333;'>#{index + 1} {title}</div>
121
- <p style='margin: 5px 0; color: #666;'>πŸ‘€ {author}</p>
122
- <p style='margin: 5px 0; color: #666;'>πŸ› οΈ {sdk}</p>
123
- <p style='margin: 5px 0; color: #666;'>❀️ {likes}</p>
124
- <p style='margin: 5px 0; color: #666;'>πŸ“… {created}</p>
125
- <a href='{url}' target='_blank'
126
- style='display: inline-block; margin-top: 10px; padding: 5px 10px;
127
- background: #007bff; color: white; text-decoration: none;
128
- border-radius: 5px;'>
129
- πŸ”— View Space
130
- </a>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
  """