lokesh341 commited on
Commit
3c170b6
·
verified ·
1 Parent(s): 335f801

Create dashboard.html

Browse files
Files changed (1) hide show
  1. templates/dashboard.html +97 -0
templates/dashboard.html ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Dashboard - Biryani Hub</title>
7
+ <style>
8
+ /* General Body Styling */
9
+ body {
10
+ font-family: Arial, sans-serif;
11
+ background-color: #f0f0f0;
12
+ margin: 0;
13
+ padding: 0;
14
+ }
15
+ /* Container for the dashboard content */
16
+ .dashboard-container {
17
+ max-width: 900px;
18
+ margin: 50px auto;
19
+ padding: 20px;
20
+ background-color: #fff;
21
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
22
+ border-radius: 8px;
23
+ text-align: center;
24
+ }
25
+ /* Heading Style */
26
+ h1 {
27
+ font-size: 2.5rem;
28
+ color: #333;
29
+ margin-bottom: 20px;
30
+ }
31
+ /* Paragraph Style */
32
+ p {
33
+ font-size: 1.2rem;
34
+ color: #666;
35
+ margin-bottom: 30px;
36
+ }
37
+ /* Link Style */
38
+ a {
39
+ text-decoration: none;
40
+ color: #4CAF50;
41
+ font-weight: bold;
42
+ font-size: 1.2rem;
43
+ transition: color 0.3s;
44
+ }
45
+ a:hover {
46
+ color: #45a049;
47
+ }
48
+ </style>
49
+ </head>
50
+ <body>
51
+
52
+ <div class="dashboard-container">
53
+ <h1>Welcome to the Dashboard</h1>
54
+ <p>This is your user dashboard where you can access various features.</p>
55
+ <a href="/menu">Go to Menu</a>
56
+ </div>
57
+
58
+ <script>
59
+ // Speech Recognition and Speech Synthesis for voice interaction
60
+ // Check for SpeechRecognition support
61
+ const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
62
+ const recognition = new SpeechRecognition();
63
+ recognition.lang = 'en-US';
64
+ recognition.interimResults = false;
65
+ recognition.maxAlternatives = 1;
66
+
67
+ // Function to speak the message
68
+ function speak(text) {
69
+ const msg = new SpeechSynthesisUtterance(text);
70
+ msg.rate = 1; // Speed of speech
71
+ window.speechSynthesis.speak(msg);
72
+ }
73
+
74
+ // Automatically prompt the user to say "Go to Menu"
75
+ speak("Please say 'Go to Menu' to navigate to the menu.");
76
+ recognition.start();
77
+
78
+ // Handle speech recognition result
79
+ recognition.onresult = (event) => {
80
+ const command = event.results[0][0].transcript.toLowerCase();
81
+ console.log("User said:", command);
82
+ // If user says "Go to Menu", navigate to the menu
83
+ if (command.includes("go to menu")) {
84
+ window.location.href = "/menu";
85
+ }
86
+ };
87
+
88
+ // Handle errors in speech recognition
89
+ recognition.onerror = (event) => {
90
+ console.error("Speech recognition error:", event.error);
91
+ speak("Sorry, I couldn't understand that. Please try again.");
92
+ recognition.start(); // Restart listening
93
+ };
94
+ </script>
95
+
96
+ </body>
97
+ </html>