Update app.py
Browse files
app.py
CHANGED
@@ -123,44 +123,72 @@ body {
|
|
123 |
align-items: center;
|
124 |
margin-top: 0.5rem;
|
125 |
position: relative;
|
|
|
|
|
126 |
}
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
border
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
background-color: #
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
background-color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
}
|
|
|
151 |
.no-papers {
|
152 |
text-align: center;
|
153 |
color: #718096;
|
154 |
padding: 1rem;
|
155 |
}
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
|
|
|
|
|
|
164 |
}
|
165 |
|
166 |
@media (min-width: 640px) {
|
@@ -210,17 +238,17 @@ demo = gr.Blocks(css=css)
|
|
210 |
with demo:
|
211 |
with gr.Column(elem_classes=["container"]):
|
212 |
gr.Markdown("# Daily Papers", elem_classes=["title"])
|
213 |
-
|
|
|
214 |
prev_button = gr.Button("← Prev")
|
215 |
-
page_info = gr.Markdown()
|
216 |
next_button = gr.Button("Next →")
|
217 |
|
218 |
paper_list = gr.HTML(elem_classes=["paper-list"])
|
219 |
|
220 |
demo.load(initialize_app, outputs=[paper_list, page_info])
|
221 |
-
refresh_button = gr.Button("↻", variant="primary", elem_classes=["refresh-btn"]) # Refresh button styled and resized
|
222 |
refresh_button.click(refresh_papers, outputs=[paper_list, page_info])
|
223 |
prev_button.click(paper_manager.prev_page, outputs=[paper_list, page_info])
|
224 |
next_button.click(paper_manager.next_page, outputs=[paper_list, page_info])
|
225 |
|
226 |
-
demo.launch()
|
|
|
123 |
align-items: center;
|
124 |
margin-top: 0.5rem;
|
125 |
position: relative;
|
126 |
+
flex-wrap: wrap;
|
127 |
+
gap: 0.5rem;
|
128 |
}
|
129 |
+
|
130 |
+
/* Target Gradio button elements more specifically */
|
131 |
+
#component-5, #component-7, #component-9 {
|
132 |
+
background-color: #3498db !important; /* Mobile-friendly blue */
|
133 |
+
color: white !important;
|
134 |
+
border: none !important;
|
135 |
+
padding: 0.5rem 1rem !important;
|
136 |
+
border-radius: 4px !important;
|
137 |
+
cursor: pointer !important;
|
138 |
+
transition: background-color 0.3s !important;
|
139 |
+
font-size: 0.875rem !important;
|
140 |
+
line-height: 1.25rem !important;
|
141 |
+
width: auto !important;
|
142 |
+
max-width: 100% !important;
|
143 |
+
}
|
144 |
+
|
145 |
+
#component-5:hover, #component-7:hover, #component-9:hover {
|
146 |
+
background-color: #2980b9 !important; /* Darker blue on hover */
|
147 |
+
}
|
148 |
+
|
149 |
+
/* Style for the refresh button */
|
150 |
+
#component-11 {
|
151 |
+
background-color: #2ecc71 !important; /* More visible green */
|
152 |
+
color: white !important;
|
153 |
+
border: none !important;
|
154 |
+
padding: 0.5rem !important;
|
155 |
+
border-radius: 4px !important;
|
156 |
+
cursor: pointer !important;
|
157 |
+
transition: background-color 0.3s !important;
|
158 |
+
font-size: 1rem !important;
|
159 |
+
width: auto !important;
|
160 |
+
max-width: 100% !important;
|
161 |
+
height: auto !important;
|
162 |
+
line-height: 1 !important;
|
163 |
+
}
|
164 |
+
|
165 |
+
#component-11:hover {
|
166 |
+
background-color: #27ae60 !important; /* Darker green on hover */
|
167 |
+
}
|
168 |
+
|
169 |
+
/* Make sure the page info doesn't break the layout */
|
170 |
+
#component-8 {
|
171 |
+
flex: 1;
|
172 |
+
text-align: center;
|
173 |
+
min-width: 100px;
|
174 |
}
|
175 |
+
|
176 |
.no-papers {
|
177 |
text-align: center;
|
178 |
color: #718096;
|
179 |
padding: 1rem;
|
180 |
}
|
181 |
+
|
182 |
+
/* Responsive adjustments */
|
183 |
+
@media (max-width: 640px) {
|
184 |
+
#component-5, #component-7, #component-9, #component-11 {
|
185 |
+
font-size: 0.75rem !important;
|
186 |
+
padding: 0.4rem 0.8rem !important;
|
187 |
+
}
|
188 |
+
|
189 |
+
.footer {
|
190 |
+
justify-content: center;
|
191 |
+
}
|
192 |
}
|
193 |
|
194 |
@media (min-width: 640px) {
|
|
|
238 |
with demo:
|
239 |
with gr.Column(elem_classes=["container"]):
|
240 |
gr.Markdown("# Daily Papers", elem_classes=["title"])
|
241 |
+
refresh_button = gr.Button("↻ Refresh", variant="primary", elem_classes=["refresh-btn"])
|
242 |
+
with gr.Row(elem_classes=["footer"]):
|
243 |
prev_button = gr.Button("← Prev")
|
244 |
+
page_info = gr.Markdown(elem_classes=["page-info"])
|
245 |
next_button = gr.Button("Next →")
|
246 |
|
247 |
paper_list = gr.HTML(elem_classes=["paper-list"])
|
248 |
|
249 |
demo.load(initialize_app, outputs=[paper_list, page_info])
|
|
|
250 |
refresh_button.click(refresh_papers, outputs=[paper_list, page_info])
|
251 |
prev_button.click(paper_manager.prev_page, outputs=[paper_list, page_info])
|
252 |
next_button.click(paper_manager.next_page, outputs=[paper_list, page_info])
|
253 |
|
254 |
+
demo.launch()
|