geethareddy commited on
Commit
9f55737
·
verified ·
1 Parent(s): d1d44ee

Create dashboard.html

Browse files
Files changed (1) hide show
  1. Templates/dashboard.html +125 -0
Templates/dashboard.html ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+
16
+ /* Container for the dashboard content */
17
+ .dashboard-container {
18
+ max-width: 900px;
19
+ margin: 50px auto;
20
+ padding: 20px;
21
+ background-color: #fff;
22
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
23
+ border-radius: 8px;
24
+ text-align: center;
25
+ }
26
+
27
+ /* Heading Style */
28
+ h1 {
29
+ font-size: 2.5rem;
30
+ color: #333;
31
+ margin-bottom: 20px;
32
+ }
33
+
34
+ /* Paragraph Style */
35
+ p {
36
+ font-size: 1.2rem;
37
+ color: #666;
38
+ margin-bottom: 30px;
39
+ }
40
+
41
+ /* Link Style */
42
+ a {
43
+ text-decoration: none;
44
+ color: #4CAF50;
45
+ font-weight: bold;
46
+ font-size: 1.2rem;
47
+ transition: color 0.3s;
48
+ }
49
+
50
+ a:hover {
51
+ color: #45a049;
52
+ }
53
+
54
+ /* Button for listening */
55
+ #listen-btn {
56
+ padding: 10px 20px;
57
+ background-color: #4CAF50;
58
+ color: white;
59
+ border: none;
60
+ border-radius: 5px;
61
+ cursor: pointer;
62
+ font-size: 1.2rem;
63
+ }
64
+
65
+ #listen-btn:hover {
66
+ background-color: #45a049;
67
+ }
68
+ </style>
69
+ </head>
70
+ <body>
71
+
72
+ <div class="dashboard-container">
73
+ <h1>Welcome to the Dashboard</h1>
74
+ <p>This is your user dashboard where you can access various features.</p>
75
+ <a href="/menu">Go to Menu</a>
76
+
77
+ <!-- Button for triggering voice recognition -->
78
+ <button id="listen-btn">Say "Go to Menu"</button>
79
+ </div>
80
+
81
+ <script>
82
+ // Speech Recognition and Speech Synthesis for voice interaction
83
+
84
+ // Check for SpeechRecognition support
85
+ const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
86
+ const recognition = new SpeechRecognition();
87
+ recognition.lang = 'en-US';
88
+ recognition.interimResults = false;
89
+ recognition.maxAlternatives = 1;
90
+
91
+ // Function to speak the message
92
+ function speak(text) {
93
+ const msg = new SpeechSynthesisUtterance(text);
94
+ msg.rate = 1; // Speed of speech
95
+ window.speechSynthesis.speak(msg);
96
+ }
97
+
98
+ // Button for listening to user input
99
+ const listenButton = document.getElementById("listen-btn");
100
+
101
+ listenButton.addEventListener("click", () => {
102
+ speak("Please say 'Go to Menu' to navigate to the menu.");
103
+ recognition.start();
104
+ });
105
+
106
+ // Handle speech recognition result
107
+ recognition.onresult = (event) => {
108
+ const command = event.results[0][0].transcript.toLowerCase();
109
+ console.log("User said:", command);
110
+
111
+ // If user says "Go to Menu", navigate to the menu
112
+ if (command.includes("go to menu")) {
113
+ window.location.href = "/menu";
114
+ }
115
+ };
116
+
117
+ // Handle errors in speech recognition
118
+ recognition.onerror = (event) => {
119
+ console.error("Speech recognition error:", event.error);
120
+ speak("Sorry, I couldn't understand that. Please try again.");
121
+ };
122
+ </script>
123
+
124
+ </body>
125
+ </html>