eleasm commited on
Commit
fe0bb40
·
verified ·
1 Parent(s): 8859869

Update app.py from anycoder

Browse files
Files changed (1) hide show
  1. app.py +386 -0
app.py ADDED
@@ -0,0 +1,386 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ # HTML content for the landing page (body content only)
4
+ html_content = """
5
+ <style>
6
+ * {
7
+ margin: 0;
8
+ padding: 0;
9
+ box-sizing: border-box;
10
+ }
11
+
12
+ :root {
13
+ --primary: #ff6b6b;
14
+ --secondary: #4ecdc4;
15
+ --accent: #ffe66d;
16
+ --dark: #2d3436;
17
+ --light: #f8f9fa;
18
+ }
19
+
20
+ body {
21
+ font-family: 'Poppins', sans-serif;
22
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
23
+ min-height: 100vh;
24
+ display: flex;
25
+ align-items: center;
26
+ justify-content: center;
27
+ overflow: hidden;
28
+ }
29
+
30
+ .container {
31
+ position: relative;
32
+ width: 100%;
33
+ max-width: 1200px;
34
+ padding: 2rem;
35
+ }
36
+
37
+ .hero {
38
+ text-align: center;
39
+ color: white;
40
+ position: relative;
41
+ z-index: 2;
42
+ }
43
+
44
+ .greeting {
45
+ font-size: clamp(4rem, 15vw, 10rem);
46
+ font-weight: 900;
47
+ letter-spacing: -0.05em;
48
+ text-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
49
+ animation: float 3s ease-in-out infinite;
50
+ background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
51
+ -webkit-background-clip: text;
52
+ -webkit-text-fill-color: transparent;
53
+ background-clip: text;
54
+ }
55
+
56
+ @keyframes float {
57
+
58
+ 0%,
59
+ 100% {
60
+ transform: translateY(0);
61
+ }
62
+
63
+ 50% {
64
+ transform: translateY(-20px);
65
+ }
66
+ }
67
+
68
+ .subtitle {
69
+ font-size: clamp(1rem, 3vw, 1.5rem);
70
+ font-weight: 300;
71
+ margin-top: 1rem;
72
+ opacity: 0.9;
73
+ animation: fadeInUp 1s ease-out 0.3s both;
74
+ }
75
+
76
+ @keyframes fadeInUp {
77
+ from {
78
+ opacity: 0;
79
+ transform: translateY(30px);
80
+ }
81
+
82
+ to {
83
+ opacity: 1;
84
+ transform: translateY(0);
85
+ }
86
+ }
87
+
88
+ .buttons {
89
+ margin-top: 3rem;
90
+ display: flex;
91
+ gap: 1rem;
92
+ justify-content: center;
93
+ flex-wrap: wrap;
94
+ animation: fadeInUp 1s ease-out 0.6s both;
95
+ }
96
+
97
+ .btn {
98
+ padding: 1rem 2.5rem;
99
+ border: none;
100
+ border-radius: 50px;
101
+ font-size: 1rem;
102
+ font-weight: 600;
103
+ cursor: pointer;
104
+ transition: all 0.3s ease;
105
+ text-decoration: none;
106
+ display: inline-flex;
107
+ align-items: center;
108
+ gap: 0.5rem;
109
+ }
110
+
111
+ .btn-primary {
112
+ background: white;
113
+ color: #667eea;
114
+ }
115
+
116
+ .btn-primary:hover {
117
+ transform: translateY(-3px);
118
+ box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
119
+ }
120
+
121
+ .btn-secondary {
122
+ background: transparent;
123
+ color: white;
124
+ border: 2px solid white;
125
+ }
126
+
127
+ .btn-secondary:hover {
128
+ background: white;
129
+ color: #667eea;
130
+ transform: translateY(-3px);
131
+ }
132
+
133
+ /* Floating shapes */
134
+ .shape {
135
+ position: absolute;
136
+ border-radius: 50%;
137
+ animation: floatShape 6s ease-in-out infinite;
138
+ }
139
+
140
+ .shape-1 {
141
+ width: 300px;
142
+ height: 300px;
143
+ background: rgba(255, 255, 255, 0.1);
144
+ top: -100px;
145
+ left: -100px;
146
+ animation-delay: 0s;
147
+ }
148
+
149
+ .shape-2 {
150
+ width: 200px;
151
+ height: 200px;
152
+ background: rgba(255, 230, 109, 0.2);
153
+ bottom: 10%;
154
+ right: 5%;
155
+ animation-delay: -2s;
156
+ }
157
+
158
+ .shape-3 {
159
+ width: 150px;
160
+ height: 150px;
161
+ background: rgba(78, 205, 196, 0.2);
162
+ top: 30%;
163
+ right: -50px;
164
+ animation-delay: -4s;
165
+ }
166
+
167
+ @keyframes floatShape {
168
+
169
+ 0%,
170
+ 100% {
171
+ transform: translate(0, 0) rotate(0deg);
172
+ }
173
+
174
+ 33% {
175
+ transform: translate(30px, -30px) rotate(120deg);
176
+ }
177
+
178
+ 66% {
179
+ transform: translate(-20px, 20px) rotate(240deg);
180
+ }
181
+ }
182
+
183
+ /* Card Section */
184
+ .cards {
185
+ display: grid;
186
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
187
+ gap: 2rem;
188
+ margin-top: 4rem;
189
+ animation: fadeInUp 1s ease-out 0.9s both;
190
+ }
191
+
192
+ .card {
193
+ background: rgba(255, 255, 255, 0.15);
194
+ backdrop-filter: blur(10px);
195
+ border-radius: 20px;
196
+ padding: 2rem;
197
+ text-align: center;
198
+ transition: all 0.3s ease;
199
+ border: 1px solid rgba(255, 255, 255, 0.2);
200
+ }
201
+
202
+ .card:hover {
203
+ transform: translateY(-10px);
204
+ background: rgba(255, 255, 255, 0.25);
205
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
206
+ }
207
+
208
+ .card-icon {
209
+ font-size: 3rem;
210
+ margin-bottom: 1rem;
211
+ }
212
+
213
+ .card h3 {
214
+ font-size: 1.2rem;
215
+ margin-bottom: 0.5rem;
216
+ }
217
+
218
+ .card p {
219
+ font-size: 0.9rem;
220
+ opacity: 0.8;
221
+ }
222
+
223
+ /* Footer */
224
+ .footer {
225
+ position: fixed;
226
+ bottom: 1rem;
227
+ left: 50%;
228
+ transform: translateX(-50%);
229
+ font-size: 0.8rem;
230
+ color: rgba(255, 255, 255, 0.6);
231
+ }
232
+
233
+ .footer a {
234
+ color: white;
235
+ text-decoration: none;
236
+ font-weight: 600;
237
+ }
238
+
239
+ .footer a:hover {
240
+ text-decoration: underline;
241
+ }
242
+
243
+ /* Interactive greeting */
244
+ .interactive-area {
245
+ margin-top: 2rem;
246
+ animation: fadeInUp 1s ease-out 1.2s both;
247
+ }
248
+
249
+ .name-input {
250
+ padding: 1rem 2rem;
251
+ border: none;
252
+ border-radius: 50px;
253
+ font-size: 1rem;
254
+ font-family: inherit;
255
+ width: 100%;
256
+ max-width: 300px;
257
+ outline: none;
258
+ transition: all 0.3s ease;
259
+ }
260
+
261
+ .name-input:focus {
262
+ box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.3);
263
+ }
264
+
265
+ .personalized-greeting {
266
+ margin-top: 1.5rem;
267
+ font-size: 1.5rem;
268
+ font-weight: 600;
269
+ min-height: 2rem;
270
+ }
271
+
272
+ /* Responsive */
273
+ @media (max-width: 768px) {
274
+ .greeting {
275
+ font-size: 4rem;
276
+ }
277
+
278
+ .cards {
279
+ grid-template-columns: 1fr;
280
+ }
281
+ }
282
+ </style>
283
+
284
+ <div class="container">
285
+ <div class="shape shape-1"></div>
286
+ <div class="shape shape-2"></div>
287
+ <div class="shape shape-3"></div>
288
+
289
+ <div class="hero">
290
+ <h1 class="greeting">Olá!</h1>
291
+ <p class="subtitle">Bem-vindo a uma experiência incrível</p>
292
+
293
+ <div class="buttons">
294
+ <button class="btn btn-primary" onclick="explore()">
295
+ <span>🚀</span> Explorar
296
+ </button>
297
+ <button class="btn btn-secondary" onclick="learnMore()">
298
+ <span>ℹ️</span> Saber Mais
299
+ </button>
300
+ </div>
301
+
302
+ <div class="interactive-area">
303
+ <input type="text" class="name-input" placeholder="Digite seu nome..." id="nameInput" oninput="updateGreeting()">
304
+ <div class="personalized-greeting" id="personalizedGreeting"></div>
305
+ </div>
306
+
307
+ <div class="cards">
308
+ <div class="card">
309
+ <div class="card-icon">🎨</div>
310
+ <h3>Design Moderno</h3>
311
+ <p>Interface belamente projetada com as últimas tendências</p>
312
+ </div>
313
+ <div class="card">
314
+ <div class="card-icon">⚡</div>
315
+ <h3>Super Rápido</h3>
316
+ <p>Performance otimizada para a melhor experiência</p>
317
+ </div>
318
+ <div class="card">
319
+ <div class="card-icon">🎯</div>
320
+ <h3>Focado em Você</h3>
321
+ <p>Construído com atenção aos mínimos detalhes</p>
322
+ </div>
323
+ </div>
324
+ </div>
325
+ </div>
326
+
327
+ <div class="footer">
328
+ Built with <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank">anycoder</a>
329
+ </div>
330
+
331
+ <script>
332
+ function updateGreeting() {
333
+ const name = document.getElementById('nameInput').value;
334
+ const greeting = document.getElementById('personalizedGreeting');
335
+
336
+ if (name.trim()) {
337
+ const names = name.trim().split(' ');
338
+ const firstName = names[0];
339
+ greeting.textContent = `É um prazer conhecê-lo, ${firstName}! 👋`;
340
+ greeting.style.animation = 'none';
341
+ greeting.offsetHeight; /* trigger reflow */
342
+ greeting.style.animation = 'fadeInUp 0.5s ease-out';
343
+ } else {
344
+ greeting.textContent = '';
345
+ }
346
+ }
347
+
348
+ function explore() {
349
+ alert('🚀 Vamos explorar o mundo juntos!');
350
+ }
351
+
352
+ function learnMore() {
353
+ alert('ℹ️ Em breve mais informações sobre este projeto!');
354
+ }
355
+
356
+ // Add some interactivity with mouse movement
357
+ document.addEventListener('mousemove', (e) => {
358
+ const shapes = document.querySelectorAll('.shape');
359
+ const x = e.clientX / window.innerWidth;
360
+ const y = e.clientY / window.innerHeight;
361
+
362
+ shapes.forEach((shape, index) => {
363
+ const speed = (index + 1) * 20;
364
+ shape.style.transform = `translate(${x * speed}px, ${y * speed}px)`;
365
+ });
366
+ });
367
+ </script>
368
+ """
369
+
370
+ # JavaScript to inject fonts
371
+ head_content = """
372
+ <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700;900&display=swap" rel="stylesheet">
373
+ """
374
+
375
+ # Create the Gradio app
376
+ with gr.Blocks() as demo:
377
+ gr.HTML(html_content)
378
+
379
+ # Launch with theme and custom head
380
+ demo.launch(
381
+ theme=gr.themes.Soft(),
382
+ head=head_content,
383
+ footer_links=[
384
+ {"label": "Built with anycoder", "url": "https://huggingface.co/spaces/akhaliq/anycoder"}
385
+ ]
386
+ )