Spaces:
Runtime error
Runtime error
Create templets/login.html
Browse files- templets/login.html +41 -0
templets/login.html
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def save_html(name, gmail):
|
| 2 |
+
html_content = f"""
|
| 3 |
+
<!DOCTYPE html>
|
| 4 |
+
<html lang="en">
|
| 5 |
+
<head>
|
| 6 |
+
<meta charset="UTF-8">
|
| 7 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 8 |
+
<title>Briyani Hub Login</title>
|
| 9 |
+
</head>
|
| 10 |
+
<body>
|
| 11 |
+
<h1>Welcome to Briyani Hub</h1>
|
| 12 |
+
<p>Your Name: {name}</p>
|
| 13 |
+
<p>Your Gmail: {gmail}</p>
|
| 14 |
+
</body>
|
| 15 |
+
</html>
|
| 16 |
+
"""
|
| 17 |
+
# Save HTML file
|
| 18 |
+
with open("login_details.html", "w") as file:
|
| 19 |
+
file.write(html_content)
|
| 20 |
+
|
| 21 |
+
return "HTML file saved successfully!"
|
| 22 |
+
|
| 23 |
+
# Update Gradio interface to include file-saving functionality
|
| 24 |
+
def voice_login():
|
| 25 |
+
speak("Welcome to Briyani Hub!")
|
| 26 |
+
speak("Please say your name.")
|
| 27 |
+
name = listen()
|
| 28 |
+
|
| 29 |
+
if name:
|
| 30 |
+
speak(f"You said your name is {name}.")
|
| 31 |
+
|
| 32 |
+
speak("Please say your Gmail address.")
|
| 33 |
+
gmail = listen()
|
| 34 |
+
|
| 35 |
+
if gmail:
|
| 36 |
+
speak(f"You said your Gmail is {gmail}.")
|
| 37 |
+
|
| 38 |
+
# Save HTML with captured name and gmail
|
| 39 |
+
save_html(name, gmail)
|
| 40 |
+
|
| 41 |
+
return f"Name: {name}, Gmail: {gmail} - HTML file saved successfully!"
|