Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,32 +23,46 @@ def register(username, name, password):
|
|
| 23 |
CUSTOMERS[username] = {"password": password, "name": name}
|
| 24 |
return f"Account created successfully for {name}!"
|
| 25 |
|
| 26 |
-
#
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
<
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
</div>
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
CUSTOMERS[username] = {"password": password, "name": name}
|
| 24 |
return f"Account created successfully for {name}!"
|
| 25 |
|
| 26 |
+
# Gradio Blocks
|
| 27 |
+
def main():
|
| 28 |
+
with gr.Blocks() as demo:
|
| 29 |
+
gr.HTML("""
|
| 30 |
+
<div style='display: flex; height: 100vh; font-family: Arial, sans-serif;'>
|
| 31 |
+
<div style='flex: 1; background: url("https://via.placeholder.com/600x800") no-repeat center center; background-size: cover; color: white; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;'>
|
| 32 |
+
<h1 style='font-size: 3em;'>Biryani Hub</h1>
|
| 33 |
+
<p>Sign in with</p>
|
| 34 |
+
<div style='display: flex; gap: 10px;'>
|
| 35 |
+
<a href='#' style='color: white;'>Facebook</a> |
|
| 36 |
+
<a href='#' style='color: white;'>Twitter</a> |
|
| 37 |
+
<a href='#' style='color: white;'>Instagram</a>
|
| 38 |
+
</div>
|
| 39 |
+
</div>
|
| 40 |
+
<div style='flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; background: linear-gradient(to bottom, #ff7e5f, #feb47b); border-radius: 10px; color: white;'>
|
| 41 |
+
<div style='width: 80%;'>
|
| 42 |
+
<h2 style='text-align: center;'>Log In</h2>
|
| 43 |
+
</div>
|
| 44 |
+
</div>
|
| 45 |
</div>
|
| 46 |
+
""")
|
| 47 |
+
|
| 48 |
+
with gr.Row():
|
| 49 |
+
with gr.Column():
|
| 50 |
+
gr.Markdown("### Log In")
|
| 51 |
+
login_username = gr.Textbox(label="Username", placeholder="Enter your username")
|
| 52 |
+
login_password = gr.Textbox(label="Password", placeholder="Enter your password", type="password")
|
| 53 |
+
login_button = gr.Button("Log In")
|
| 54 |
+
login_output = gr.Text(label="Login Status")
|
| 55 |
+
login_button.click(login, inputs=[login_username, login_password], outputs=login_output)
|
| 56 |
+
with gr.Column():
|
| 57 |
+
gr.Markdown("### Register")
|
| 58 |
+
register_username = gr.Textbox(label="Username", placeholder="Choose a username")
|
| 59 |
+
register_name = gr.Textbox(label="Name", placeholder="Enter your name")
|
| 60 |
+
register_password = gr.Textbox(label="Password", placeholder="Set your password", type="password")
|
| 61 |
+
register_button = gr.Button("Register")
|
| 62 |
+
register_output = gr.Text(label="Registration Status")
|
| 63 |
+
register_button.click(register, inputs=[register_username, register_name, register_password], outputs=register_output)
|
| 64 |
+
|
| 65 |
+
demo.launch()
|
| 66 |
+
|
| 67 |
+
if __name__ == "__main__":
|
| 68 |
+
main()
|