Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -30,42 +30,20 @@ def clear_output():
|
|
30 |
return "", ""
|
31 |
|
32 |
# Create the Gradio interface
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
.
|
47 |
-
max-width: 600px;
|
48 |
-
margin: 0 auto;
|
49 |
-
padding: 20px;
|
50 |
-
border-radius: 10px;
|
51 |
-
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
52 |
-
}
|
53 |
-
.gradio-button {
|
54 |
-
background-color: #4CAF50;
|
55 |
-
color: white;
|
56 |
-
padding: 10px 20px;
|
57 |
-
border: none;
|
58 |
-
border-radius: 5px;
|
59 |
-
cursor: pointer;
|
60 |
-
}
|
61 |
-
.gradio-button:hover {
|
62 |
-
background-color: #45a049;
|
63 |
-
}
|
64 |
-
"""
|
65 |
-
)
|
66 |
-
|
67 |
-
# Add a "Clear" button
|
68 |
-
iface.add_button("Clear", clear_output, outputs=[gr.Textbox(label="Link"), gr.Textbox(label="Description")])
|
69 |
|
70 |
# Launch the interface
|
71 |
iface.launch()
|
|
|
30 |
return "", ""
|
31 |
|
32 |
# Create the Gradio interface
|
33 |
+
with gr.Blocks() as iface:
|
34 |
+
gr.Markdown("# 10 Random Interesting Sites")
|
35 |
+
gr.Markdown("Click the button to generate 10 random interesting sites with descriptions.")
|
36 |
+
|
37 |
+
with gr.Row():
|
38 |
+
btn_generate = gr.Button("Generate Sites")
|
39 |
+
btn_clear = gr.Button("Clear")
|
40 |
+
|
41 |
+
with gr.Row():
|
42 |
+
link_output = gr.Textbox(label="Link")
|
43 |
+
description_output = gr.Textbox(label="Description")
|
44 |
+
|
45 |
+
btn_generate.click(generate_random_sites, outputs=[link_output, description_output])
|
46 |
+
btn_clear.click(clear_output, outputs=[link_output, description_output])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
|
48 |
# Launch the interface
|
49 |
iface.launch()
|