ApsidalSolid4 commited on
Commit
8e64c63
·
verified ·
1 Parent(s): 3820ea8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -36
app.py CHANGED
@@ -780,59 +780,48 @@ def create_interface():
780
  color: white !important;
781
  }
782
 
783
- /* Custom styling for the file upload button */
784
- .gradio-file {
785
- height: 40px !important;
786
- display: flex !important;
787
- align-items: center !important;
788
- justify-content: center !important;
789
- background-color: #f0f0f0 !important;
790
- border: 1px solid #d9d9d9 !important;
791
- border-radius: 4px !important;
792
  margin-left: 15px !important;
793
  width: 150px !important;
794
- position: relative !important;
795
- overflow: hidden !important;
796
  }
797
 
798
- /* Style the upload button label */
799
- .gradio-file > div:first-child {
 
 
 
 
800
  display: flex !important;
801
  align-items: center !important;
802
  justify-content: center !important;
803
- height: 100% !important;
804
- width: 100% !important;
805
  }
806
 
807
- /* Hide unnecessary elements */
808
- .gradio-file p,
809
- .gradio-file .file-preview,
810
- .gradio-file svg {
811
  display: none !important;
812
  }
813
 
814
- /* Make sure the input is accessible to clicks but visually hidden */
815
- .gradio-file input[type="file"] {
816
- cursor: pointer !important;
817
  position: absolute !important;
818
- top: 0 !important;
819
- left: 0 !important;
820
- width: 100% !important;
821
- height: 100% !important;
822
- opacity: 0 !important;
823
  }
824
 
825
- /* Add the text with a pseudo-element */
826
- .gradio-file > div:first-child::before {
827
- content: "Upload Document" !important;
828
- display: block !important;
829
- pointer-events: none !important;
830
  }
831
 
832
- /* Ensure the radio buttons and file upload are aligned */
833
- .radio-container, .file-container {
834
- display: flex !important;
835
- align-items: center !important;
836
  }
837
  """
838
 
 
780
  color: white !important;
781
  }
782
 
783
+ /* Target the file upload component */
784
+ [data-testid="file"] {
 
 
 
 
 
 
 
785
  margin-left: 15px !important;
786
  width: 150px !important;
 
 
787
  }
788
 
789
+ /* Style the file upload button to match original design */
790
+ [data-testid="file"] [data-testid="block"] > div:first-child {
791
+ height: 40px !important;
792
+ background-color: #f0f0f0 !important;
793
+ border: 1px solid #d9d9d9 !important;
794
+ border-radius: 4px !important;
795
  display: flex !important;
796
  align-items: center !important;
797
  justify-content: center !important;
798
+ text-align: center !important;
 
799
  }
800
 
801
+ /* Hide the drop area text and icon */
802
+ [data-testid="file"] [data-testid="block"] svg,
803
+ [data-testid="file"] [data-testid="block"] p,
804
+ [data-testid="file"] [data-testid="block"] > div:not(:first-child) {
805
  display: none !important;
806
  }
807
 
808
+ /* Add custom text */
809
+ [data-testid="file"] [data-testid="block"]::before {
810
+ content: "Upload Document" !important;
811
  position: absolute !important;
812
+ z-index: 10 !important;
813
+ pointer-events: none !important;
 
 
 
814
  }
815
 
816
+ /* Hide the existing text without breaking functionality */
817
+ [data-testid="file"] [data-testid="block"] span {
818
+ opacity: 0 !important;
819
+ height: 0 !important;
 
820
  }
821
 
822
+ /* Hide the "or" text that appears */
823
+ [data-testid="file"] .or {
824
+ display: none !important;
 
825
  }
826
  """
827