ApsidalSolid4 commited on
Commit
4a492a6
·
verified ·
1 Parent(s): 8e64c63

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -21
app.py CHANGED
@@ -780,47 +780,58 @@ def create_interface():
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
  """
 
780
  color: white !important;
781
  }
782
 
783
+ /* Create a compact file upload button */
784
  [data-testid="file"] {
 
785
  width: 150px !important;
786
+ margin-left: 15px !important;
787
+ height: 38px !important; /* Match height to radio buttons */
788
  }
789
 
790
+ /* Hide the drop area completely */
791
+ [data-testid="file"] [data-testid="droparea"] {
792
+ height: 38px !important;
793
+ min-height: 38px !important;
794
+ max-height: 38px !important;
795
+ padding: 0 !important;
796
+ margin: 0 !important;
797
+ border-radius: 4px !important;
798
  background-color: #f0f0f0 !important;
799
  border: 1px solid #d9d9d9 !important;
 
800
  display: flex !important;
801
  align-items: center !important;
802
  justify-content: center !important;
803
+ overflow: hidden !important;
804
  }
805
 
806
+ /* Hide all elements inside the drop area */
807
+ [data-testid="file"] [data-testid="droparea"] > * {
 
 
808
  display: none !important;
809
  }
810
 
811
+ /* Add a custom button */
812
+ [data-testid="file"] [data-testid="droparea"]::before {
813
  content: "Upload Document" !important;
814
+ display: block !important;
815
+ font-size: 14px !important;
816
+ color: #333 !important;
817
  }
818
 
819
+ /* Make sure the file input is still accessible but invisible */
820
+ [data-testid="file"] input[type="file"] {
821
+ position: absolute !important;
822
+ width: 150px !important;
823
+ height: 38px !important;
824
+ top: 0 !important;
825
+ left: 15px !important;
826
  opacity: 0 !important;
827
+ cursor: pointer !important;
828
+ z-index: 100 !important;
829
  }
830
 
831
+ /* Hide the "or" text and other elements */
832
+ [data-testid="file"] .or,
833
+ [data-testid="file"] p,
834
+ [data-testid="file"] svg {
835
  display: none !important;
836
  }
837
  """