lokesh341 commited on
Commit
2c1b7af
·
verified ·
1 Parent(s): a012c47

Update templates/dashboard.html

Browse files
Files changed (1) hide show
  1. templates/dashboard.html +0 -120
templates/dashboard.html CHANGED
@@ -1,120 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
-
4
- <head>
5
- <meta charset="UTF-8">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>Dashboard - Biryani Hub</title>
8
- <style>
9
- body {
10
- font-family: Arial, sans-serif;
11
- background-color: #f0f0f0;
12
- margin: 0;
13
- padding: 0;
14
- }
15
-
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
-
26
- h1 {
27
- font-size: 2.5rem;
28
- color: #333;
29
- margin-bottom: 20px;
30
- }
31
-
32
- p {
33
- font-size: 1.2rem;
34
- color: #666;
35
- margin-bottom: 30px;
36
- }
37
-
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
-
46
- a:hover {
47
- color: #45a049;
48
- }
49
-
50
- #listen-btn {
51
- padding: 10px 20px;
52
- background-color: #4CAF50;
53
- color: white;
54
- border: none;
55
- border-radius: 5px;
56
- cursor: pointer;
57
- font-size: 1.2rem;
58
- }
59
-
60
- #listen-btn:hover {
61
- background-color: #45a049;
62
- }
63
- </style>
64
- </head>
65
-
66
- <body>
67
-
68
- <div class="dashboard-container">
69
- <h1>Welcome to the Dashboard</h1>
70
- <p>This is your user dashboard where you can access various features.</p>
71
- <a href="/menu">Go to Menu</a>
72
- <button id="listen-btn">Say "Go to Menu"</button>
73
- </div>
74
-
75
- <script>
76
- const SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition;
77
- const recognition = new SpeechRecognition();
78
- recognition.lang = 'en-US';
79
- recognition.interimResults = false;
80
- recognition.maxAlternatives = 1;
81
-
82
- function speak(text, callback) {
83
- const msg = new SpeechSynthesisUtterance(text);
84
- msg.rate = 1;
85
- msg.onend = callback; // Call the function after speech ends
86
- window.speechSynthesis.speak(msg);
87
- }
88
-
89
- function startListening() {
90
- recognition.start();
91
- }
92
-
93
- recognition.onresult = (event) => {
94
- const command = event.results[0][0].transcript.toLowerCase();
95
- console.log("User said:", command);
96
-
97
- if (command.includes("go to menu")) {
98
- window.location.href = "/menu";
99
- }
100
- };
101
-
102
- recognition.onerror = (event) => {
103
- console.error("Speech recognition error:", event.error);
104
- speak("Sorry, I couldn't understand that. Please try again.");
105
- };
106
-
107
- // Automatic speaking and listening on page load
108
- window.onload = function () {
109
- speak("Go to Menu", startListening);
110
- };
111
-
112
- // Button for manual listening (optional)
113
- document.getElementById("listen-btn").addEventListener("click", () => {
114
- speak("Please say 'Go to Menu' to navigate to the menu.", startListening);
115
- });
116
- </script>
117
-
118
- </body>
119
-
120
- </html>