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

Remove blur effect and fix z-index of backdrop

Browse files
Files changed (1) hide show
  1. app.py +64 -66
app.py CHANGED
@@ -702,72 +702,7 @@ def submit_viva_answer(answer, questions, current_q_idx, student_name=""):
702
 
703
 
704
  # Create Gradio interface
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:
771
  # State variables
772
  student_name_state = gr.State("")
773
  viva_questions_state = gr.State([])
@@ -776,6 +711,69 @@ with gr.Blocks(
776
  current_image_state = gr.State(None)
777
  is_registered = gr.State(False) # Track if user has registered
778
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
779
  # Main Application (always visible now)
780
  with gr.Column() as main_app:
781
  gr.Markdown(
 
702
 
703
 
704
  # Create Gradio interface
705
+ with gr.Blocks(title="AnatomyBot - MBBS Anatomy Tutor") as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
706
  # State variables
707
  student_name_state = gr.State("")
708
  viva_questions_state = gr.State([])
 
711
  current_image_state = gr.State(None)
712
  is_registered = gr.State(False) # Track if user has registered
713
 
714
+ # Add custom CSS styling via HTML
715
+ gr.HTML("""
716
+ <style>
717
+ /* Modal backdrop */
718
+ #registration_modal::before {
719
+ content: '';
720
+ position: fixed;
721
+ top: 0;
722
+ left: 0;
723
+ right: 0;
724
+ bottom: 0;
725
+ background: rgba(0, 0, 0, 0.6);
726
+ z-index: -1;
727
+ pointer-events: none;
728
+ }
729
+
730
+ /* Modal container */
731
+ #registration_modal {
732
+ position: fixed !important;
733
+ top: 50% !important;
734
+ left: 50% !important;
735
+ transform: translate(-50%, -50%) !important;
736
+ z-index: 1000 !important;
737
+ background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
738
+ padding: 2.5rem !important;
739
+ border-radius: 20px !important;
740
+ border: 3px solid rgba(255,107,53,0.5) !important;
741
+ box-shadow:
742
+ 0 10px 40px rgba(0,0,0,0.3),
743
+ 0 0 20px rgba(255,107,53,0.2),
744
+ inset 0 1px 0 rgba(255,255,255,0.9) !important;
745
+ max-width: 600px !important;
746
+ width: 90% !important;
747
+ animation: modalSlideIn 0.3s ease-out !important;
748
+ }
749
+
750
+ /* Modal animation */
751
+ @keyframes modalSlideIn {
752
+ from {
753
+ opacity: 0;
754
+ transform: translate(-50%, -60%);
755
+ }
756
+ to {
757
+ opacity: 1;
758
+ transform: translate(-50%, -50%);
759
+ }
760
+ }
761
+
762
+ /* Beautify modal content */
763
+ #registration_modal h1 {
764
+ color: #2c3e50 !important;
765
+ margin-bottom: 0.5rem !important;
766
+ font-size: 2rem !important;
767
+ }
768
+
769
+ #registration_modal h3 {
770
+ color: #7f8c8d !important;
771
+ font-weight: 400 !important;
772
+ font-size: 1.1rem !important;
773
+ }
774
+ </style>
775
+ """)
776
+
777
  # Main Application (always visible now)
778
  with gr.Column() as main_app:
779
  gr.Markdown(