-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
384 lines (353 loc) · 21 KB
/
Copy pathindex.html
File metadata and controls
384 lines (353 loc) · 21 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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Superset Company Organizer</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/xlsx/0.18.5/xlsx.full.min.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
<style>
body { font-family: 'Inter', sans-serif; }
.fade-in { animation: fadeIn 0.3s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.tag { transition: all 0.15s ease; }
.tag:hover { filter: brightness(0.92); }
tr.row-enter { animation: rowSlide 0.25s ease-out; }
@keyframes rowSlide { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: translateX(0); } }
</style>
</head>
<body class="bg-slate-50 min-h-screen">
<!-- Header -->
<header class="bg-white border-b border-slate-200 sticky top-0 z-30">
<div class="max-w-6xl mx-auto px-6 py-4 flex items-center justify-between">
<div class="flex items-center gap-3">
<div class="w-9 h-9 rounded-lg bg-blue-600 flex items-center justify-center">
<svg class="w-5 h-5 text-white" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/></svg>
</div>
<div>
<h1 class="text-lg font-semibold text-slate-900">Superset Company Organizer</h1>
<p class="text-xs text-slate-400">Paste, categorize & export your company list</p>
</div>
</div>
<div class="flex items-center gap-3">
<span id="counterBadge" class="text-sm text-slate-500 bg-slate-100 px-3 py-1 rounded-full font-medium">0 companies</span>
<button onclick="exportToExcel()" class="inline-flex items-center gap-2 bg-blue-600 hover:bg-blue-700 text-white text-sm font-medium px-4 py-2 rounded-lg shadow-sm transition">
<svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>
Export Excel
</button>
</div>
</div>
</header>
<main class="max-w-6xl mx-auto px-6 py-8 space-y-8">
<!-- Input Section -->
<section class="bg-white rounded-xl border border-slate-200 shadow-sm p-6 fade-in">
<h2 class="text-sm font-semibold text-slate-700 mb-4">Add Companies</h2>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
<!-- Single Add -->
<div>
<label class="block text-xs font-medium text-slate-500 mb-1.5">Add one company</label>
<div class="flex gap-2">
<input id="singleName" type="text" placeholder="e.g. Google" class="flex-1 border border-slate-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent" />
<select id="singleCategory" class="border border-slate-200 rounded-lg px-3 py-2 text-sm text-slate-600 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="">Category</option>
<option value="Tech">Tech</option>
<option value="Finance">Finance</option>
<option value="Consulting">Consulting</option>
<option value="Healthcare">Healthcare</option>
<option value="E-Commerce">E-Commerce</option>
<option value="Manufacturing">Manufacturing</option>
<option value="Startup">Startup</option>
<option value="Other">Other</option>
</select>
<select id="singleStatus" class="border border-slate-200 rounded-lg px-3 py-2 text-sm text-slate-600 focus:outline-none focus:ring-2 focus:ring-blue-500">
<option value="Not Applied">Not Applied</option>
<option value="Applied">Applied</option>
<option value="Shortlisted">Shortlisted</option>
<option value="Interview">Interview</option>
<option value="Offered">Offered</option>
<option value="Rejected">Rejected</option>
</select>
<button onclick="addSingle()" class="bg-blue-600 hover:bg-blue-700 text-white px-4 py-2 rounded-lg text-sm font-medium transition">Add</button>
</div>
</div>
<!-- Bulk Paste -->
<div>
<label class="block text-xs font-medium text-slate-500 mb-1.5">Bulk paste (one company per line)</label>
<div class="flex gap-2">
<textarea id="bulkInput" rows="1" placeholder="Google Microsoft Amazon" class="flex-1 border border-slate-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent resize-y min-h-[38px]"></textarea>
<button onclick="addBulk()" class="bg-slate-700 hover:bg-slate-800 text-white px-4 py-2 rounded-lg text-sm font-medium transition self-start">Paste All</button>
</div>
</div>
</div>
</section>
<!-- Filters -->
<section class="flex flex-wrap items-center gap-3 fade-in">
<span class="text-xs font-medium text-slate-400 uppercase tracking-wider">Filter:</span>
<button onclick="setFilter('all')" data-filter="all" class="filter-btn active text-sm px-3 py-1 rounded-full border border-slate-200 bg-white text-slate-600 font-medium transition hover:border-blue-300">All</button>
<button onclick="setFilter('Tech')" data-filter="Tech" class="filter-btn text-sm px-3 py-1 rounded-full border border-slate-200 bg-white text-slate-600 font-medium transition hover:border-blue-300">Tech</button>
<button onclick="setFilter('Finance')" data-filter="Finance" class="filter-btn text-sm px-3 py-1 rounded-full border border-slate-200 bg-white text-slate-600 font-medium transition hover:border-blue-300">Finance</button>
<button onclick="setFilter('Consulting')" data-filter="Consulting" class="filter-btn text-sm px-3 py-1 rounded-full border border-slate-200 bg-white text-slate-600 font-medium transition hover:border-blue-300">Consulting</button>
<button onclick="setFilter('Healthcare')" data-filter="Healthcare" class="filter-btn text-sm px-3 py-1 rounded-full border border-slate-200 bg-white text-slate-600 font-medium transition hover:border-blue-300">Healthcare</button>
<button onclick="setFilter('E-Commerce')" data-filter="E-Commerce" class="filter-btn text-sm px-3 py-1 rounded-full border border-slate-200 bg-white text-slate-600 font-medium transition hover:border-blue-300">E-Commerce</button>
<button onclick="setFilter('Startup')" data-filter="Startup" class="filter-btn text-sm px-3 py-1 rounded-full border border-slate-200 bg-white text-slate-600 font-medium transition hover:border-blue-300">Startup</button>
<button onclick="setFilter('Other')" data-filter="Other" class="filter-btn text-sm px-3 py-1 rounded-full border border-slate-200 bg-white text-slate-600 font-medium transition hover:border-blue-300">Other</button>
<button onclick="setFilter('Uncategorized')" data-filter="Uncategorized" class="filter-btn text-sm px-3 py-1 rounded-full border border-slate-200 bg-white text-slate-600 font-medium transition hover:border-blue-300">Uncategorized</button>
<div class="ml-auto">
<input id="searchInput" type="text" placeholder="Search companies..." oninput="renderTable()" class="border border-slate-200 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent w-52" />
</div>
</section>
<!-- Table -->
<section class="bg-white rounded-xl border border-slate-200 shadow-sm overflow-hidden fade-in">
<div class="overflow-x-auto">
<table class="w-full text-sm">
<thead>
<tr class="border-b border-slate-100 bg-slate-50/60">
<th class="text-left px-5 py-3 text-xs font-semibold text-slate-400 uppercase tracking-wider w-10">#</th>
<th class="text-left px-5 py-3 text-xs font-semibold text-slate-400 uppercase tracking-wider cursor-pointer hover:text-slate-600" onclick="sortBy('name')">Company Name</th>
<th class="text-left px-5 py-3 text-xs font-semibold text-slate-400 uppercase tracking-wider cursor-pointer hover:text-slate-600" onclick="sortBy('category')">Category</th>
<th class="text-left px-5 py-3 text-xs font-semibold text-slate-400 uppercase tracking-wider cursor-pointer hover:text-slate-600" onclick="sortBy('status')">Status</th>
<th class="text-left px-5 py-3 text-xs font-semibold text-slate-400 uppercase tracking-wider">Notes</th>
<th class="text-left px-5 py-3 text-xs font-semibold text-slate-400 uppercase tracking-wider cursor-pointer hover:text-slate-600" onclick="sortBy('dateAdded')">Added</th>
<th class="px-5 py-3 w-12"></th>
</tr>
</thead>
<tbody id="tableBody"></tbody>
</table>
</div>
<div id="emptyState" class="hidden py-16 text-center">
<svg class="w-12 h-12 mx-auto text-slate-300 mb-3" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/></svg>
<p class="text-slate-400 text-sm">No companies added yet. Paste or add companies above.</p>
</div>
</section>
<!-- Stats -->
<section id="statsSection" class="hidden grid grid-cols-2 md:grid-cols-4 gap-4 fade-in">
<div class="bg-white rounded-xl border border-slate-200 shadow-sm p-4 text-center">
<p class="text-2xl font-bold text-slate-800" id="statTotal">0</p>
<p class="text-xs text-slate-400 mt-1">Total Companies</p>
</div>
<div class="bg-white rounded-xl border border-slate-200 shadow-sm p-4 text-center">
<p class="text-2xl font-bold text-blue-600" id="statApplied">0</p>
<p class="text-xs text-slate-400 mt-1">Applied</p>
</div>
<div class="bg-white rounded-xl border border-slate-200 shadow-sm p-4 text-center">
<p class="text-2xl font-bold text-amber-600" id="statInterview">0</p>
<p class="text-xs text-slate-400 mt-1">Interviews</p>
</div>
<div class="bg-white rounded-xl border border-slate-200 shadow-sm p-4 text-center">
<p class="text-2xl font-bold text-emerald-600" id="statOffered">0</p>
<p class="text-xs text-slate-400 mt-1">Offers</p>
</div>
</section>
</main>
<script>
let companies = JSON.parse(localStorage.getItem('superset_companies') || '[]');
let activeFilter = 'all';
let sortField = 'dateAdded';
let sortDir = -1;
const categoryColors = {
'Tech': 'bg-blue-100 text-blue-700',
'Finance': 'bg-emerald-100 text-emerald-700',
'Consulting': 'bg-purple-100 text-purple-700',
'Healthcare': 'bg-rose-100 text-rose-700',
'E-Commerce': 'bg-orange-100 text-orange-700',
'Manufacturing': 'bg-slate-200 text-slate-700',
'Startup': 'bg-yellow-100 text-yellow-700',
'Other': 'bg-gray-100 text-gray-600',
'': 'bg-slate-100 text-slate-500'
};
const statusColors = {
'Not Applied': 'bg-slate-100 text-slate-600',
'Applied': 'bg-blue-100 text-blue-700',
'Shortlisted': 'bg-cyan-100 text-cyan-700',
'Interview': 'bg-amber-100 text-amber-700',
'Offered': 'bg-emerald-100 text-emerald-700',
'Rejected': 'bg-red-100 text-red-600'
};
function save() {
localStorage.setItem('superset_companies', JSON.stringify(companies));
}
function uid() {
return Date.now().toString(36) + Math.random().toString(36).slice(2, 7);
}
function addSingle() {
const nameEl = document.getElementById('singleName');
const catEl = document.getElementById('singleCategory');
const statusEl = document.getElementById('singleStatus');
const name = nameEl.value.trim();
if (!name) return;
companies.push({ id: uid(), name, category: catEl.value, status: statusEl.value, notes: '', dateAdded: new Date().toISOString() });
nameEl.value = '';
save();
renderTable();
nameEl.focus();
}
function addBulk() {
const el = document.getElementById('bulkInput');
const lines = el.value.split('\n').map(l => l.trim()).filter(Boolean);
if (!lines.length) return;
const unique = new Set(companies.map(c => c.name.toLowerCase()));
let added = 0;
lines.forEach(name => {
if (!unique.has(name.toLowerCase())) {
companies.push({ id: uid(), name, category: '', status: 'Not Applied', notes: '', dateAdded: new Date().toISOString() });
unique.add(name.toLowerCase());
added++;
}
});
el.value = '';
save();
renderTable();
if (added < lines.length) {
showToast((lines.length - added) + ' duplicate(s) skipped');
}
}
function deleteCompany(id) {
companies = companies.filter(c => c.id !== id);
save();
renderTable();
}
function updateField(id, field, value) {
const c = companies.find(c => c.id === id);
if (c) { c[field] = value; save(); renderTable(); }
}
function setFilter(f) {
activeFilter = f;
document.querySelectorAll('.filter-btn').forEach(btn => {
btn.classList.toggle('bg-blue-600', btn.dataset.filter === f);
btn.classList.toggle('text-white', btn.dataset.filter === f);
btn.classList.toggle('border-blue-600', btn.dataset.filter === f);
btn.classList.toggle('bg-white', btn.dataset.filter !== f);
btn.classList.toggle('text-slate-600', btn.dataset.filter !== f);
});
renderTable();
}
function sortBy(field) {
if (sortField === field) { sortDir *= -1; } else { sortField = field; sortDir = 1; }
renderTable();
}
function getFiltered() {
const search = document.getElementById('searchInput').value.toLowerCase();
let list = companies.filter(c => {
if (activeFilter !== 'all') {
if (activeFilter === 'Uncategorized') { if (c.category) return false; }
else if (c.category !== activeFilter) return false;
}
if (search && !c.name.toLowerCase().includes(search) && !c.category.toLowerCase().includes(search) && !c.status.toLowerCase().includes(search)) return false;
return true;
});
list.sort((a, b) => {
let va = a[sortField] || '', vb = b[sortField] || '';
if (typeof va === 'string') va = va.toLowerCase();
if (typeof vb === 'string') vb = vb.toLowerCase();
if (va < vb) return -1 * sortDir;
if (va > vb) return 1 * sortDir;
return 0;
});
return list;
}
function renderTable() {
const tbody = document.getElementById('tableBody');
const filtered = getFiltered();
const empty = document.getElementById('emptyState');
if (filtered.length === 0) {
tbody.innerHTML = '';
empty.classList.remove('hidden');
} else {
empty.classList.add('hidden');
tbody.innerHTML = filtered.map((c, i) => {
const catClass = categoryColors[c.category] || categoryColors[''];
const statClass = statusColors[c.status] || statusColors['Not Applied'];
const dateStr = new Date(c.dateAdded).toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
return `<tr class="border-b border-slate-50 hover:bg-slate-50/50 transition row-enter">
<td class="px-5 py-3 text-slate-400 text-xs">${i + 1}</td>
<td class="px-5 py-3 font-medium text-slate-800">${escHtml(c.name)}</td>
<td class="px-5 py-3">
<select onchange="updateField('${c.id}','category',this.value)" class="tag text-xs font-medium px-2.5 py-1 rounded-full border-0 cursor-pointer ${catClass}">
<option value="" ${c.category === '' ? 'selected' : ''}>Uncategorized</option>
${['Tech','Finance','Consulting','Healthcare','E-Commerce','Manufacturing','Startup','Other'].map(cat =>
`<option value="${cat}" ${c.category === cat ? 'selected' : ''}>${cat}</option>`
).join('')}
</select>
</td>
<td class="px-5 py-3">
<select onchange="updateField('${c.id}','status',this.value)" class="tag text-xs font-medium px-2.5 py-1 rounded-full border-0 cursor-pointer ${statClass}">
${['Not Applied','Applied','Shortlisted','Interview','Offered','Rejected'].map(s =>
`<option value="${s}" ${c.status === s ? 'selected' : ''}>${s}</option>`
).join('')}
</select>
</td>
<td class="px-5 py-3">
<input type="text" value="${escAttr(c.notes)}" placeholder="Add note..." onchange="updateField('${c.id}','notes',this.value)"
class="w-full bg-transparent text-sm text-slate-500 placeholder:text-slate-300 focus:outline-none focus:bg-slate-50 px-2 py-1 rounded" />
</td>
<td class="px-5 py-3 text-slate-400 text-xs">${dateStr}</td>
<td class="px-5 py-3">
<button onclick="deleteCompany('${c.id}')" class="text-slate-300 hover:text-red-500 transition">
<svg class="w-4 h-4" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"/></svg>
</button>
</td>
</tr>`;
}).join('');
}
document.getElementById('counterBadge').textContent = companies.length + ' compan' + (companies.length === 1 ? 'y' : 'ies');
updateStats();
}
function updateStats() {
const section = document.getElementById('statsSection');
if (companies.length === 0) { section.classList.add('hidden'); return; }
section.classList.remove('hidden');
section.classList.remove('hidden');
section.classList.add('grid');
document.getElementById('statTotal').textContent = companies.length;
document.getElementById('statApplied').textContent = companies.filter(c => c.status === 'Applied').length;
document.getElementById('statInterview').textContent = companies.filter(c => c.status === 'Interview').length;
document.getElementById('statOffered').textContent = companies.filter(c => c.status === 'Offered').length;
}
function exportToExcel() {
if (companies.length === 0) { showToast('No companies to export'); return; }
const rows = companies.map((c, i) => ({
'#': i + 1,
'Company Name': c.name,
'Category': c.category || 'Uncategorized',
'Status': c.status,
'Notes': c.notes,
'Date Added': new Date(c.dateAdded).toLocaleDateString()
}));
const ws = XLSX.utils.json_to_sheet(rows);
ws['!cols'] = [{ wch: 5 }, { wch: 30 }, { wch: 16 }, { wch: 14 }, { wch: 40 }, { wch: 14 }];
const wb = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(wb, ws, 'Companies');
const categories = [...new Set(companies.map(c => c.category || 'Uncategorized'))];
categories.forEach(cat => {
const catRows = companies.filter(c => (c.category || 'Uncategorized') === cat).map((c, i) => ({
'#': i + 1,
'Company Name': c.name,
'Status': c.status,
'Notes': c.notes,
'Date Added': new Date(c.dateAdded).toLocaleDateString()
}));
const catWs = XLSX.utils.json_to_sheet(catRows);
catWs['!cols'] = [{ wch: 5 }, { wch: 30 }, { wch: 14 }, { wch: 40 }, { wch: 14 }];
const sheetName = cat.length > 31 ? cat.slice(0, 31) : cat;
XLSX.utils.book_append_sheet(wb, catWs, sheetName);
});
XLSX.writeFile(wb, 'superset_companies.xlsx');
showToast('Exported ' + companies.length + ' companies to Excel');
}
function showToast(msg) {
const toast = document.createElement('div');
toast.className = 'fixed bottom-6 left-1/2 -translate-x-1/2 bg-slate-800 text-white text-sm px-5 py-2.5 rounded-lg shadow-lg z-50 fade-in';
toast.textContent = msg;
document.body.appendChild(toast);
setTimeout(() => { toast.style.transition = 'opacity 0.3s'; toast.style.opacity = '0'; setTimeout(() => toast.remove(), 300); }, 2500);
}
function escHtml(s) { const d = document.createElement('div'); d.textContent = s; return d.innerHTML; }
function escAttr(s) { return s.replace(/"/g, '"').replace(/'/g, '''); }
document.getElementById('singleName').addEventListener('keydown', e => { if (e.key === 'Enter') addSingle(); });
renderTable();
</script>
</body>
</html>