Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- src/routes/landingPageHtml.ts +106 -2
src/routes/landingPageHtml.ts
CHANGED
@@ -26,7 +26,11 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
26 |
--radius: 14px;
|
27 |
--shadow: 0 4px 24px #0002;
|
28 |
}
|
29 |
-
html, body {
|
|
|
|
|
|
|
|
|
30 |
body {
|
31 |
font-family: 'Inter', Arial, sans-serif;
|
32 |
background: var(--bg);
|
@@ -35,6 +39,12 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
35 |
min-height: 100vh;
|
36 |
display: flex;
|
37 |
flex-direction: column;
|
|
|
|
|
|
|
|
|
|
|
|
|
38 |
}
|
39 |
.sticky-header {
|
40 |
position: sticky;
|
@@ -43,6 +53,7 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
43 |
background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 100%);
|
44 |
color: #fff;
|
45 |
box-shadow: 0 2px 12px #0001;
|
|
|
46 |
}
|
47 |
.header-inner {
|
48 |
max-width: 1100px;
|
@@ -51,11 +62,14 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
51 |
align-items: center;
|
52 |
justify-content: space-between;
|
53 |
padding: 1.5rem 1.5rem 1.2rem 1.5rem;
|
|
|
|
|
54 |
}
|
55 |
.header-title {
|
56 |
display: flex;
|
57 |
align-items: center;
|
58 |
gap: 0.8rem;
|
|
|
59 |
}
|
60 |
.header-title svg {
|
61 |
height: 2.2rem;
|
@@ -67,6 +81,9 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
67 |
font-weight: 700;
|
68 |
margin: 0;
|
69 |
letter-spacing: -1px;
|
|
|
|
|
|
|
70 |
}
|
71 |
.github-btn {
|
72 |
background: #fff2;
|
@@ -81,6 +98,7 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
81 |
align-items: center;
|
82 |
gap: 0.5em;
|
83 |
transition: background 0.2s, color 0.2s;
|
|
|
84 |
}
|
85 |
.github-btn:hover {
|
86 |
background: #fff;
|
@@ -94,6 +112,8 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
94 |
display: flex;
|
95 |
flex-direction: column;
|
96 |
gap: 2.5rem;
|
|
|
|
|
97 |
}
|
98 |
.hero {
|
99 |
background: linear-gradient(120deg, #dbeafe 0%, #f0fdf4 100%);
|
@@ -106,17 +126,23 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
106 |
text-align: center;
|
107 |
position: relative;
|
108 |
overflow: hidden;
|
|
|
|
|
109 |
}
|
110 |
.hero h2 {
|
111 |
font-size: 2rem;
|
112 |
font-weight: 700;
|
113 |
margin: 0 0 0.7rem 0;
|
114 |
color: var(--primary-dark);
|
|
|
|
|
115 |
}
|
116 |
.hero p {
|
117 |
font-size: 1.18rem;
|
118 |
color: var(--muted);
|
119 |
margin: 0 0 1.5rem 0;
|
|
|
|
|
120 |
}
|
121 |
.api-endpoint-box {
|
122 |
background: #fff;
|
@@ -132,6 +158,8 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
132 |
flex-direction: column;
|
133 |
align-items: center;
|
134 |
gap: 0.5em;
|
|
|
|
|
135 |
}
|
136 |
.api-endpoint-url {
|
137 |
display: inline-block;
|
@@ -144,6 +172,8 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
144 |
border: 1px solid #cbd5e1;
|
145 |
margin: 0.5em 0 0.5em 0;
|
146 |
word-break: break-all;
|
|
|
|
|
147 |
}
|
148 |
.copy-endpoint-btn {
|
149 |
position: absolute;
|
@@ -159,6 +189,7 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
159 |
opacity: 0.85;
|
160 |
transition: background 0.2s, opacity 0.2s;
|
161 |
z-index: 2;
|
|
|
162 |
}
|
163 |
.copy-endpoint-btn:hover { background: var(--primary-dark); opacity: 1; }
|
164 |
.copy-endpoint-btn.copied { background: #388e3c; color: #fff; opacity: 1; }
|
@@ -174,6 +205,7 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
174 |
transition: background 0.2s;
|
175 |
box-shadow: 0 2px 8px #2563eb20;
|
176 |
display: inline-block;
|
|
|
177 |
}
|
178 |
.cta:hover { background: var(--primary-dark); }
|
179 |
.features {
|
@@ -181,6 +213,8 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
181 |
grid-template-columns: repeat(2, 1fr); /* 2 columns for 2x2 grid */
|
182 |
gap: 1.5rem;
|
183 |
margin: 2rem 0 0 0;
|
|
|
|
|
184 |
}
|
185 |
.feature-card {
|
186 |
background: var(--card-bg);
|
@@ -195,6 +229,8 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
195 |
min-height: 120px;
|
196 |
position: relative;
|
197 |
transition: box-shadow 0.2s, border 0.2s;
|
|
|
|
|
198 |
}
|
199 |
.feature-card:hover {
|
200 |
box-shadow: 0 4px 16px #2563eb22;
|
@@ -206,12 +242,17 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
206 |
}
|
207 |
.examples-section {
|
208 |
margin-top: 2.5rem;
|
|
|
|
|
209 |
}
|
210 |
.examples-tabs {
|
211 |
display: flex;
|
212 |
gap: 0.5em;
|
213 |
margin-bottom: 1.2em;
|
214 |
border-bottom: 2px solid #e5e7eb;
|
|
|
|
|
|
|
215 |
}
|
216 |
.examples-tab {
|
217 |
background: none;
|
@@ -223,6 +264,7 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
223 |
cursor: pointer;
|
224 |
border-radius: 8px 8px 0 0;
|
225 |
transition: color 0.2s, background 0.2s;
|
|
|
226 |
}
|
227 |
.examples-tab.active {
|
228 |
color: var(--primary-dark);
|
@@ -239,12 +281,19 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
239 |
font-size: 0.98rem;
|
240 |
position: relative;
|
241 |
margin: 0.5em 0 0.5em 0;
|
|
|
|
|
|
|
242 |
}
|
243 |
code {
|
244 |
font-family: 'Fira Mono', 'Consolas', monospace;
|
245 |
font-size: 1em;
|
246 |
background: none;
|
247 |
color: #222;
|
|
|
|
|
|
|
|
|
248 |
}
|
249 |
.copy-btn {
|
250 |
position: absolute;
|
@@ -260,6 +309,7 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
260 |
opacity: 0.7;
|
261 |
transition: opacity 0.2s, background 0.2s;
|
262 |
z-index: 2;
|
|
|
263 |
}
|
264 |
.copy-btn:hover { opacity: 1; background: #c9d3e6; }
|
265 |
.copy-btn.copied { color: #388e3c; background: #d0f5dd; opacity: 1; }
|
@@ -272,6 +322,8 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
272 |
text-align: center;
|
273 |
color: var(--muted);
|
274 |
font-size: 1.08em;
|
|
|
|
|
275 |
}
|
276 |
.more-info-footer ul {
|
277 |
list-style: none;
|
@@ -281,6 +333,8 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
281 |
flex-wrap: wrap;
|
282 |
gap: 1.5em;
|
283 |
justify-content: center;
|
|
|
|
|
284 |
}
|
285 |
.more-info-footer a {
|
286 |
color: var(--primary-dark);
|
@@ -290,10 +344,60 @@ export function getLandingPageHtml(req: Request, res: Response): void {
|
|
290 |
}
|
291 |
.more-info-footer a:hover { color: var(--primary); }
|
292 |
@media (max-width: 700px) {
|
293 |
-
.header-inner {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
294 |
.header-title h1 { font-size: 1.5rem; }
|
295 |
main { padding: 1.2rem; }
|
296 |
.hero { padding: 1.2rem 0.7rem 1.2rem 0.7rem; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
297 |
}
|
298 |
</style>
|
299 |
<!-- Prism.js for syntax highlighting -->
|
|
|
26 |
--radius: 14px;
|
27 |
--shadow: 0 4px 24px #0002;
|
28 |
}
|
29 |
+
html, body {
|
30 |
+
height: 100%;
|
31 |
+
max-width: 100vw;
|
32 |
+
overflow-x: hidden;
|
33 |
+
}
|
34 |
body {
|
35 |
font-family: 'Inter', Arial, sans-serif;
|
36 |
background: var(--bg);
|
|
|
39 |
min-height: 100vh;
|
40 |
display: flex;
|
41 |
flex-direction: column;
|
42 |
+
width: 100%;
|
43 |
+
box-sizing: border-box;
|
44 |
+
}
|
45 |
+
.header-inner, main, .hero, .api-endpoint-box, .features, .feature-card, .examples-section, .more-info-footer {
|
46 |
+
width: 100%;
|
47 |
+
box-sizing: border-box;
|
48 |
}
|
49 |
.sticky-header {
|
50 |
position: sticky;
|
|
|
53 |
background: linear-gradient(90deg, var(--primary) 0%, #60a5fa 100%);
|
54 |
color: #fff;
|
55 |
box-shadow: 0 2px 12px #0001;
|
56 |
+
width: 100%;
|
57 |
}
|
58 |
.header-inner {
|
59 |
max-width: 1100px;
|
|
|
62 |
align-items: center;
|
63 |
justify-content: space-between;
|
64 |
padding: 1.5rem 1.5rem 1.2rem 1.5rem;
|
65 |
+
width: 100%;
|
66 |
+
box-sizing: border-box;
|
67 |
}
|
68 |
.header-title {
|
69 |
display: flex;
|
70 |
align-items: center;
|
71 |
gap: 0.8rem;
|
72 |
+
min-width: 0;
|
73 |
}
|
74 |
.header-title svg {
|
75 |
height: 2.2rem;
|
|
|
81 |
font-weight: 700;
|
82 |
margin: 0;
|
83 |
letter-spacing: -1px;
|
84 |
+
white-space: pre-line;
|
85 |
+
word-break: break-word;
|
86 |
+
overflow-wrap: anywhere;
|
87 |
}
|
88 |
.github-btn {
|
89 |
background: #fff2;
|
|
|
98 |
align-items: center;
|
99 |
gap: 0.5em;
|
100 |
transition: background 0.2s, color 0.2s;
|
101 |
+
min-width: 0;
|
102 |
}
|
103 |
.github-btn:hover {
|
104 |
background: #fff;
|
|
|
112 |
display: flex;
|
113 |
flex-direction: column;
|
114 |
gap: 2.5rem;
|
115 |
+
width: 100%;
|
116 |
+
box-sizing: border-box;
|
117 |
}
|
118 |
.hero {
|
119 |
background: linear-gradient(120deg, #dbeafe 0%, #f0fdf4 100%);
|
|
|
126 |
text-align: center;
|
127 |
position: relative;
|
128 |
overflow: hidden;
|
129 |
+
width: 100%;
|
130 |
+
box-sizing: border-box;
|
131 |
}
|
132 |
.hero h2 {
|
133 |
font-size: 2rem;
|
134 |
font-weight: 700;
|
135 |
margin: 0 0 0.7rem 0;
|
136 |
color: var(--primary-dark);
|
137 |
+
word-break: break-word;
|
138 |
+
overflow-wrap: anywhere;
|
139 |
}
|
140 |
.hero p {
|
141 |
font-size: 1.18rem;
|
142 |
color: var(--muted);
|
143 |
margin: 0 0 1.5rem 0;
|
144 |
+
word-break: break-word;
|
145 |
+
overflow-wrap: anywhere;
|
146 |
}
|
147 |
.api-endpoint-box {
|
148 |
background: #fff;
|
|
|
158 |
flex-direction: column;
|
159 |
align-items: center;
|
160 |
gap: 0.5em;
|
161 |
+
width: 100%;
|
162 |
+
box-sizing: border-box;
|
163 |
}
|
164 |
.api-endpoint-url {
|
165 |
display: inline-block;
|
|
|
172 |
border: 1px solid #cbd5e1;
|
173 |
margin: 0.5em 0 0.5em 0;
|
174 |
word-break: break-all;
|
175 |
+
overflow-wrap: anywhere;
|
176 |
+
max-width: 100%;
|
177 |
}
|
178 |
.copy-endpoint-btn {
|
179 |
position: absolute;
|
|
|
189 |
opacity: 0.85;
|
190 |
transition: background 0.2s, opacity 0.2s;
|
191 |
z-index: 2;
|
192 |
+
min-width: 0;
|
193 |
}
|
194 |
.copy-endpoint-btn:hover { background: var(--primary-dark); opacity: 1; }
|
195 |
.copy-endpoint-btn.copied { background: #388e3c; color: #fff; opacity: 1; }
|
|
|
205 |
transition: background 0.2s;
|
206 |
box-shadow: 0 2px 8px #2563eb20;
|
207 |
display: inline-block;
|
208 |
+
max-width: 100%;
|
209 |
}
|
210 |
.cta:hover { background: var(--primary-dark); }
|
211 |
.features {
|
|
|
213 |
grid-template-columns: repeat(2, 1fr); /* 2 columns for 2x2 grid */
|
214 |
gap: 1.5rem;
|
215 |
margin: 2rem 0 0 0;
|
216 |
+
width: 100%;
|
217 |
+
box-sizing: border-box;
|
218 |
}
|
219 |
.feature-card {
|
220 |
background: var(--card-bg);
|
|
|
229 |
min-height: 120px;
|
230 |
position: relative;
|
231 |
transition: box-shadow 0.2s, border 0.2s;
|
232 |
+
width: 100%;
|
233 |
+
box-sizing: border-box;
|
234 |
}
|
235 |
.feature-card:hover {
|
236 |
box-shadow: 0 4px 16px #2563eb22;
|
|
|
242 |
}
|
243 |
.examples-section {
|
244 |
margin-top: 2.5rem;
|
245 |
+
width: 100%;
|
246 |
+
box-sizing: border-box;
|
247 |
}
|
248 |
.examples-tabs {
|
249 |
display: flex;
|
250 |
gap: 0.5em;
|
251 |
margin-bottom: 1.2em;
|
252 |
border-bottom: 2px solid #e5e7eb;
|
253 |
+
width: 100%;
|
254 |
+
box-sizing: border-box;
|
255 |
+
min-width: 0;
|
256 |
}
|
257 |
.examples-tab {
|
258 |
background: none;
|
|
|
264 |
cursor: pointer;
|
265 |
border-radius: 8px 8px 0 0;
|
266 |
transition: color 0.2s, background 0.2s;
|
267 |
+
min-width: 0;
|
268 |
}
|
269 |
.examples-tab.active {
|
270 |
color: var(--primary-dark);
|
|
|
281 |
font-size: 0.98rem;
|
282 |
position: relative;
|
283 |
margin: 0.5em 0 0.5em 0;
|
284 |
+
width: 100%;
|
285 |
+
box-sizing: border-box;
|
286 |
+
max-width: 100vw;
|
287 |
}
|
288 |
code {
|
289 |
font-family: 'Fira Mono', 'Consolas', monospace;
|
290 |
font-size: 1em;
|
291 |
background: none;
|
292 |
color: #222;
|
293 |
+
word-break: break-word;
|
294 |
+
overflow-wrap: anywhere;
|
295 |
+
max-width: 100%;
|
296 |
+
display: block;
|
297 |
}
|
298 |
.copy-btn {
|
299 |
position: absolute;
|
|
|
309 |
opacity: 0.7;
|
310 |
transition: opacity 0.2s, background 0.2s;
|
311 |
z-index: 2;
|
312 |
+
min-width: 0;
|
313 |
}
|
314 |
.copy-btn:hover { opacity: 1; background: #c9d3e6; }
|
315 |
.copy-btn.copied { color: #388e3c; background: #d0f5dd; opacity: 1; }
|
|
|
322 |
text-align: center;
|
323 |
color: var(--muted);
|
324 |
font-size: 1.08em;
|
325 |
+
width: 100%;
|
326 |
+
box-sizing: border-box;
|
327 |
}
|
328 |
.more-info-footer ul {
|
329 |
list-style: none;
|
|
|
333 |
flex-wrap: wrap;
|
334 |
gap: 1.5em;
|
335 |
justify-content: center;
|
336 |
+
width: 100%;
|
337 |
+
box-sizing: border-box;
|
338 |
}
|
339 |
.more-info-footer a {
|
340 |
color: var(--primary-dark);
|
|
|
344 |
}
|
345 |
.more-info-footer a:hover { color: var(--primary); }
|
346 |
@media (max-width: 700px) {
|
347 |
+
.header-inner {
|
348 |
+
flex-direction: row;
|
349 |
+
align-items: center;
|
350 |
+
gap: 1.2em;
|
351 |
+
width: 100%;
|
352 |
+
flex-wrap: nowrap;
|
353 |
+
}
|
354 |
+
.header-title { flex-shrink: 1; min-width: 0; }
|
355 |
+
.github-btn { margin-left: auto; }
|
356 |
.header-title h1 { font-size: 1.5rem; }
|
357 |
main { padding: 1.2rem; }
|
358 |
.hero { padding: 1.2rem 0.7rem 1.2rem 0.7rem; }
|
359 |
+
.features { grid-template-columns: 1fr; gap: 1.1rem; }
|
360 |
+
.feature-card { min-height: unset; font-size: 0.98em; }
|
361 |
+
.api-endpoint-box { padding: 1rem 0.7rem; font-size: 1em; }
|
362 |
+
.api-endpoint-url { font-size: 1em; }
|
363 |
+
.cta { padding: 0.8rem 1.5rem; font-size: 1rem; }
|
364 |
+
.examples-section { margin-top: 1.5rem; }
|
365 |
+
.examples-tabs { flex-wrap: wrap; gap: 0.2em; }
|
366 |
+
.examples-tab { font-size: 1em; padding: 0.5em 0.7em 0.4em 0.7em; }
|
367 |
+
pre { font-size: 0.92rem; padding: 0.8rem 0.5rem; }
|
368 |
+
.copy-btn { top: 6px; right: 6px; font-size: 0.9em; padding: 0.15em 0.5em; }
|
369 |
+
.api-endpoint-box > div[style*="font-size"] {
|
370 |
+
font-size: 0.95em !important;
|
371 |
+
white-space: normal;
|
372 |
+
word-break: break-word;
|
373 |
+
overflow-wrap: anywhere;
|
374 |
+
}
|
375 |
+
}
|
376 |
+
@media (max-width: 500px) {
|
377 |
+
.header-inner { padding: 1rem 0.5rem 1rem 0.5rem; }
|
378 |
+
.header-title h1 { font-size: 1.1rem; }
|
379 |
+
.header-title svg, .header-title img { height: 2.2rem !important; width: 2.2rem !important; }
|
380 |
+
main { padding: 0.5rem; }
|
381 |
+
.hero { padding: 0.7rem 0.2rem 0.7rem 0.2rem; }
|
382 |
+
.features { gap: 0.7rem; }
|
383 |
+
.feature-card { padding: 0.7rem 0.5rem; font-size: 0.92em; }
|
384 |
+
.api-endpoint-box { padding: 0.7rem 0.3rem; font-size: 0.95em; }
|
385 |
+
.api-endpoint-url { font-size: 0.95em; }
|
386 |
+
.cta { padding: 0.6rem 1rem; font-size: 0.95rem; }
|
387 |
+
.examples-section { margin-top: 1rem; }
|
388 |
+
.examples-tabs { gap: 0.1em; }
|
389 |
+
.examples-tab { font-size: 0.95em; padding: 0.4em 0.5em 0.3em 0.5em; }
|
390 |
+
pre { font-size: 0.88rem; padding: 0.6rem 0.2rem; }
|
391 |
+
.copy-btn { top: 4px; right: 4px; font-size: 0.85em; padding: 0.1em 0.3em; }
|
392 |
+
.more-info-footer { font-size: 0.98em; padding: 1rem 0.2rem 1rem 0.2rem; }
|
393 |
+
.api-endpoint-box > div[style*="font-size"] {
|
394 |
+
font-size: 0.88em !important;
|
395 |
+
}
|
396 |
+
}
|
397 |
+
/* Make code blocks and tabs horizontally scrollable on small screens */
|
398 |
+
@media (max-width: 700px) {
|
399 |
+
.examples-tabs { overflow-x: auto; }
|
400 |
+
pre { overflow-x: auto; }
|
401 |
}
|
402 |
</style>
|
403 |
<!-- Prism.js for syntax highlighting -->
|