import { readySkills, skillFocusAreas } from "../data.js"; import { renderSkillDemo, setupDemoTabs } from "../demo-renderer.js"; import { setupDemoToggles } from "../demo-toggles.js"; export function initArtGallery() { // Initial setup if needed } export function renderGallery(skills) { const container = document.querySelector(".skills-gallery"); if (!container) return; // Filter skills (hide impeccable as per original) const filteredSkills = skills.filter((s) => s.id !== "impeccable"); container.innerHTML = ` `; setupInteractions(); setupDemoTabs(); setupDemoToggles(); } function renderFrame(skill, index) { const isReady = readySkills.includes(skill.id); const focusAreas = skillFocusAreas[skill.id] || []; const displayName = formatName(skill.id); return ` `; } function renderComingSoonVisual(id) { return `

Coming Soon

`; } function formatName(id) { return id .split("-") .map((word) => word === "ux" ? "UX" : word.charAt(0).toUpperCase() + word.slice(1), ) .join(" "); } function setupInteractions() { const track = document.querySelector(".gallery-track"); const frames = document.querySelectorAll(".gallery-frame"); const dots = document.querySelectorAll(".gallery-dot"); if (!track) return; // Intersection Observer for Active State const observer = new IntersectionObserver( (entries) => { entries.forEach((entry) => { if (entry.isIntersecting) { const index = entry.target.dataset.index; // Update frames frames.forEach((f) => f.classList.remove("active")); entry.target.classList.add("active"); // Update dots dots.forEach((d) => { d.classList.remove("active"); d.setAttribute("aria-selected", "false"); }); if (dots[index]) { dots[index].classList.add("active"); dots[index].setAttribute("aria-selected", "true"); } } }); }, { root: track, threshold: 0.6, }, ); frames.forEach((frame) => observer.observe(frame)); // Dot navigation dots.forEach((dot, index) => { dot.addEventListener("click", () => { const frame = frames[index]; if (frame) { frame.scrollIntoView({ behavior: "smooth", inline: "center" }); } }); }); }