gladguy commited on
Commit
2dea257
·
1 Parent(s): 1022c41

Beautify modal popup - add blur backdrop, gradient border, animation

Browse files
Files changed (1) hide show
  1. app.py +51 -13
app.py CHANGED
@@ -705,28 +705,66 @@ def submit_viva_answer(answer, questions, current_q_idx, student_name=""):
705
  with gr.Blocks(
706
  title="AnatomyBot - MBBS Anatomy Tutor",
707
  css="""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
708
  #registration_modal {
709
  position: fixed !important;
710
  top: 50% !important;
711
  left: 50% !important;
712
  transform: translate(-50%, -50%) !important;
713
  z-index: 1000 !important;
714
- background: white !important;
715
- padding: 2rem !important;
716
- border-radius: 10px !important;
717
- box-shadow: 0 4px 20px rgba(0,0,0,0.3) !important;
 
 
 
 
 
718
  max-width: 600px !important;
719
  width: 90% !important;
 
720
  }
721
- #registration_modal::before {
722
- content: '';
723
- position: fixed;
724
- top: 0;
725
- left: 0;
726
- right: 0;
727
- bottom: 0;
728
- background: rgba(0, 0, 0, 0.5);
729
- z-index: -1;
 
 
 
 
 
 
 
 
 
 
 
 
 
730
  }
731
  """
732
  ) as demo:
 
705
  with gr.Blocks(
706
  title="AnatomyBot - MBBS Anatomy Tutor",
707
  css="""
708
+ /* Background blur effect */
709
+ body:has(#registration_modal[style*="display: block"]) #main_app {
710
+ filter: blur(5px);
711
+ }
712
+
713
+ /* Modal backdrop */
714
+ #registration_modal::before {
715
+ content: '';
716
+ position: fixed;
717
+ top: 0;
718
+ left: 0;
719
+ right: 0;
720
+ bottom: 0;
721
+ background: rgba(0, 0, 0, 0.6);
722
+ backdrop-filter: blur(8px);
723
+ z-index: 999;
724
+ }
725
+
726
+ /* Modal container */
727
  #registration_modal {
728
  position: fixed !important;
729
  top: 50% !important;
730
  left: 50% !important;
731
  transform: translate(-50%, -50%) !important;
732
  z-index: 1000 !important;
733
+ background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
734
+ padding: 2.5rem !important;
735
+ border-radius: 20px !important;
736
+ border: 3px solid transparent !important;
737
+ background-clip: padding-box !important;
738
+ box-shadow:
739
+ 0 10px 40px rgba(0,0,0,0.2),
740
+ 0 0 0 3px rgba(255,107,53,0.3),
741
+ inset 0 1px 0 rgba(255,255,255,0.9) !important;
742
  max-width: 600px !important;
743
  width: 90% !important;
744
+ animation: modalSlideIn 0.3s ease-out !important;
745
  }
746
+
747
+ /* Modal animation */
748
+ @keyframes modalSlideIn {
749
+ from {
750
+ opacity: 0;
751
+ transform: translate(-50%, -60%);
752
+ }
753
+ to {
754
+ opacity: 1;
755
+ transform: translate(-50%, -50%);
756
+ }
757
+ }
758
+
759
+ /* Beautify modal content */
760
+ #registration_modal h1 {
761
+ color: #2c3e50 !important;
762
+ margin-bottom: 0.5rem !important;
763
+ }
764
+
765
+ #registration_modal h3 {
766
+ color: #7f8c8d !important;
767
+ font-weight: 400 !important;
768
  }
769
  """
770
  ) as demo: