-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.js
More file actions
45 lines (37 loc) · 2.1 KB
/
Copy pathprofile.js
File metadata and controls
45 lines (37 loc) · 2.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
// profile.js – SkillSwap Profile Page
(function () {
injectShell('nav-profile');
// ── Profile tab switching ─────────────────────────────────
const profileTabs = document.getElementById('profileTabs');
const tabPanelIds = ['overview', 'commendations', 'achievements', 'mentors'];
profileTabs.querySelectorAll('.tab-btn').forEach(btn => {
btn.addEventListener('click', function () {
profileTabs.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
this.classList.add('active');
const active = this.dataset.tab;
tabPanelIds.forEach(id => {
const panel = document.getElementById('tab-' + id);
if (panel) panel.style.display = (id === active) ? '' : 'none';
});
});
});
// ── Edit profile button ───────────────────────────────────
document.getElementById('editProfileBtn').addEventListener('click', function () {
alert('Edit Profile – coming soon!\n\nYou can update your bio, expertise, and more.');
});
// ── Edit section icons (Experience / Education) ───────────
document.querySelectorAll('.edit-icon').forEach(btn => {
btn.addEventListener('click', function () {
const section = this.closest('.profile-section').querySelector('h3').textContent;
alert('Edit "' + section + '" – coming soon!');
});
});
// ── Avatar edit ───────────────────────────────────────────
document.querySelector('.avatar-edit').addEventListener('click', function () {
alert('Photo upload – coming soon!');
});
// ── Profile strength card ─────────────────────────────────
document.querySelector('.profile-strength-card-alt').addEventListener('click', function () {
alert('Complete your profile to level up!\n\n• Add experience\n• Add education\n• Book a session');
});
})();