Repository navigation
Expand file tree
/
Copy pathapp.js
More file actions
616 lines (536 loc) · 32.1 KB
/
Copy pathapp.js
File metadata and controls
616 lines (536 loc) · 32.1 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
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
/**
* KodNest Job Notification Tracker
* Core Application Logic - Final Overhaul & Fixes
*/
// --- State Management ---
const state = {
currentRoute: window.location.hash || '#/',
preferences: JSON.parse(localStorage.getItem('jobTrackerPreferences')) || {
roleKeywords: 'Full Stack, Developer, SDE',
preferredLocations: ['Bangalore', 'Pune', 'Remote'],
preferredMode: ['Remote', 'Hybrid'],
experienceLevel: 'Fresher',
skills: 'React, Java, SQL',
minMatchScore: 40
},
savedJobs: JSON.parse(localStorage.getItem('jobTrackerSaved')) || [],
jobStatus: JSON.parse(localStorage.getItem('jobTrackerStatus')) || {},
testsPassed: JSON.parse(localStorage.getItem('jobTrackerTests')) || Array(10).fill(false),
proof: JSON.parse(localStorage.getItem('jobTrackerProof')) || {
lovable: 'https://lovable.dev/p/bhajarangi_06',
github: 'https://github.com/user/bhajarangi_06',
deployed: 'https://bhajarangi-tracker.vercel.app'
},
filters: {
keyword: '',
location: '',
mode: '',
experience: '',
source: '',
status: 'All',
showOnlyMatches: false,
sort: 'Latest'
},
modalJob: null
};
// --- Utilities ---
const saveLocal = () => {
localStorage.setItem('jobTrackerPreferences', JSON.stringify(state.preferences));
localStorage.setItem('jobTrackerSaved', JSON.stringify(state.savedJobs));
localStorage.setItem('jobTrackerStatus', JSON.stringify(state.jobStatus));
localStorage.setItem('jobTrackerTests', JSON.stringify(state.testsPassed));
localStorage.setItem('jobTrackerProof', JSON.stringify(state.proof));
};
const getMatchScore = (job) => {
if (!state.preferences) return 0;
const pref = state.preferences;
let score = 0;
const keywords = pref.roleKeywords?.toLowerCase().split(',').map(k => k.trim()) || [];
if (keywords.some(k => job.title.toLowerCase().includes(k))) score += 25;
if (keywords.some(k => job.description.toLowerCase().includes(k))) score += 15;
if (pref.preferredLocations?.includes(job.location)) score += 15;
if (pref.preferredMode?.includes(job.mode)) score += 10;
if (job.experience === pref.experienceLevel) score += 10;
const prefSkills = pref.skills?.toLowerCase().split(',').map(s => s.trim()) || [];
if (job.skills.some(s => prefSkills.includes(s.toLowerCase()))) score += 15;
if (job.postedDaysAgo <= 2) score += 5;
if (job.source === 'LinkedIn') score += 5;
return Math.min(score, 100);
};
// --- Routing ---
const navigate = (hash) => {
window.location.hash = hash;
state.currentRoute = hash;
render();
};
window.addEventListener('hashchange', () => {
state.currentRoute = window.location.hash || '#/';
render();
});
// --- UI Helpers ---
const showToast = (msg) => {
const toast = document.createElement('div');
toast.className = 'card';
toast.style = "position: fixed; bottom: 24px; right: 24px; z-index: 2000; border-color: var(--accent-color); padding: 12px 24px; pointer-events: none; opacity: 0; transform: translateY(20px); transition: 0.3s; background: white; font-weight: 700; font-size: 13px; color: var(--accent-color);";
toast.innerText = msg;
document.body.appendChild(toast);
setTimeout(() => { toast.style.opacity = '1'; toast.style.transform = 'translateY(0)'; }, 10);
setTimeout(() => {
toast.style.opacity = '0';
toast.style.transform = 'translateY(20px)';
setTimeout(() => toast.remove(), 300);
}, 2500);
};
// --- Components ---
const TopBar = () => `
<div class="top-bar">
<div class="project-name" style="cursor: pointer" onclick="navigate('#/')">KodNest <span>PREMIUM</span></div>
<nav>
<a href="#/dashboard" class="${state.currentRoute === '#/dashboard' ? 'active' : ''}">Dashboard</a>
<a href="#/saved" class="${state.currentRoute === '#/saved' ? 'active' : ''}">Saved</a>
<a href="#/digest" class="${state.currentRoute === '#/digest' ? 'active' : ''}">Digest</a>
<a href="#/jt/07-test" class="${state.currentRoute === '#/jt/07-test' ? 'active' : ''}">Test</a>
<a href="#/proof" class="${['#/proof', '#/jt/08-ship'].includes(state.currentRoute) ? 'active' : ''}">Proof</a>
<a href="#/settings" class="${state.currentRoute === '#/settings' ? 'active' : ''}">Settings</a>
</nav>
</div>
`;
const JobCard = (job) => {
const score = getMatchScore(job);
const isSaved = state.savedJobs.includes(job.id);
const status = state.jobStatus[job.id] || 'Not Applied';
return `
<div class="card animate-fade-in" style="display: flex; flex-direction: column; gap: 12px; height: 100%;">
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
<div style="flex: 1">
<h3 class="serif" style="font-size: 17px; margin-bottom: 2px; color: var(--text-primary); cursor: pointer;" onclick="viewJob(${job.id})">${job.title}</h3>
<div style="font-size: 13px; color: var(--text-muted); font-weight: 600;">${job.company}</div>
</div>
<div style="font-size: 11px; color: #BBB; font-weight: 700;">${job.postedDaysAgo === 0 ? 'Today' : `${job.postedDaysAgo}D ago`}</div>
</div>
<div style="display: flex; flex-wrap: wrap; gap: 4px;">
<span class="tag">📍 ${job.location}</span>
<span class="tag">🏠 ${job.mode}</span>
<span class="tag">🎓 ${job.experience}</span>
<span class="tag ${score >= 60 ? 'tag-green' : score >= 40 ? 'tag-blue' : 'tag'}">${score}% Match</span>
</div>
<div style="font-weight: 800; font-size: 14px; margin-top: auto; color: var(--text-primary);">${job.salaryRange}</div>
<div style="font-size: 10px; color: var(--accent-color); font-weight: 800; text-transform: uppercase;">VIA ${job.source}</div>
<div style="display: flex; gap: 6px; margin-top: 8px; border-top: 1px solid #F5F5F5; padding-top: 12px; align-items: center;">
<select style="flex: 1.2; padding: 0 8px; font-size: 11px; height: 32px; font-weight: 700;" onchange="updateStatus(${job.id}, this.value)">
<option value="Not Applied" ${status === 'Not Applied' ? 'selected' : ''}>Not Applied</option>
<option value="Applied" ${status === 'Applied' ? 'selected' : ''}>Applied</option>
<option value="Rejected" ${status === 'Rejected' ? 'selected' : ''}>Rejected</option>
<option value="Selected" ${status === 'Selected' ? 'selected' : ''}>Selected</option>
</select>
<button class="btn btn-secondary" style="flex: 0.8; padding: 0; height: 32px; font-size: 10px; ${isSaved ? 'color: var(--accent-color); border-color: var(--accent-color);' : ''}" onclick="toggleSave(${job.id})">${isSaved ? 'Saved' : 'Save'}</button>
<button class="btn btn-secondary" style="flex: 0.8; padding: 0; height: 32px; font-size: 10px;" onclick="viewJob(${job.id})">View</button>
</div>
</div>
`;
};
// --- Page Renderers ---
const PageHome = () => `
${TopBar()}
<div class="main-layout" style="display: flex; flex-direction: column; justify-content: center; align-items: center; min-height: 80vh; text-align: center;">
<h1 class="serif" style="font-size: 56px; line-height: 1.1; margin-bottom: 24px;">The smarter way to<br>land your next role.</h1>
<p style="font-size: 19px; color: var(--text-muted); max-width: 600px; margin-bottom: 40px;">Real-time matching, hand-picked daily digests, and an intentional career pipeline designed for high-performance engineers.</p>
<div style="display: flex; gap: 16px;">
<button class="btn btn-primary" style="padding: 16px 40px; font-size: 14px;" onclick="navigate('#/settings')">Get Started</button>
<button class="btn btn-secondary" style="padding: 16px 40px; font-size: 14px;" onclick="navigate('#/dashboard')">Explore Feed</button>
</div>
</div>
`;
const PageDashboard = () => {
let jobs = JOBS_DATA.map(j => ({ ...j, matchScore: getMatchScore(j) }));
if (state.filters.keyword) {
const kw = state.filters.keyword.toLowerCase();
jobs = jobs.filter(j => j.title.toLowerCase().includes(kw) || j.company.toLowerCase().includes(kw));
}
if (state.filters.location) jobs = jobs.filter(j => j.location === state.filters.location);
if (state.filters.mode) jobs = jobs.filter(j => j.mode === state.filters.mode);
if (state.filters.experience) jobs = jobs.filter(j => j.experience === state.filters.experience);
if (state.filters.status !== 'All') jobs = jobs.filter(j => (state.jobStatus[j.id] || 'Not Applied') === state.filters.status);
if (state.filters.showOnlyMatches) jobs = jobs.filter(j => j.matchScore >= state.preferences.minMatchScore);
const locations = [...new Set(JOBS_DATA.map(j => j.location))].sort();
return `
${TopBar()}
<div class="main-layout">
<div style="display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 32px; border-bottom: 1px solid var(--border-color); padding-bottom: 16px;">
<h1 class="serif" style="font-size: 32px;">Discovery Feed</h1>
<div style="display: flex; align-items: center; gap: 12px;">
<label style="margin: 0; font-size: 11px; display: flex; align-items: center; gap: 8px; cursor: pointer;">
<input type="checkbox" style="width: 14px; height: 14px;" ${state.filters.showOnlyMatches ? 'checked' : ''} onchange="updateFilter('showOnlyMatches', this.checked)">
Show Only High Matches
</label>
<span class="tag tag-blue">${jobs.length} Opportunities</span>
</div>
</div>
<div class="filter-bar">
<input type="text" placeholder="Search Role..." value="${state.filters.keyword}" oninput="updateFilter('keyword', this.value)">
<select onchange="updateFilter('location', this.value)">
<option value="">All Regions</option>
${locations.map(l => `<option value="${l}" ${state.filters.location === l ? 'selected' : ''}>${l}</option>`).join('')}
</select>
<select onchange="updateFilter('mode', this.value)">
<option value="">Any Mode</option>
<option value="Remote">Remote</option><option value="Hybrid">Hybrid</option><option value="Onsite">Onsite</option>
</select>
<select onchange="updateFilter('experience', this.value)">
<option value="">Any Level</option>
<option value="Fresher">Fresher</option><option value="0-1">0-1 Year</option><option value="1-3">1-3 Years</option><option value="3-5">3-5 Years</option>
</select>
<select onchange="updateFilter('status', this.value)">
<option value="All">All Status</option>
<option value="Not Applied">Not Applied</option><option value="Applied">Applied</option>
</select>
<button class="btn btn-secondary" style="border: none; background: transparent; color: var(--accent-color); font-size: 10px;" onclick="resetFilters()">Reset All</button>
</div>
<div class="job-grid">
${jobs.length > 0 ? jobs.map(j => JobCard(j)).join('') : `
<div style="grid-column: 1 / -1; padding: 100px 0; text-align: center;">
<h2 class="serif">No results matches your criteria.</h2>
<p style="color: var(--text-muted); margin-top: 8px;">Try broadening your research or lowering the match threshold.</p>
</div>
`}
</div>
</div>
`;
};
const PageSettings = () => {
return `
${TopBar()}
<div class="main-layout" style="display: flex; justify-content: center;">
<div style="max-width: 600px; width: 100%;">
<div style="text-align: center; margin-bottom: 48px;">
<h1 class="serif" style="font-size: 36px; margin-bottom: 8px;">Tailor Your Search</h1>
<p style="color: var(--text-muted);">Adjust these parameters to power your discovery engine.</p>
</div>
<div class="card">
<div class="form-group">
<label>Role Keywords</label>
<input type="text" id="setKeywords" value="${state.preferences.roleKeywords}" placeholder="e.g. SDE, Frontend, React">
<div style="font-size: 11px; color: #BBB; margin-top: 8px;">Comma separated. These weight your match score by up to 40%.</div>
</div>
<div class="form-group" style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 32px;">
<div>
<label>Preferred Regions</label>
<select id="setLocations" multiple style="height: 120px;">
${['Bangalore', 'Pune', 'Hyderabad', 'Noida', 'Chennai', 'Mumbai', 'Gurgaon', 'Remote'].map(l => `
<option value="${l}" ${state.preferences.preferredLocations.includes(l) ? 'selected' : ''}>${l}</option>
`).join('')}
</select>
</div>
<div>
<label>Target Level</label>
<select id="setExp" style="height: auto;">
<option value="Fresher" ${state.preferences.experienceLevel === 'Fresher' ? 'selected' : ''}>Fresher</option>
<option value="0-1" ${state.preferences.experienceLevel === '0-1' ? 'selected' : ''}>0-1 Year</option>
<option value="1-3" ${state.preferences.experienceLevel === '1-3' ? 'selected' : ''}>1-3 Years</option>
<option value="3-5" ${state.preferences.experienceLevel === '3-5' ? 'selected' : ''}>3-5 Years</option>
</select>
<label style="margin-top: 20px;">Work Mode Preference</label>
<div style="display: flex; gap: 8px; flex-direction: column;">
<label style="font-weight: 500; font-size: 13px; color: #444; margin: 0; text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: 8px;">
<input type="checkbox" value="Remote" id="chkRemote" ${state.preferences.preferredMode.includes('Remote') ? 'checked' : ''} style="width: auto;"> 🏠 Remote
</label>
<label style="font-weight: 500; font-size: 13px; color: #444; margin: 0; text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: 8px;">
<input type="checkbox" value="Hybrid" id="chkHybrid" ${state.preferences.preferredMode.includes('Hybrid') ? 'checked' : ''} style="width: auto;"> 🏢 Hybrid
</label>
</div>
</div>
</div>
<div class="form-group" style="margin-top: 32px;">
<label>Skills & Expertise</label>
<input type="text" id="setSkills" value="${state.preferences.skills}" placeholder="e.g. Java, Python, AWS">
</div>
<div class="form-group" style="margin-top: 32px;">
<label>Discovery Threshold: <span id="thresholdVal">${state.preferences.minMatchScore}%</span></label>
<input type="range" min="0" max="80" value="${state.preferences.minMatchScore}" oninput="document.getElementById('thresholdVal').innerText = this.value + '%'" id="setThreshold">
</div>
<button class="btn btn-primary" style="width: 100%; margin-top: 40px; height: 56px;" onclick="savePreferences()">Save Discover Settings</button>
</div>
</div>
</div>
`;
};
const PageDigest = () => {
const digest = JOBS_DATA
.map(j => ({ ...j, matchScore: getMatchScore(j) }))
.sort((a, b) => b.matchScore - a.matchScore)
.slice(0, 10);
return `
${TopBar()}
<div class="main-layout" style="display: flex; justify-content: center;">
<div style="max-width: 700px; width: 100%;">
<div class="card" style="padding: 0; overflow: hidden; border-style: dashed; background: rgba(255,255,255,0.6);">
<div style="padding: 64px 40px; text-align: center; border-bottom: 2px dashed var(--border-color);">
<div style="text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: 0.2em; color: var(--accent-color); margin-bottom: 12px;">The 9AM Dispatch</div>
<h1 class="serif" style="font-size: 40px;">Today's Strategic Picks</h1>
<p style="color: var(--text-muted); margin-top: 12px; font-style: italic;">"Opportunity is a haughty goddess who wastes no time with those who are unprepared."</p>
</div>
<div style="padding: 24px;">
${digest.map((j, i) => `
<div style="display: flex; align-items: flex-start; padding: 20px; border-bottom: 1px solid #F5F5F5; gap: 24px;">
<div style="font-family: var(--font-serif); font-weight: 800; color: #EEE; font-size: 32px; line-height: 1;">${(i + 1).toString().padStart(2, '0')}</div>
<div style="flex: 1;">
<div style="font-weight: 700; font-size: 16px; margin-bottom: 4px;">${j.title}</div>
<div style="font-size: 13px; color: var(--text-muted); font-weight: 600;">${j.company} • ${j.location}</div>
<div style="display: flex; gap: 4px; margin-top: 12px;">
<span class="tag tag-purple">${j.experience}</span>
<span class="tag ${getMatchScore(j) >= 60 ? 'tag-green' : 'tag-blue'}">${getMatchScore(j)}% Match</span>
</div>
</div>
<button class="btn btn-secondary" style="height: 36px; padding: 0 16px; font-size: 11px;" onclick="viewJob(${j.id})">Review</button>
</div>
`).join('')}
</div>
<div style="padding: 40px; text-align: center; background: white;">
<div style="display: flex; gap: 16px; justify-content: center;">
<button class="btn btn-secondary" onclick="copyDigest()">📄 Copy Digest</button>
<button class="btn btn-primary" onclick="emailDigest()">✉️ Email My List</button>
</div>
</div>
</div>
</div>
</div>
`;
};
const PageTests = () => {
const testTitles = [
"Interactive Prefs Persistence",
"Deterministic Matching Algorithm",
"Threshold Filtering Precision",
"Session Artifact Encryption (Sim)",
"Deep Link Routing Verification",
"Reactive Status Synchronization",
"Digest Recalculation Trigger",
"Asset Manifest Consistency",
"Mobile Layout Adaptability",
"Zero-Error Runtime Execution"
];
const passedCount = state.testsPassed.filter(t => t).length;
return `
${TopBar()}
<div class="main-layout" style="display: flex; justify-content: center;">
<div style="max-width: 600px; width: 100%;">
<div style="text-align: center; margin-bottom: 48px;">
<h1 class="serif" style="font-size: 36px; margin-bottom: 8px;">System Integrity</h1>
<p style="color: var(--text-muted);">Ensure all modules are operational before project shipment.</p>
</div>
<div class="card">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px;">
<h3 class="serif">Safety Checks: <span style="color: ${passedCount === 10 ? 'var(--success-color)' : 'var(--accent-color)'}">${passedCount}/10</span></h3>
<button class="btn btn-secondary" style="font-size: 10px; height: 32px;" onclick="resetTests()">Reset Audit</button>
</div>
<div style="display: flex; flex-direction: column; gap: 8px;">
${testTitles.map((t, i) => `
<label style="border: 1px solid var(--border-color); padding: 16px; border-radius: 8px; display: flex; align-items: center; gap: 16px; margin: 0; cursor: pointer; transition: 0.2s; background: ${state.testsPassed[i] ? '#F1F8E9' : 'transparent'}; border-color: ${state.testsPassed[i] ? 'var(--success-color)' : 'var(--border-color)'}">
<input type="checkbox" style="width: 18px; height: 18px;" ${state.testsPassed[i] ? 'checked' : ''} onchange="toggleTest(${i}, this.checked)">
<div style="flex: 1">
<div style="font-size: 14px; color: var(--text-primary); font-weight: 700; text-transform: none; letter-spacing: 0;">${t}</div>
<div style="font-size: 11px; font-weight: 600; color: #BBB;">COMPONENT STAGE ${i + 1}.0.C</div>
</div>
${state.testsPassed[i] ? '<span style="color: var(--success-color); font-weight: 800; font-size: 11px;">PASS</span>' : ''}
</label>
`).join('')}
</div>
</div>
</div>
</div>
`;
};
const PageProof = () => {
const isReady = state.testsPassed.every(t => t);
return `
${TopBar()}
<div class="main-layout" style="display: flex; gap: 64px; align-items: flex-start; padding-top: 40px;">
<div style="flex: 0.8;">
<div style="text-transform: uppercase; font-size: 11px; font-weight: 800; color: var(--accent-color); margin-bottom: 12px; letter-spacing: 0.2em;">Manifest V1.0</div>
<h1 class="serif" style="font-size: 48px; line-height: 1.1; margin-bottom: 24px;">Project Shipment Details</h1>
<p style="color: var(--text-muted); margin-bottom: 40px;">The final step in our premium build workflow. Verify your artifact links and confirm technical milestones.</p>
<div class="milestone-list">
<div class="milestone-item"><div class="milestone-dot complete"></div> Core Framework Implementation</div>
<div class="milestone-item"><div class="milestone-dot complete"></div> Premium Design System Tokens</div>
<div class="milestone-item"><div class="milestone-dot complete"></div> Real-time Match Score Runtime</div>
<div class="milestone-item"><div class="milestone-dot complete"></div> 9AM Algorithm Scripting</div>
<div class="milestone-item"><div class="milestone-dot ${isReady ? 'complete' : ''}"></div> System Integrity Audit</div>
</div>
<div style="margin-top: 48px;">
<label>Shipment Condition</label>
<div style="font-size: 13px; font-weight: 700; color: ${isReady ? 'var(--success-color)' : 'var(--accent-color)'}">
${isReady ? '✓ STATUS: READY FOR EXPORT' : '× STATUS: BLOCKED BY AUDIT'}
</div>
</div>
</div>
<div style="flex: 1.2;">
<div class="card" style="padding: 48px;">
<h3 class="serif" style="margin-bottom: 24px;">Artifact Manifest</h3>
<p style="font-size: 13px; color: var(--text-muted); margin-bottom: 32px;">Input your live production URLs below. These will be encoded into your final submission package.</p>
<div class="form-group">
<label>Lovable Project Link</label>
<input type="text" id="pLovable" value="${state.proof.lovable}" placeholder="https://lovable.dev/...">
</div>
<div class="form-group" style="margin-top: 24px;">
<label>GitHub Repository</label>
<input type="text" id="pGithub" value="${state.proof.github}" placeholder="https://github.com/...">
</div>
<div class="form-group" style="margin-top: 24px;">
<label>Production Deployment</label>
<input type="text" id="pDeployed" value="${state.proof.deployed}" placeholder="https://...">
</div>
<div style="margin-top: 48px; border-top: 1px solid #F5F5F5; padding-top: 32px; text-align: center;">
${isReady ? `
<div style="font-size: 12px; font-weight: 800; color: var(--success-color); margin-bottom: 16px;">✓ ALL SAFETY PARAMETERS CONFIRMED</div>
<button class="btn btn-primary" style="width: 100%; height: 56px;" onclick="copyFinalProof()">Copy Final Submission</button>
` : `
<div style="font-size: 12px; font-weight: 800; color: var(--accent-color); margin-bottom: 16px;">× SYSTEM INCOMPLETE — FINISH AUDIT FIRST</div>
<button class="btn btn-secondary" style="width: 100%; height: 56px;" onclick="navigate('#/jt/07-test')">Go to Quality Audit</button>
`}
</div>
</div>
</div>
</div>
`;
};
// --- Action Logic ---
window.updateFilter = (key, val) => {
state.filters[key] = val;
render();
};
window.resetFilters = () => {
state.filters = { keyword: '', location: '', mode: '', experience: '', source: '', status: 'All', showOnlyMatches: false, sort: 'Latest' };
render();
};
window.updateStatus = (id, status) => {
state.jobStatus[id] = status;
saveLocal();
showToast(`Progress logged: ${status}`);
render();
};
window.toggleSave = (id) => {
const idx = state.savedJobs.indexOf(id);
if (idx > -1) state.savedJobs.splice(idx, 1);
else state.savedJobs.push(id);
saveLocal();
render();
};
window.savePreferences = () => {
const modes = [];
if (document.getElementById('chkRemote').checked) modes.push('Remote');
if (document.getElementById('chkHybrid').checked) modes.push('Hybrid');
const locations = Array.from(document.getElementById('setLocations').selectedOptions).map(o => o.value);
state.preferences = {
roleKeywords: document.getElementById('setKeywords').value,
preferredLocations: locations,
preferredMode: modes,
experienceLevel: document.getElementById('setExp').value,
skills: document.getElementById('setSkills').value,
minMatchScore: parseInt(document.getElementById('setThreshold').value)
};
saveLocal();
showToast("Preferences Updated Successfully");
setTimeout(() => navigate('#/dashboard'), 800);
};
window.toggleTest = (i, val) => {
state.testsPassed[i] = val;
saveLocal();
render();
};
window.resetTests = () => {
if (confirm("Reset all quality audit steps?")) {
state.testsPassed = Array(10).fill(false);
saveLocal();
render();
}
};
window.viewJob = (id) => {
state.modalJob = JOBS_DATA.find(j => j.id === id);
renderModal();
};
window.closeModal = () => {
state.modalJob = null;
document.getElementById('modal-root').innerHTML = '';
};
window.copyDigest = () => {
const digest = JOBS_DATA.map(j => ({ ...j, s: getMatchScore(j) })).sort((a, b) => b.s - a.s).slice(0, 10);
const text = digest.map((j, i) => `${i + 1}. ${j.title} at ${j.company} (${j.s}% match)`).join('\n');
navigator.clipboard.writeText(text);
showToast("Digest Copied to Clipboard");
};
window.emailDigest = () => {
window.location.href = `mailto:?subject=9AM Strategic Job Digest&body=Explore your daily top picks on your dashboard.`;
};
window.copyFinalProof = () => {
state.proof = {
lovable: document.getElementById('pLovable').value,
github: document.getElementById('pGithub').value,
deployed: document.getElementById('pDeployed').value
};
saveLocal();
const text = `PROJECT 01: JOB NOTIFICATION TRACKER
Artifact Manifest:
- Lovable: ${state.proof.lovable}
- GitHub: ${state.proof.github}
- Live: ${state.proof.deployed}
System Status: Verified / Shipped.`;
navigator.clipboard.writeText(text);
showToast("Submission Ready & Copied.");
};
// --- Rendering Core ---
const render = () => {
const app = document.getElementById('app');
const route = state.currentRoute;
if (route === '#/dashboard') app.innerHTML = PageDashboard();
else if (route === '#/settings') app.innerHTML = PageSettings();
else if (route === '#/saved') {
const jobs = JOBS_DATA.filter(j => state.savedJobs.includes(j.id));
app.innerHTML = `
${TopBar()}
<div class="main-layout">
<h1 class="serif" style="margin-bottom: 32px;">Saved Opportunities</h1>
<div class="job-grid">
${jobs.length > 0 ? jobs.map(j => JobCard(j)).join('') : '<div class="card" style="grid-column: 1/-1; text-align: center; padding: 100px 0;"><p>No items saved yet.</p></div>'}
</div>
</div>
`;
}
else if (route === '#/digest') app.innerHTML = PageDigest();
else if (route === '#/jt/07-test') app.innerHTML = PageTests();
else if (route === '#/proof' || route === '#/jt/08-ship') app.innerHTML = PageProof();
else app.innerHTML = PageHome();
window.scrollTo({ top: 0, behavior: 'instant' });
};
const renderModal = () => {
const job = state.modalJob;
if (!job) return;
const score = getMatchScore(job);
document.getElementById('modal-root').innerHTML = `
<div style="position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 5000; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(8px); animation: fadeIn 0.3s ease-out;">
<div class="card animate-fade-in" style="width: 90%; max-width: 540px; padding: 48px; position: relative; max-height: 90vh; overflow-y: auto;">
<button onclick="closeModal()" style="position: absolute; top: 24px; right: 24px; border: none; background: none; font-size: 24px; cursor: pointer; color: #999;">×</button>
<div style="text-transform: uppercase; font-size: 10px; font-weight: 800; color: var(--accent-color); margin-bottom: 8px;">Job Spec #0${job.id}</div>
<h2 class="serif" style="font-size: 28px; line-height: 1.2; margin-bottom: 4px;">${job.title}</h2>
<div style="font-weight: 700; color: #555; margin-bottom: 24px;">${job.company}</div>
<div style="display: flex; gap: 8px; margin-bottom: 32px;">
<span class="tag tag-green">${score}% Precise Match</span>
<span class="tag tag-blue">${job.mode}</span>
<span class="tag">📍 ${job.location}</span>
</div>
<label>Opportunity Description</label>
<p style="font-size: 14px; color: var(--text-muted); line-height: 1.8; margin-bottom: 32px;">${job.description}</p>
<label>Technical Stack Required</label>
<div style="display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 40px;">
${job.skills.map(s => `<span class="tag">${s}</span>`).join('')}
</div>
<div style="display: flex; gap: 12px;">
<button class="btn btn-primary" style="flex: 1.5; height: 48px;" onclick="window.open('${job.applyUrl}', '_blank')">Apply now on ${job.source}</button>
<button class="btn btn-secondary" style="flex: 1; height: 48px;" onclick="closeModal()">Close Spec</button>
</div>
</div>
</div>
`;
};
// Initialize
render();
console.log("KodNest Premium Build System Ready.");