Upload folder using huggingface_hub
Browse files
app.py
CHANGED
|
@@ -24,45 +24,48 @@ print("========================================")
|
|
| 24 |
def main():
|
| 25 |
# Custom CSS for dataset cards
|
| 26 |
custom_css = theme.css + """
|
| 27 |
-
/*
|
| 28 |
-
.
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
| 34 |
}
|
| 35 |
-
.hero-logo
|
| 36 |
-
|
|
|
|
|
|
|
|
|
|
| 37 |
}
|
| 38 |
.hero-subtitle {
|
| 39 |
-
font-size:
|
| 40 |
-
color: var(--text-secondary, #
|
| 41 |
-
margin: 0
|
| 42 |
-
|
| 43 |
}
|
| 44 |
|
| 45 |
/* Dataset card styling */
|
| 46 |
.dataset-card-group {
|
| 47 |
background: var(--bg-card, #1c1c1e) !important;
|
| 48 |
-
border: 1px solid
|
| 49 |
-
border-radius:
|
| 50 |
-
padding: 1.5rem !important;
|
| 51 |
-
margin-bottom:
|
| 52 |
-
transition: all 0.
|
| 53 |
-
overflow: hidden !important;
|
| 54 |
}
|
| 55 |
.dataset-card-group:hover {
|
| 56 |
-
border-color: rgba(255,255,255,0.
|
| 57 |
-
|
| 58 |
-
transform: translateY(-2px) !important;
|
| 59 |
}
|
| 60 |
|
| 61 |
/* Card header */
|
| 62 |
.card-header-row {
|
| 63 |
-
margin-bottom: 0.
|
| 64 |
gap: 1rem !important;
|
| 65 |
-
align-items:
|
| 66 |
}
|
| 67 |
.card-title-col {
|
| 68 |
min-width: 0 !important;
|
|
@@ -72,97 +75,102 @@ def main():
|
|
| 72 |
min-width: auto !important;
|
| 73 |
}
|
| 74 |
.dataset-title {
|
| 75 |
-
font-size: 1.
|
| 76 |
-
font-weight:
|
| 77 |
margin: 0 !important;
|
| 78 |
color: var(--text-primary, #f5f5f7) !important;
|
| 79 |
-
line-height: 1.
|
| 80 |
-
letter-spacing: -0.01em !important;
|
| 81 |
}
|
| 82 |
.dataset-id {
|
| 83 |
-
font-size: 0.
|
| 84 |
color: var(--text-tertiary, #6e6e73) !important;
|
| 85 |
-
margin: 0.
|
| 86 |
-
font-family: '
|
| 87 |
-
background: rgba(255,255,255,0.
|
| 88 |
-
padding: 0.
|
| 89 |
border-radius: 4px !important;
|
| 90 |
display: inline-block !important;
|
| 91 |
}
|
| 92 |
.dataset-desc {
|
| 93 |
-
font-size: 0.
|
| 94 |
-
color: var(--text-secondary, #
|
| 95 |
-
line-height: 1.
|
| 96 |
-
margin: 0 0
|
| 97 |
}
|
| 98 |
|
| 99 |
/* Price badges */
|
| 100 |
.price-badge {
|
| 101 |
display: inline-flex !important;
|
| 102 |
align-items: center !important;
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
|
|
|
| 106 |
font-weight: 600 !important;
|
|
|
|
| 107 |
}
|
| 108 |
.price-badge.paid {
|
| 109 |
-
background:
|
| 110 |
color: var(--text-primary, #f5f5f7) !important;
|
| 111 |
-
border: 1px solid rgba(255,255,255,0.1) !important;
|
| 112 |
}
|
| 113 |
.price-badge.free {
|
| 114 |
-
background:
|
| 115 |
-
color: #
|
| 116 |
-
border: 1px solid rgba(52, 199, 89, 0.3) !important;
|
| 117 |
}
|
| 118 |
|
| 119 |
/* Card footer */
|
| 120 |
.card-footer-row {
|
| 121 |
-
padding-top:
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
| 125 |
}
|
| 126 |
|
| 127 |
/* Subscribe buttons */
|
| 128 |
-
.subscribe-btn
|
| 129 |
-
|
|
|
|
|
|
|
| 130 |
color: #1a1a1a !important;
|
| 131 |
border: none !important;
|
| 132 |
-
border-radius:
|
| 133 |
-
padding: 0.
|
| 134 |
font-weight: 600 !important;
|
| 135 |
-
font-size:
|
| 136 |
-
transition: all 0.
|
| 137 |
-
box-shadow: 0 4px 12px rgba(245, 200, 66, 0.35) !important;
|
| 138 |
-
min-height: 48px !important;
|
| 139 |
cursor: pointer !important;
|
|
|
|
| 140 |
}
|
| 141 |
-
.subscribe-btn:hover
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
}
|
| 146 |
-
.subscribe-btn:active {
|
| 147 |
-
transform: translateY(0) !important;
|
| 148 |
-
box-shadow: 0 2px 8px rgba(245, 200, 66, 0.3) !important;
|
| 149 |
}
|
| 150 |
-
|
| 151 |
-
.subscribe-btn button
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
background: linear-gradient(135deg, #f5c842 0%, #d4a832 100%) !important;
|
| 155 |
-
color: #1a1a1a !important;
|
| 156 |
-
border: none !important;
|
| 157 |
}
|
| 158 |
|
| 159 |
/* Login hint */
|
| 160 |
.login-hint {
|
| 161 |
-
font-size: 0.
|
| 162 |
color: var(--text-tertiary, #6e6e73) !important;
|
| 163 |
font-style: italic !important;
|
| 164 |
margin: 0 !important;
|
| 165 |
padding: 0.5rem 0 !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
}
|
| 167 |
"""
|
| 168 |
|
|
@@ -170,17 +178,13 @@ def main():
|
|
| 170 |
# State to track logged-in username (triggers re-render when changed)
|
| 171 |
logged_in_user = gr.State(value=None)
|
| 172 |
|
| 173 |
-
# Hero Section with logo
|
| 174 |
-
gr.
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
height=140,
|
| 181 |
-
elem_classes="hero-logo"
|
| 182 |
-
)
|
| 183 |
-
gr.HTML('<p class="hero-subtitle">Your pass to private data.</p>')
|
| 184 |
|
| 185 |
# Simple auth row with Gradio 6 LoginButton
|
| 186 |
with gr.Row():
|
|
|
|
| 24 |
def main():
|
| 25 |
# Custom CSS for dataset cards
|
| 26 |
custom_css = theme.css + """
|
| 27 |
+
/* Hide any share buttons globally */
|
| 28 |
+
.share-button, [class*="share"], button[title="Share"] {
|
| 29 |
+
display: none !important;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
/* Hero section styling */
|
| 33 |
+
.hero-section {
|
| 34 |
+
text-align: center;
|
| 35 |
+
padding: 2rem 1rem 1rem;
|
| 36 |
}
|
| 37 |
+
.hero-logo-img {
|
| 38 |
+
max-width: 220px;
|
| 39 |
+
height: auto;
|
| 40 |
+
margin: 0 auto 0.75rem;
|
| 41 |
+
display: block;
|
| 42 |
}
|
| 43 |
.hero-subtitle {
|
| 44 |
+
font-size: 1rem !important;
|
| 45 |
+
color: var(--text-secondary, #98989d) !important;
|
| 46 |
+
margin: 0 !important;
|
| 47 |
+
font-weight: 400 !important;
|
| 48 |
}
|
| 49 |
|
| 50 |
/* Dataset card styling */
|
| 51 |
.dataset-card-group {
|
| 52 |
background: var(--bg-card, #1c1c1e) !important;
|
| 53 |
+
border: 1px solid rgba(255,255,255,0.06) !important;
|
| 54 |
+
border-radius: 16px !important;
|
| 55 |
+
padding: 1.25rem 1.5rem !important;
|
| 56 |
+
margin-bottom: 0.75rem !important;
|
| 57 |
+
transition: all 0.2s ease !important;
|
|
|
|
| 58 |
}
|
| 59 |
.dataset-card-group:hover {
|
| 60 |
+
border-color: rgba(255,255,255,0.12) !important;
|
| 61 |
+
background: rgba(255,255,255,0.02) !important;
|
|
|
|
| 62 |
}
|
| 63 |
|
| 64 |
/* Card header */
|
| 65 |
.card-header-row {
|
| 66 |
+
margin-bottom: 0.5rem !important;
|
| 67 |
gap: 1rem !important;
|
| 68 |
+
align-items: center !important;
|
| 69 |
}
|
| 70 |
.card-title-col {
|
| 71 |
min-width: 0 !important;
|
|
|
|
| 75 |
min-width: auto !important;
|
| 76 |
}
|
| 77 |
.dataset-title {
|
| 78 |
+
font-size: 1.125rem !important;
|
| 79 |
+
font-weight: 600 !important;
|
| 80 |
margin: 0 !important;
|
| 81 |
color: var(--text-primary, #f5f5f7) !important;
|
| 82 |
+
line-height: 1.4 !important;
|
|
|
|
| 83 |
}
|
| 84 |
.dataset-id {
|
| 85 |
+
font-size: 0.6875rem !important;
|
| 86 |
color: var(--text-tertiary, #6e6e73) !important;
|
| 87 |
+
margin: 0.25rem 0 0 0 !important;
|
| 88 |
+
font-family: 'JetBrains Mono', monospace !important;
|
| 89 |
+
background: rgba(255,255,255,0.04) !important;
|
| 90 |
+
padding: 0.15rem 0.4rem !important;
|
| 91 |
border-radius: 4px !important;
|
| 92 |
display: inline-block !important;
|
| 93 |
}
|
| 94 |
.dataset-desc {
|
| 95 |
+
font-size: 0.875rem !important;
|
| 96 |
+
color: var(--text-secondary, #98989d) !important;
|
| 97 |
+
line-height: 1.5 !important;
|
| 98 |
+
margin: 0 0 1rem 0 !important;
|
| 99 |
}
|
| 100 |
|
| 101 |
/* Price badges */
|
| 102 |
.price-badge {
|
| 103 |
display: inline-flex !important;
|
| 104 |
align-items: center !important;
|
| 105 |
+
justify-content: center !important;
|
| 106 |
+
padding: 0.4rem 0.9rem !important;
|
| 107 |
+
border-radius: 20px !important;
|
| 108 |
+
font-size: 0.8125rem !important;
|
| 109 |
font-weight: 600 !important;
|
| 110 |
+
white-space: nowrap !important;
|
| 111 |
}
|
| 112 |
.price-badge.paid {
|
| 113 |
+
background: rgba(255,255,255,0.08) !important;
|
| 114 |
color: var(--text-primary, #f5f5f7) !important;
|
|
|
|
| 115 |
}
|
| 116 |
.price-badge.free {
|
| 117 |
+
background: rgba(52, 199, 89, 0.15) !important;
|
| 118 |
+
color: #32d74b !important;
|
|
|
|
| 119 |
}
|
| 120 |
|
| 121 |
/* Card footer */
|
| 122 |
.card-footer-row {
|
| 123 |
+
padding-top: 0.875rem !important;
|
| 124 |
+
margin-top: 0.25rem !important;
|
| 125 |
+
border-top: 1px solid rgba(255,255,255,0.06) !important;
|
| 126 |
+
gap: 0 !important;
|
| 127 |
+
}
|
| 128 |
+
.card-footer-row > div {
|
| 129 |
+
flex: 1 !important;
|
| 130 |
}
|
| 131 |
|
| 132 |
/* Subscribe buttons */
|
| 133 |
+
.subscribe-btn,
|
| 134 |
+
.subscribe-btn button {
|
| 135 |
+
width: 100% !important;
|
| 136 |
+
background: linear-gradient(180deg, #f7d052 0%, #e9b93a 100%) !important;
|
| 137 |
color: #1a1a1a !important;
|
| 138 |
border: none !important;
|
| 139 |
+
border-radius: 10px !important;
|
| 140 |
+
padding: 0.75rem 1.5rem !important;
|
| 141 |
font-weight: 600 !important;
|
| 142 |
+
font-size: 0.9375rem !important;
|
| 143 |
+
transition: all 0.15s ease !important;
|
|
|
|
|
|
|
| 144 |
cursor: pointer !important;
|
| 145 |
+
box-shadow: 0 1px 2px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.2) !important;
|
| 146 |
}
|
| 147 |
+
.subscribe-btn:hover,
|
| 148 |
+
.subscribe-btn:hover button {
|
| 149 |
+
background: linear-gradient(180deg, #fad965 0%, #f0c243 100%) !important;
|
| 150 |
+
box-shadow: 0 2px 8px rgba(247, 208, 82, 0.3), inset 0 1px 0 rgba(255,255,255,0.25) !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
| 151 |
}
|
| 152 |
+
.subscribe-btn:active,
|
| 153 |
+
.subscribe-btn:active button {
|
| 154 |
+
background: linear-gradient(180deg, #e5b835 0%, #d4a52e 100%) !important;
|
| 155 |
+
box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !important;
|
|
|
|
|
|
|
|
|
|
| 156 |
}
|
| 157 |
|
| 158 |
/* Login hint */
|
| 159 |
.login-hint {
|
| 160 |
+
font-size: 0.8125rem !important;
|
| 161 |
color: var(--text-tertiary, #6e6e73) !important;
|
| 162 |
font-style: italic !important;
|
| 163 |
margin: 0 !important;
|
| 164 |
padding: 0.5rem 0 !important;
|
| 165 |
+
text-align: center !important;
|
| 166 |
+
}
|
| 167 |
+
|
| 168 |
+
/* Tighten up Gradio's default spacing */
|
| 169 |
+
.gradio-container .gr-group {
|
| 170 |
+
gap: 0 !important;
|
| 171 |
+
}
|
| 172 |
+
.gradio-container .gr-block {
|
| 173 |
+
padding: 0 !important;
|
| 174 |
}
|
| 175 |
"""
|
| 176 |
|
|
|
|
| 178 |
# State to track logged-in username (triggers re-render when changed)
|
| 179 |
logged_in_user = gr.State(value=None)
|
| 180 |
|
| 181 |
+
# Hero Section with logo (using HTML to avoid Gradio image controls)
|
| 182 |
+
gr.HTML('''
|
| 183 |
+
<div class="hero-section">
|
| 184 |
+
<img src="/file=datapass_logo.png" alt="DataPass" class="hero-logo-img">
|
| 185 |
+
<p class="hero-subtitle">Your pass to private data.</p>
|
| 186 |
+
</div>
|
| 187 |
+
''')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 188 |
|
| 189 |
# Simple auth row with Gradio 6 LoginButton
|
| 190 |
with gr.Row():
|
theme.py
CHANGED
|
@@ -9,8 +9,8 @@ def get_theme():
|
|
| 9 |
spacing_size="lg",
|
| 10 |
radius_size="lg",
|
| 11 |
text_size="md",
|
| 12 |
-
font=[gr.themes.GoogleFont("
|
| 13 |
-
font_mono=[gr.themes.GoogleFont("
|
| 14 |
).set(
|
| 15 |
# Light mode base
|
| 16 |
body_background_fill="*neutral_50",
|
|
|
|
| 9 |
spacing_size="lg",
|
| 10 |
radius_size="lg",
|
| 11 |
text_size="md",
|
| 12 |
+
font=[gr.themes.GoogleFont("Inter"), "system-ui", "-apple-system", "BlinkMacSystemFont", "sans-serif"],
|
| 13 |
+
font_mono=[gr.themes.GoogleFont("JetBrains Mono"), "ui-monospace", "monospace"],
|
| 14 |
).set(
|
| 15 |
# Light mode base
|
| 16 |
body_background_fill="*neutral_50",
|