ApsidalSolid4 commited on
Commit
e62585f
·
verified ·
1 Parent(s): e2edecd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -50
app.py CHANGED
@@ -780,74 +780,70 @@ def create_interface():
780
  color: white !important;
781
  }
782
 
783
- /* Make upload button container match radio button container size but taller */
784
  .file-upload-container {
785
  margin-left: 15px;
786
  width: 150px;
787
- height: 46px; /* Increased from 40px to 46px for better alignment */
788
  display: inline-block;
789
  vertical-align: middle;
790
  position: relative;
 
791
  }
792
 
793
- /* Hide ALL the default file upload elements */
794
- .file-upload-container .file-preview,
795
- .file-upload-container .file-drop,
796
- .file-upload-container p,
797
- .file-upload-container svg,
798
- .file-upload-container [data-testid="chunkFileDropArea"],
799
- .file-upload-container [data-testid="droparea"],
800
- .file-upload-container div[data-testid="block"] > div[data-testid="droparea"],
801
- .file-upload-container .upload-button {
802
  display: none !important;
 
 
803
  }
804
 
805
- /* Style the button to look exactly like we want */
806
- .file-upload-container > div:last-child {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
807
  position: absolute !important;
808
  top: 0 !important;
809
  left: 0 !important;
810
  width: 100% !important;
811
- height: 46px !important; /* Increased from 40px to 46px */
812
- padding: 0 15px !important;
813
- background-color: #f0f0f0 !important;
814
- border: 1px solid #d9d9d9 !important;
815
- border-radius: 4px !important;
816
- display: flex !important;
817
- align-items: center !important;
818
- justify-content: center !important;
819
- margin: 0 !important;
820
- z-index: 10 !important; /* Ensure this is on top */
821
- }
822
-
823
- /* Style the button text */
824
- .file-upload-container label span {
825
- font-size: 14px !important;
826
- font-weight: normal !important;
827
- margin: 0 !important;
828
- display: inline-block !important;
829
  }
830
 
831
- /* Hover effect */
832
- .file-upload-container > div:last-child:hover {
833
- background-color: #e0e0e0 !important;
834
- }
835
-
836
- /* This is critical - hide any other elements that might be causing the overlap */
837
- .file-upload-container > div:not(:last-child) {
838
- display: none !important;
839
- }
840
-
841
- /* Hide any additional elements that might appear */
842
- .file-upload-container * {
843
- margin: 0 !important;
844
- }
845
-
846
- /* Explicitly make sure the Upload Document text is visible and centered */
847
- .file-upload-container label {
848
  display: block !important;
849
- text-align: center !important;
850
- width: 100% !important;
851
  }
852
  """
853
 
 
780
  color: white !important;
781
  }
782
 
783
+ /* Container for the file upload */
784
  .file-upload-container {
785
  margin-left: 15px;
786
  width: 150px;
787
+ height: 50px !important; /* Increased height significantly */
788
  display: inline-block;
789
  vertical-align: middle;
790
  position: relative;
791
+ overflow: hidden !important; /* Prevent content from spilling out */
792
  }
793
 
794
+ /* Completely hide ALL elements within the container first */
795
+ .file-upload-container * {
 
 
 
 
 
 
 
796
  display: none !important;
797
+ opacity: 0 !important;
798
+ visibility: hidden !important;
799
  }
800
 
801
+ /* Then create a custom button overlay that replaces everything */
802
+ .file-upload-container::after {
803
+ content: "Upload Document";
804
+ position: absolute;
805
+ top: 0;
806
+ left: 0;
807
+ width: 100%;
808
+ height: 50px !important;
809
+ background-color: #f0f0f0;
810
+ border: 1px solid #d9d9d9;
811
+ border-radius: 4px;
812
+ display: flex !important;
813
+ align-items: center;
814
+ justify-content: center;
815
+ font-size: 14px;
816
+ cursor: pointer;
817
+ z-index: 100;
818
+ }
819
+
820
+ /* Show only the actual input element to keep it functional, but make it cover the full area */
821
+ .file-upload-container input[type="file"] {
822
+ display: block !important;
823
+ opacity: 0 !important;
824
+ visibility: visible !important;
825
  position: absolute !important;
826
  top: 0 !important;
827
  left: 0 !important;
828
  width: 100% !important;
829
+ height: 50px !important;
830
+ cursor: pointer !important;
831
+ z-index: 200 !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
832
  }
833
 
834
+ /* Style the "- or -" text */
835
+ .file-upload-container::before {
836
+ content: "- or -";
837
+ position: absolute;
838
+ bottom: -20px;
839
+ left: 0;
840
+ width: 100%;
841
+ text-align: center;
842
+ font-size: 12px;
843
+ color: #999;
 
 
 
 
 
 
 
844
  display: block !important;
845
+ visibility: visible !important;
846
+ opacity: 1 !important;
847
  }
848
  """
849