khirodsahoo93 commited on
Commit
ce52901
·
verified ·
1 Parent(s): 9e899b3

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -19
app.py CHANGED
@@ -383,13 +383,20 @@ body, .gradio-container {
383
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
384
  }
385
 
 
 
 
 
 
 
 
 
 
386
  .login-wrapper {
 
387
  display: flex;
388
- align-items: center;
389
  justify-content: center;
390
- min-height: 100vh;
391
- padding: 24px;
392
- background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
393
  }
394
 
395
  .login-card {
@@ -399,8 +406,21 @@ body, .gradio-container {
399
  backdrop-filter: blur(10px);
400
  border: 1px solid rgba(255, 255, 255, 0.3);
401
  border-radius: 20px;
402
- padding: 48px 40px;
403
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
 
 
 
 
 
 
 
 
 
 
 
 
 
404
  }
405
 
406
  .login-icon {
@@ -493,29 +513,31 @@ def create_interface():
493
  gr.update(value="" if ok else "Invalid password", visible=not ok)
494
  )
495
 
496
- # Login gate
497
- with gr.Group(visible=True) as login_group:
498
  gr.HTML("""
499
  <div class="login-wrapper">
500
  <div class="login-card">
501
  <div class="login-icon">🔐</div>
502
  <div class="login-title">Private Access</div>
503
  <div class="login-subtitle">Enter password to continue</div>
504
- """)
505
- pw = gr.Textbox(
506
- label="Password",
507
- type="password",
508
- placeholder="Enter password",
509
- elem_classes=["login-input"],
510
- container=True
511
- )
512
- login_btn = gr.Button("Continue", elem_classes=["modern-button"], size="lg")
513
- login_error = gr.Markdown(visible=False, elem_classes=["login-error"])
514
- gr.HTML("""
515
- <div class="freepik-credit">Background design inspired by <a href="https://www.freepik.com" target="_blank">Freepik</a></div>
516
  </div>
517
  </div>
518
  """)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
519
 
520
  # Main UI wrapped for toggling visibility
521
  with gr.Group(visible=False) as main_group:
 
383
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
384
  }
385
 
386
+ .login-column {
387
+ display: flex !important;
388
+ flex-direction: column !important;
389
+ align-items: center !important;
390
+ justify-content: center !important;
391
+ min-height: 100vh !important;
392
+ padding: 24px !important;
393
+ }
394
+
395
  .login-wrapper {
396
+ width: 100%;
397
  display: flex;
 
398
  justify-content: center;
399
+ margin-bottom: 24px;
 
 
400
  }
401
 
402
  .login-card {
 
406
  backdrop-filter: blur(10px);
407
  border: 1px solid rgba(255, 255, 255, 0.3);
408
  border-radius: 20px;
409
+ padding: 48px 40px 24px 40px;
410
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
411
+ text-align: center;
412
+ }
413
+
414
+ .login-form {
415
+ max-width: 400px !important;
416
+ width: 100% !important;
417
+ background: rgba(255, 255, 255, 0.95) !important;
418
+ backdrop-filter: blur(10px) !important;
419
+ border: 1px solid rgba(255, 255, 255, 0.3) !important;
420
+ border-radius: 20px !important;
421
+ padding: 32px 40px !important;
422
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
423
+ margin: 0 auto !important;
424
  }
425
 
426
  .login-icon {
 
513
  gr.update(value="" if ok else "Invalid password", visible=not ok)
514
  )
515
 
516
+ # Login gate - DO NOT wrap in custom HTML divs for HF compatibility
517
+ with gr.Column(visible=True, elem_classes=["login-column"]) as login_group:
518
  gr.HTML("""
519
  <div class="login-wrapper">
520
  <div class="login-card">
521
  <div class="login-icon">🔐</div>
522
  <div class="login-title">Private Access</div>
523
  <div class="login-subtitle">Enter password to continue</div>
 
 
 
 
 
 
 
 
 
 
 
 
524
  </div>
525
  </div>
526
  """)
527
+ with gr.Column(elem_classes=["login-form"]):
528
+ pw = gr.Textbox(
529
+ label="Password",
530
+ type="password",
531
+ placeholder="Enter password",
532
+ elem_classes=["login-input"],
533
+ container=True,
534
+ interactive=True
535
+ )
536
+ login_btn = gr.Button("Continue", elem_classes=["modern-button"], size="lg", variant="primary")
537
+ login_error = gr.Markdown(visible=False, elem_classes=["login-error"])
538
+ gr.HTML("""
539
+ <div class="freepik-credit">Background design inspired by <a href="https://www.freepik.com" target="_blank">Freepik</a></div>
540
+ """)
541
 
542
  # Main UI wrapped for toggling visibility
543
  with gr.Group(visible=False) as main_group: