Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -780,47 +780,58 @@ def create_interface():
|
|
780 |
color: white !important;
|
781 |
}
|
782 |
|
783 |
-
/*
|
784 |
[data-testid="file"] {
|
785 |
-
margin-left: 15px !important;
|
786 |
width: 150px !important;
|
|
|
|
|
787 |
}
|
788 |
|
789 |
-
/*
|
790 |
-
[data-testid="file"] [data-testid="
|
791 |
-
height:
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
799 |
}
|
800 |
|
801 |
-
/* Hide the drop area
|
802 |
-
[data-testid="file"] [data-testid="
|
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
|
809 |
-
[data-testid="file"] [data-testid="
|
810 |
content: "Upload Document" !important;
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
}
|
815 |
|
816 |
-
/*
|
817 |
-
[data-testid="file"] [
|
|
|
|
|
|
|
|
|
|
|
818 |
opacity: 0 !important;
|
819 |
-
|
|
|
820 |
}
|
821 |
|
822 |
-
/* Hide the "or" text
|
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 |
"""
|