-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
200 lines (196 loc) · 7.14 KB
/
index.html
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.tailwindcss.com"></script>
<script src="script.js"></script>
<title>Sleeping Barber</title>
</head>
<body>
<nav
class="flex items-center justify-between z-50 flex-wrap bg-white px-5 pt-1 pb-1 lg:px-20 sticky top-0 text-center border-b border-gray-200 shadow-sm"
>
<div class="flex items-center flex-shrink-0 text-slate-800 mr-6 p-2">
<a href="">
<img src="logo.png" class="mr-2 h-8 w-8" alt="Logo" />
</a>
<a href="/" class="font-bold text-xl">Sleeping Barber</a>
</div>
<div class="lg:hidden">
<div
class="flex items-center px-3 py-2 border rounded text-slate-800 border-gray-200 hover:text-slate-500 hover:border-gray-500"
onclick="toggleMenu()"
>
<svg
class="fill-current h-3 w-3"
viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z" />
</svg>
</div>
</div>
<div
id="menu"
class="w-full hidden text-left lg:flex lg:items-center lg:w-auto"
>
<div class="text-md">
<a
href="/"
class="block mt-4 lg:inline-block lg:mt-0 text-slate-800 hover:text-slate-500 font-semibold mr-4"
>
Home
</a>
<a
href="https://github.com/sauravhathi?tab=repositories"
class="block mt-4 lg:inline-block lg:mt-0 text-slate-800 hover:text-slate-500 font-semibold mr-4"
>
About
</a>
<a
href="https://github.com/sauravhathi"
class="block mt-4 lg:inline-block lg:mt-0 text-slate-800 hover:text-slate-500 font-semibold mr-4"
>
Contact
</a>
</div>
</div>
<div id="github" class="hidden lg:flex">
<a
href="https://github.com/sauravhathi/sleeping-barber/"
class="inline-block font-bold px-4 py-2 leading-none border rounded text-blue-600 border-blue-600 hover:border-transparent hover:text-white hover:bg-blue-600 mt-4 lg:mt-0"
>
Github
</a>
</div>
</nav>
<hero
class="grid px-5 lg:px-14 grid-cols-1 lg:grid-cols-2 items-center justify-items-center h-screen"
>
<div class="flex flex-col items-center lg:items-start gap-20">
<div class="w-10/12">
<h1 class="text-4xl font-bold text-slate-800">
Sleeping Barber Simulation
</h1>
<p class="text-xl text-slate-800 mt-4">
This is a simulation of the Sleeping Barber problem. The barber
sleeps until a customer arrives. If there are no customers, the
barber goes to sleep. If a customer arrives when the barber is
cutting hair, the customer waits if there are empty chairs. If there
are no empty chairs, the customer leaves the shop.
</p>
</div>
<div>
<a href="#simulation">
<button
class="bg-blue-500 hover:bg-blue-600 text-white px-14 py-4 rounded-md text-xl hover:animate-bounce font-semibold"
>
Start Simulation
</button>
</a>
</div>
</div>
<div class="hidden lg:block">
<img
src="hero.png"
class="rounded-xl w-11/12 border-2 border-blue-600 border-opacity-50 shadow-xl"
alt="Hero"
/>
</div>
</hero>
<div
class="p-4 w-11/12 xl:w-5/12 md:w-9/12 grid grid-cols-1 gap-4 mx-auto"
id="simulation"
>
<div class="flex flex-col justify-center items-center">
<h1 class="text-3xl font-bold text-center mb-4">Sleeping Barber</h1>
</div>
<div class="bg-blue-100 p-4 rounded-lg shadow-lg">
<div class="flex flex-col">
<label
class="text-gray-700 text-sm font-bold mb-2"
for="customerCount"
>Customer Count</label
>
<input
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
id="customerCount"
type="text"
placeholder="e.g. customer1 customer2 customer3"
/>
</div>
<div class="flex flex-col mt-4">
<label class="text-gray-700 text-sm font-bold mb-2" for="chairCount"
>Chair Count</label
>
<input
class="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline"
id="chairCount"
type="number"
placeholder="e.g. 2"
/>
<p id="chEr" class="text-red-600 mt-2 text-xs italic hidden">
chair must be greater than 0
</p>
</div>
<div class="flex flex-col mt-4">
<button
id="startButton"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded mt-4"
onclick="start()"
>
Start
</button>
</div>
</div>
</div>
<div class="p-4 w-9/12 grid grid-cols-1 gap-4 mx-auto">
<div class="flex flex-col justify-end items-center" >
<h1 class="text-xl font-bold text-center mb-4">Simulation Output</h1>
</div>
<div
class="grid xl:grid-cols-3 md:grid-cols-2 grid-cols-1 gap-4 bg-blue-100 p-4 rounded-lg"
>
<div class="bg-white p-4 rounded-lg shadow-lg">
<h2 class="text-xl font-bold text-center">Customer Leaving Shop</h2>
<div id="leaveWaitingRoom" class="grid grid-cols-1 gap-4 mt-4"></div>
</div>
<div class="bg-white p-4 rounded-lg shadow-lg">
<h2 class="text-xl font-bold text-center">Customer Waiting Room</h2>
<div id="waitingRoom" class="grid grid-cols-1 gap-4 mt-4"></div>
</div>
<div class="bg-white p-4 rounded-lg shadow-lg">
<h2 class="text-xl font-bold text-center">Haircut Room</h2>
<div id="cuttingRoom" class="grid grid-cols-1 gap-4 mt-4"></div>
</div>
<div
id="cuttingLeaving"
class="bg-white p-4 rounded-lg shadow-lg hidden"
>
<h2 class="text-xl font-bold text-center">
Customer Leaving After Cut
</h2>
<div
id="cuttingLeavingRoom"
class="grid grid-cols-1 gap-4 mt-4"
></div>
</div>
<div id="baberSl" class="bg-white p-4 rounded-lg shadow-lg hidden">
<h2 class="text-xl font-bold text-center">Barber Sleeping</h2>
<div id="barberSleeping" class="mt-4"></div>
</div>
</div>
</div>
<footer
id="checkAuthor"
class="text-center text-sm p-4 bottom-0 border-t border-gray-200 w-full"
>
Made with ❤️ by
<a href="https://github.com/sauravhathi" class="text-blue-500">
Saurav Hathi
</a>
</footer>
</body>
</html>