document.addEventListener('DOMContentLoaded', function() { // Tab switching functionality const tabButtons = document.querySelectorAll('.tab-btn'); const tabContents = document.querySelectorAll('.tab-content'); tabButtons.forEach(button => { button.addEventListener('click', () => { tabButtons.forEach(btn => btn.classList.remove('active')); tabContents.forEach(content => content.classList.remove('active')); button.classList.add('active'); const tabId = button.getAttribute('data-tab'); document.getElementById(tabId).classList.add('active'); }); }); // Mock data - in a real app, this would come from an API const playersData = [ { id: 1, name: "Sipho Mthembu", position: "Flyhalf", years: "2016-2019", varsityShield: true, clubsAfter: ["Border Bulldogs", "EP Elephants"], graduated: true, qualifications: "BSc Computer Science", photo: "http://static.photos/sport/200x200/1" }, { id: 2, name: "Lungelo Ndlovu", position: "Prop", years: "2014-2018", varsityShield: true, clubsAfter: ["Sharks Academy", "Pumas"], graduated: true, qualifications: "BA Education", photo: "http://static.photos/sport/200x200/2" }, { id: 3, name: "Thando Dlamini", position: "Center", years: "2019-Present", varsityShield: true, clubsAfter: [], graduated: false, qualifications: "In Progress: BCom", photo: "http://static.photos/sport/200x200/3" } ]; const coachesData = [ { id: 1, name: "Mike Venter", role: "Head Coach", years: "2016-2020", achievements: "Varsity Shield Qualification 2016", photo: "http://static.photos/people/200x200/1" }, { id: 2, name: "Nomvula Khumalo", role: "Skills Coach", years: "2018-Present", achievements: "Developed backline play system", photo: "http://static.photos/people/200x200/2" } ]; // Render players table function renderPlayersTable(players) { const tableBody = document.getElementById('players-data'); tableBody.innerHTML = ''; players.forEach(player => { const row = document.createElement('tr'); row.innerHTML = `