-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
295 lines (273 loc) · 18.7 KB
/
Copy pathindex.html
File metadata and controls
295 lines (273 loc) · 18.7 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
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
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Capacity Calculator - 2026</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800;900&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Inter', sans-serif;
}
.font-mono {
font-family: 'JetBrains Mono', monospace;
}
/* Custom Scrollbar for the internal dashboard view */
.custom-scrollbar::-webkit-scrollbar {
width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
background: #e2e8f0;
border-radius: 10px;
}
</style>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/lucide@latest"></script>
<link rel="stylesheet" href="style.css">
</head>
<body class="bg-[#f8fafc] font-sans text-slate-900 p-4 md:p-8 min-h-screen uppercase tracking-tight">
<div class="max-w-[1600px] mx-auto space-y-6">
<header
class="sticky top-0 z-50 bg-white/80 backdrop-blur-md p-6 rounded-[2.5rem] shadow-sm border border-slate-200 flex flex-col lg:flex-row justify-between items-center gap-6 text-center lg:text-left">
<div class="flex items-center gap-5">
<div class="p-5 bg-blue-600 rounded-3xl shadow-xl shadow-blue-100">
<i data-lucide="zap" class="text-white w-8 h-8"></i>
</div>
<div>
<h1 class="text-3xl font-black tracking-tighter italic uppercase text-slate-800">Capacity <span
class="text-blue-600">Calculator</span></h1>
<p class="text-slate-400 text-[10px] font-black uppercase tracking-[0.4em]">Strategic Resource
Framework • 2026</p>
</div>
</div>
<div class="flex items-center gap-4 bg-slate-50 p-3 rounded-2xl border">
<div id="countryGrid" class="flex gap-2 text-white"></div>
<div class="h-8 w-[1px] bg-slate-200 mx-2"></div>
<select id="targetMonth" onchange="runAnalysis()"
class="bg-transparent font-black text-blue-600 text-sm outline-none cursor-pointer"></select>
</div>
</header>
<div id="scoreboard" class="grid grid-cols-1 md:grid-cols-4 gap-4"></div>
<div class="grid grid-cols-1 lg:grid-cols-12 gap-6 items-start">
<aside class="lg:col-span-4 space-y-4">
<div class="bg-white rounded-[1.5rem] shadow-sm border overflow-hidden">
<div onclick="toggleAcc('basics')"
class="p-5 flex justify-between items-center cursor-pointer bg-slate-50/50 hover:bg-slate-50">
<span class="text-[11px] font-black uppercase tracking-widest flex items-center gap-3"><i
data-lucide="sliders" class="w-4 h-4 text-slate-500"></i> Global Basics</span>
<i data-lucide="chevron-down" id="arrow-basics" class="w-4 h-4 transition-transform"></i>
</div>
<div id="sec-basics" class="accordion-content open p-6 space-y-6">
<div class="bg-slate-100 p-1.5 rounded-2xl flex gap-1">
<button onclick="setMode('volume')" id="btn-vol"
class="flex-1 py-2 text-[10px] font-black rounded-xl transition-all bg-white text-blue-600 shadow-sm uppercase">Volume
Mode</button>
<button onclick="setMode('hours')" id="btn-hrs"
class="flex-1 py-2 text-[10px] font-black rounded-xl transition-all text-slate-500 uppercase">Hours
Mode</button>
</div>
<div class="grid grid-cols-2 gap-4">
<div class="col-span-2 text-center">
<label class="text-[9px] font-black text-slate-400 uppercase mb-2 block"
id="label-dailyTarget">Target Daily Volume (Tasks)</label>
<input type="number" id="dailyInput" value="5000" onchange="syncAll()"
class="w-full p-3 bg-slate-50 border-2 border-slate-100 rounded-xl font-black text-blue-600 outline-none text-center">
</div>
<div id="tptContainer">
<label class="text-[9px] font-bold text-slate-400 uppercase mb-1 block">Target TPT
(Tasks/Hr)</label>
<input type="number" id="globalTPT" value="20" onchange="validateRoster()"
class="w-full p-2 bg-blue-50 border border-blue-100 rounded-xl font-bold text-blue-700 text-center">
</div>
<div>
<label class="text-[9px] font-bold text-slate-400 uppercase mb-1 block">Total
CWs</label>
<input type="number" id="totalCWHeadcount" value="30" onchange="syncAll()"
class="w-full p-2 bg-slate-50 border rounded-xl font-bold text-center">
</div>
<div>
<label class="text-[9px] font-bold text-slate-400 uppercase mb-1 block">Working Days</label>
<div class="flex gap-1">
<button onclick="setWorkDays(1)" id="wd1" class="btn-toggle flex-1">1</button>
<button onclick="setWorkDays(5)" id="wd5" class="btn-toggle flex-1 active">5</button>
<button onclick="setWorkDays(6)" id="wd6" class="btn-toggle flex-1">6</button>
<button onclick="setWorkDays(7)" id="wd7" class="btn-toggle flex-1">7</button>
</div>
</div>
<div>
<label class="text-[9px] font-bold text-slate-400 uppercase mb-1 block">Work
Holidays?</label>
<div class="flex gap-1">
<button onclick="setHolWork(false)" id="holNo"
class="btn-toggle flex-1 active">NO</button>
<button onclick="setHolWork(true)" id="holYes"
class="btn-toggle flex-1">YES</button>
</div>
</div>
<div class="col-span-2 pt-2 border-t" id="intensityBox" style="display:none">
<div class="flex justify-between items-center mb-1">
<label class="text-[9px] font-bold text-slate-400 uppercase">Weekend
Intensity</label>
<span id="intVal" class="text-[10px] font-black text-blue-600">100%</span>
</div>
<input type="range" id="weekendIntensity" min="0" max="100" value="100"
oninput="updateIntensity(this.value)"
class="w-full h-1.5 bg-slate-100 rounded-lg appearance-none cursor-pointer accent-blue-600">
</div>
<div class="col-span-1 border-t pt-2">
<label class="text-[9px] font-bold text-slate-400 uppercase mb-1 block">Global Forfeit
%</label>
<input type="number" id="forfeit" value="10" onchange="validateRoster()"
class="w-full p-2 bg-slate-50 border rounded-xl font-bold text-center">
</div>
</div>
</div>
</div>
<div class="bg-white rounded-[1.5rem] shadow-sm border overflow-hidden">
<div onclick="toggleAcc('roster')"
class="p-5 flex justify-between items-center cursor-pointer bg-slate-50/50 hover:bg-slate-50">
<span
class="text-[11px] font-black uppercase tracking-widest flex items-center gap-3 text-emerald-600"><i
data-lucide="users-2" class="w-4 h-4"></i> Cloudworker Availability</span>
<i data-lucide="chevron-down" id="arrow-roster" class="w-4 h-4 transition-transform"></i>
</div>
<div id="sec-roster" class="accordion-content open p-6 space-y-4">
<div
class="flex justify-between items-center bg-emerald-50 p-2 rounded-xl px-4 text-emerald-700">
<span class="text-[10px] font-black uppercase tracking-tighter">No. of Hour Blocks </span>
<input type="number" id="rosterCount" value="4" min="1" max="8" onchange="renderRoster()"
class="w-12 p-1 bg-white border rounded text-center font-bold">
</div>
<div id="rosterContainer" class="space-y-2"></div>
<div id="rosterSummaryList" class="pt-4 border-t border-slate-100 space-y-3 px-1">
<div class="flex justify-between items-center text-[10px] font-black uppercase"><span
class="text-slate-400 tracking-widest">Headcount Alignment:</span><span
id="hcStatusLine"></span></div>
<div class="flex justify-between items-center text-[10px] font-black uppercase"><span
class="text-slate-400 tracking-widest">Net Hours Available:</span><span
id="dailyAvailLine" class="text-blue-600"></span></div>
<div
class="flex justify-between items-center text-[10px] font-black border-t border-slate-50 pt-2">
<span class="text-slate-400 tracking-widest uppercase">Capacity to Deliver:</span><span
id="volCapacityLine"></span>
</div>
<div id="hrStatusLine" class="text-[11px] font-black italic tracking-tighter pt-1"></div>
</div>
</div>
</div>
<div class="bg-white rounded-[1.5rem] shadow-sm border overflow-hidden">
<div onclick="toggleAcc('usecase')"
class="p-5 flex justify-between items-center cursor-pointer bg-slate-50/50 hover:bg-slate-50">
<span
class="text-[11px] font-black uppercase tracking-widest flex items-center gap-3 text-blue-600"><i
data-lucide="box" class="w-4 h-4"></i> Use Case Provision</span>
<i data-lucide="chevron-down" id="arrow-usecase" class="w-4 h-4 transition-transform"></i>
</div>
<div id="sec-usecase" class="accordion-content open p-6 space-y-4">
<div class="flex justify-between items-center bg-blue-50 p-2 rounded-xl px-4 text-blue-700">
<span class="text-[10px] font-black uppercase tracking-tighter">Num Use Cases</span>
<input type="number" id="ucCount" value="2" min="1" onchange="renderUCs()"
class="w-12 p-1 bg-white border rounded text-center font-bold">
</div>
<div
class="grid grid-cols-3 gap-2 px-2 text-[8px] font-black text-slate-400 uppercase text-center italic">
<span>Daily Vol/Hrs</span><span>Insights</span><span>Buffer %</span>
</div>
<div id="ucContainer" class="space-y-3"></div>
<div id="ucValidation"
class="p-3 rounded-xl text-[10px] font-black uppercase flex items-center justify-between border">
</div>
</div>
</div>
<div id="shiftStratSec" class="bg-white rounded-[1.5rem] shadow-sm border overflow-hidden">
<div onclick="toggleAcc('strat')"
class="p-5 flex justify-between items-center cursor-pointer bg-slate-50/50 hover:bg-slate-50">
<span
class="text-[11px] font-black uppercase tracking-widest flex items-center gap-3 text-purple-600"><i
data-lucide="clock" class="w-4 h-4"></i> Shift Breakdown</span>
<i data-lucide="chevron-down" id="arrow-strat" class="w-4 h-4 transition-transform"></i>
</div>
<div id="sec-strat" class="accordion-content open p-6 space-y-4">
<div id="shiftModeToggleBox" class="flex bg-slate-100 p-1 rounded-xl mb-4">
<button onclick="setShiftMode('number')" id="sModeNum"
class="flex-1 py-1 text-[9px] font-black rounded-lg transition-all bg-white text-purple-600 shadow-sm active">Numbers</button>
<button onclick="setShiftMode('percent')" id="sModePerc"
class="flex-1 py-1 text-[9px] font-black rounded-lg transition-all text-slate-500">Percent
%</button>
</div>
<div class="flex justify-between items-center">
<span class="text-[10px] font-black text-slate-400 uppercase tracking-tighter">Num Shift
Blocks</span>
<input type="number" id="shiftBlockCount" value="2" min="1" onchange="renderShifts()"
class="w-12 p-1 border rounded text-center font-bold">
</div>
<div id="shiftStratContainer" class="space-y-2"></div>
<div id="shiftValidation"
class="p-3 rounded-xl text-[10px] font-black uppercase flex items-center justify-between border">
</div>
</div>
</div>
</aside>
<main
class="lg:col-span-8 sticky top-28 bg-white rounded-[2.5rem] shadow-sm border border-slate-200 overflow-hidden flex flex-col">
<div class="flex border-b border-slate-100 bg-slate-50/30 overflow-x-auto">
<button onclick="switchTab('weekly')" id="tab-weekly" class="tab-btn active border-b-2">Availability
Timeline</button>
<button onclick="switchTab('usecase')" id="tab-usecase" class="tab-btn">By Use Case</button>
<button onclick="switchTab('summary')" id="tab-summary" class="tab-btn">Weekly Roadmap</button>
<button onclick="switchTab('blocks')" id="tab-blocks" class="tab-btn">Block Dist</button>
</div>
<div class="p-8 overflow-y-auto custom-scrollbar" style="max-height: calc(100vh - 280px);">
<div id="view-weekly" class="tab-view">
<table class="w-full text-left">
<thead class="text-[10px] font-black uppercase tracking-widest text-slate-400 border-b">
<tr>
<th class="py-6">Timeline</th>
<th class="text-center">No of CWs</th>
<th class="text-center">Demand Hours</th>
<th class="text-right px-10">Comments(Recommendation)</th>
</tr>
</thead>
<tbody id="tableBody" class="divide-y divide-slate-100 text-sm"></tbody>
</table>
</div>
<div id="view-usecase" class="tab-view hidden space-y-6">
<div id="uc-list-container" class="grid grid-cols-1 md:grid-cols-2 gap-4"></div>
</div>
<div id="view-summary" class="tab-view hidden space-y-6">
<div id="monthlyStrategyText" class="p-8 bg-slate-900 rounded-[3rem] text-white mb-6 shadow-xl border border-slate-800">
</div>
<table class="w-full text-left">
<thead class="text-[10px] font-black uppercase tracking-widest text-slate-400 border-b">
<tr>
<th class="py-6">Timeline</th>
<th class="text-center">Net Working Days</th>
<th class="text-center">Weekly Demand</th>
<th class="text-right px-10">Weekly Recommendation</th>
</tr>
</thead>
<tbody id="weeklyBreakdownBody" class="divide-y divide-slate-100 text-sm">
</tbody>
</table>
<div class="mt-8 p-8 bg-slate-50 rounded-[3rem] border border-slate-200 shadow-inner">
<div class="mt-8 p-8 bg-white rounded-[3rem] border border-slate-100 shadow-sm">
<h4 class="text-[10px] font-black tracking-[0.3em] uppercase text-slate-400 mb-6 flex items-center gap-2">
<i data-lucide="info" class="w-3 h-3"></i> Regional Holiday Impacts
</h4>
<div id="summaryHolidayRisk" class="divide-y divide-slate-50"></div>
</div>
<div id="summaryHolidayRisk" class="space-y-2"></div>
</div>
</div>
<div id="view-blocks" class="tab-view hidden space-y-6">
<div id="block-info-text" class="text-sm font-black text-slate-500 italic mb-4"></div>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4" id="block-list-container">
</div>
</div>
</div>
</main>
</div>
</div>
<script src="script.js"></script>
</body>
</html>