Gr33nLab

Tools, utilities & other side projects.

See More

Data could not be loaded.`; } } function renderTools(toolsToRender) { if (toolsToRender.length === 0) { container.innerHTML = `

No tools found.`; return; } container.innerHTML = toolsToRender.map(tool => { if (tool.id === "gr33nlab-hub") return ''; const hasBadges = tool.archived || tool.hosted; const tagsHtml = (tool.tags || []).map(tag => `${tag}`).join(''); return `

${hasBadges ? `
${tool.archived ? 'Archived' : ''} ${tool.hosted ? 'Self-Hosted' : ''} ` : ''}

${tool.title}

${tool.desc}

${tagsHtml} `; }).join(''); } function openModal(toolId) { const tool = tools.find(t => t.id === toolId); if (!tool) return; modalTitle.textContent = `Licenses: ${tool.title}`; if (!tool.dependencies || tool.dependencies.length === 0) { modalBody.innerHTML = `

This tool has no external third-party dependencies.`; } else { modalBody.innerHTML = `

${tool.dependencies.map(dep => `
LibraryLicenseCopyright Notice
${dep.name} ${dep.repoUrl ? `Repository` : ''} ${dep.licenseUrl ? `${dep.license}` : `${dep.license}`} ${dep.copyright || 'No copyright notice provided'} `).join('')} `; } modal.showModal(); } function closeModal() { history.pushState('', document.title, window.location.pathname + window.location.search); modal.close(); } function handleHashChange() { if (window.location.hash.startsWith('#license-')) openModal(window.location.hash.replace('#license-', '')); else if (modal.open) closeModal(); } window.addEventListener('hashchange', handleHashChange); document.getElementById('modal-close').addEventListener('click', closeModal); modal.addEventListener('click', (e) => { if (e.target === modal) closeModal(); }); searchInput.addEventListener('input', (e) => { const term = e.target.value.toLowerCase().trim(); renderTools(tools.filter(t => t.title.toLowerCase().includes(term) || t.desc.toLowerCase().includes(term) || (t.tags||[]).some(tag => tag.toLowerCase().includes(term)))); }); loadData();