Repository navigation
Expand file tree
/
Copy pathapp.js
More file actions
131 lines (120 loc) · 5.52 KB
/
Copy pathapp.js
File metadata and controls
131 lines (120 loc) · 5.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
// Functions to switch between views
function navigate(screen) {
const content = document.getElementById("content");
switch (screen) {
case 'home':
content.innerHTML = `
<div class="card">
<h2>Hello, User!</h2>
<p>Welcome back to LaundryMate.</p>
<p>My Credits: 850</p>
<button onclick="navigate('redeemCredits')">Redeem Rewards</button>
</div>
<div class="card">
<h2>Machine Status Board</h2>
<p>Washing Machine #1 - Available</p>
<p>Washing Machine #2 - In Use - 15 minutes remaining</p>
<p>Washing Machine #3 - Available</p>
</div>
<div class="card">
<h2>Quick Actions Menu</h2>
<button onclick="navigate('reservations')">Reserve Machine</button>
<button onclick="navigate('requestHelp')">Request Help</button>
<button onclick="navigate('sendReminder')">Send Reminder</button>
<button onclick="navigate('history')">View History</button>
</div>
`;
break;
case 'redeemCredits':
content.innerHTML = `
<div class="card">
<h2>Redeem Credits</h2>
<p>Select a reward to redeem your credits.</p>
<button onclick="alert('Free Laundry Token - 500 Credits')">Free Laundry Token - 500 Credits</button>
<button onclick="alert('Discount Voucher - 700 Credits')">Discount Voucher - 700 Credits</button>
<button onclick="alert('Premium Detergent - 1000 Credits')">Premium Detergent - 1000 Credits</button>
<button onclick="navigate('home')">Back to Home</button>
</div>
`;
break;
case 'notifications':
content.innerHTML = `
<div class="card">
<h2>Notifications</h2>
<p>1. Your laundry in Machine #2 will be done in 10 minutes.</p>
<p>2. You received 50 credits for on-time pickup.</p>
<p>3. New discount available for LaundryMate members.</p>
<button onclick="navigate('home')">Back to Home</button>
</div>
`;
break;
case 'reservations':
content.innerHTML = `
<div class="card">
<h2>Reserve a Machine</h2>
<p>Select a machine and time slot</p>
<button onclick="alert('Machine #1 - Available')">Machine #1 - Available</button>
<button onclick="alert('Machine #2 - 15 min wait')">Machine #2 - 15 min wait</button>
<button onclick="alert('Machine #3 - Available')">Machine #3 - Available</button>
<button onclick="navigate('home')">Confirm Reservation</button>
</div>
`;
break;
case 'settings':
content.innerHTML = `
<div class="card">
<h2>Settings</h2>
<button onclick="alert('Notification Preferences')">Notification Preferences</button>
<button onclick="alert('Edit Profile')">Edit Profile</button>
</div>
`;
break;
case 'community':
content.innerHTML = `
<div class="card">
<h2>Community</h2>
<p>Connect with other users, share tips, and help each other.</p>
<button onclick="alert('Join Discussion')">Join Discussion</button>
<button onclick="alert('View Karma Leaderboard')">View Credits Leaderboard</button>
</div>
`;
break;
case 'requestHelp':
content.innerHTML = `
<div class="card">
<h2>Request Help</h2>
<p>If you're running late or need assistance with your laundry, let us know!</p>
<button onclick="alert('Help Request Submitted')">Submit Request</button>
<br />
<button onclick="navigate('home')">Back to Home</button>
</div>
`;
break;
case 'sendReminder':
content.innerHTML = `
<div class="card">
<h2>Send Reminder</h2>
<p>Send a reminder for laundry pickup.</p>
<button onclick="alert('Reminder Sent')">Send Reminder</button>
<br />
<button onclick="navigate('home')">Back to Home</button>
</div>
`;
break;
case 'history':
content.innerHTML = `
<div class="card">
<h2>View History</h2>
<p>Here you can see your laundry activity history.</p>
<button onclick="alert('Viewing History')">View History</button>
<br />
<button onclick="navigate('home')">Back to Home</button>
</div>
`;
break;
default:
content.innerHTML = "<h2>Welcome to LaundryMate</h2>";
}
}
// Initial screen load
navigate('home');