diff --git a/www/dist/script.js b/www/dist/script.js index 53ea7b2..cb47c58 100644 --- a/www/dist/script.js +++ b/www/dist/script.js @@ -1,4 +1,4 @@ -(()=>{var n=[];function f(c){n=c}document.addEventListener("DOMContentLoaded",async()=>{let c=document.getElementById("app-sections"),b=document.querySelector(".search-input"),g=new Map;async function w(){try{let t=await(await fetch("https://corsproxy.io/?https://pkg.ajam.dev/x86_64/METADATA.AIO.json")).json();f(t.pkg||[]),v(),y(),u()}catch(e){console.error("Error fetching app data:",e),c.innerHTML='
Failed to load applications. Please try again later.
'}}function y(){let e=new URL(window.location),t=e.searchParams.get("search")||"",a=e.searchParams.get("app")||"";u(t),a&&showAppDetails(a,n)}function v(){g.clear(),n.forEach(e=>{e.category&&e.category.split(",").map(a=>a.trim()).forEach(a=>{if(a){let r=g.get(a)||0;g.set(a,r+1)}})})}function h(e){return` +(()=>{var r=[];function f(c){r=c}document.addEventListener("DOMContentLoaded",async()=>{let c=document.getElementById("app-sections"),b=document.querySelector(".search-input"),u=new Map;async function w(){try{let t=await(await fetch("https://raw.githubusercontent.com/xplshn/dbin-metadata/refs/heads/master/misc/cmd/modMetadataAIO/METADATA_AIO_amd64_linux.json")).json();f(t.pkg||[]),v(),y(),g()}catch(e){console.error("Error fetching app data:",e),c.innerHTML='
Failed to load applications. Please try again later.
'}}function y(){let e=new URL(window.location),t=e.searchParams.get("search")||"",a=e.searchParams.get("app")||"";g(t),a&&showAppDetails(a,r)}function v(){u.clear(),r.forEach(e=>{e.category&&e.category.split(",").map(a=>a.trim()).forEach(a=>{if(a){let n=u.get(a)||0;u.set(a,n+1)}})})}function h(e){return`
${e.description||"No description available."}

- `}function u(e=""){let t=n;if(e){let s=e.toLowerCase();t=t.filter(o=>o.name.toLowerCase().includes(s)||o.description&&o.description.toLowerCase().includes(s)||o.category&&o.category.toLowerCase().includes(s))}let a=new Set,r="";g.forEach((s,o)=>{let i=t.filter(l=>l.category?l.category.split(",").map(E=>E.trim()).includes(o)&&!a.has(l.name):!1);if(i.length===0)return;let m=i.slice(0,6);m.forEach(l=>a.add(l.name));let d=m.map(l=>h(l)).join("");r+=` + `}function g(e=""){let t=r;if(e){let s=e.toLowerCase();t=t.filter(o=>o.name.toLowerCase().includes(s)||o.description&&o.description.toLowerCase().includes(s)||o.category&&o.category.toLowerCase().includes(s))}let a=new Set,n="";u.forEach((s,o)=>{let i=t.filter(l=>l.category?l.category.split(",").map(E=>E.trim()).includes(o)&&!a.has(l.name):!1);if(i.length===0)return;let m=i.slice(0,6);m.forEach(l=>a.add(l.name));let d=m.map(l=>h(l)).join("");n+=`

${o}

@@ -22,7 +22,7 @@
${i.length>6?``:""}
- `}),c.innerHTML=r,c.querySelectorAll(".card").forEach(s=>{s.addEventListener("click",o=>{let i=o.currentTarget.dataset.name;showAppDetails(i,n)})}),c.querySelectorAll(".see-more-btn").forEach(s=>{s.addEventListener("click",o=>{let i=o.target.dataset.category;A(i)})});let p=[].slice.call(document.querySelectorAll("img.lazyload"));if("IntersectionObserver"in window){let s=new IntersectionObserver(function(o,i){o.forEach(function(m){if(m.isIntersecting){let d=m.target;d.src=d.dataset.src,d.classList.remove("lazyload"),s.unobserve(d)}})});p.forEach(function(o){s.observe(o)})}else p.forEach(function(s){s.src=s.dataset.src,s.classList.remove("lazyload")})}function A(e){let a=n.filter(r=>r.category?r.category.split(",").map(s=>s.trim()).includes(e):!1).map(r=>h(r)).join("");c.innerHTML=` + `}),c.innerHTML=n,c.querySelectorAll(".card").forEach(s=>{s.addEventListener("click",o=>{let i=o.currentTarget.dataset.name;showAppDetails(i,r)})}),c.querySelectorAll(".see-more-btn").forEach(s=>{s.addEventListener("click",o=>{let i=o.target.dataset.category;A(i)})});let p=[].slice.call(document.querySelectorAll("img.lazyload"));if("IntersectionObserver"in window){let s=new IntersectionObserver(function(o,i){o.forEach(function(m){if(m.isIntersecting){let d=m.target;d.src=d.dataset.src,d.classList.remove("lazyload"),s.unobserve(d)}})});p.forEach(function(o){s.observe(o)})}else p.forEach(function(s){s.src=s.dataset.src,s.classList.remove("lazyload")})}function A(e){let a=r.filter(n=>n.category?n.category.split(",").map(s=>s.trim()).includes(e):!1).map(n=>h(n)).join("");c.innerHTML=`

${e}

@@ -30,5 +30,5 @@
- `,c.querySelectorAll(".card").forEach(r=>{r.addEventListener("click",p=>{let s=p.currentTarget.dataset.name;showAppDetails(s,n)})})}b.addEventListener("input",e=>{let t=e.target.value;u(t);let a=new URL(window.location);a.searchParams.set("search",t),history.pushState({search:t},"",a)}),w(),window.addEventListener("popstate",e=>{let t=new URL(window.location),a=t.searchParams.get("search")||"",r=t.searchParams.get("app")||"";u(a),r?showAppDetails(r,n):L()});function L(){let e=document.querySelector(".app-details");if(e){e.classList.add("hidden");let t=new URL(window.location);t.searchParams.delete("app"),history.pushState({},"",t)}}});})(); + `,c.querySelectorAll(".card").forEach(n=>{n.addEventListener("click",p=>{let s=p.currentTarget.dataset.name;showAppDetails(s,r)})})}b.addEventListener("input",e=>{let t=e.target.value;g(t);let a=new URL(window.location);a.searchParams.set("search",t),history.pushState({search:t},"",a)}),w(),window.addEventListener("popstate",e=>{let t=new URL(window.location),a=t.searchParams.get("search")||"",n=t.searchParams.get("app")||"";g(a),n?showAppDetails(n,r):L()});function L(){let e=document.querySelector(".app-details");if(e){e.classList.add("hidden");let t=new URL(window.location);t.searchParams.delete("app"),history.pushState({},"",t)}}});})(); //# sourceMappingURL=script.js.map diff --git a/www/dist/script.js.map b/www/dist/script.js.map index 77d6e10..a3a12ff 100644 --- a/www/dist/script.js.map +++ b/www/dist/script.js.map @@ -1,7 +1,7 @@ { "version": 3, "sources": ["../shared.js", "../script.js"], - "sourcesContent": ["// shared.js\nexport let apps = [];\n\n// Function to update the apps array\nexport function setApps(newApps) {\n apps = newApps;\n}\n", "// script.js\nimport { setApps, apps } from './shared.js';\n\ndocument.addEventListener('DOMContentLoaded', async () => {\n const appSections = document.getElementById('app-sections');\n const searchInput = document.querySelector('.search-input');\n\n let categories = new Map();\n\n // Fetch app data from the provided URL\n async function fetchAppData() {\n try {\n const response = await fetch('https://corsproxy.io/?https://pkg.ajam.dev/x86_64/METADATA.AIO.json');\n const data = await response.json();\n setApps(data.pkg || []);\n processCategories();\n initializeFromUrl(); // Initialize state from URL after data is fetched.\n displayApps();\n } catch (error) {\n console.error('Error fetching app data:', error);\n appSections.innerHTML = '
Failed to load applications. Please try again later.
';\n }\n }\n\n // Initialize app state from URL parameters\n function initializeFromUrl() {\n const url = new URL(window.location);\n const initialSearch = url.searchParams.get('search') || '';\n const initialApp = url.searchParams.get('app') || '';\n\n displayApps(initialSearch);\n\n if (initialApp) {\n showAppDetails(initialApp, apps);\n }\n }\n\n // Process categories from apps\n function processCategories() {\n categories.clear();\n\n apps.forEach(app => {\n if (app.category) {\n const appCategories = app.category.split(',').map(cat => cat.trim());\n appCategories.forEach(category => {\n if (category) {\n const count = categories.get(category) || 0;\n categories.set(category, count + 1);\n }\n });\n }\n });\n }\n\n // Create app card HTML\n function createAppCard(app) {\n return `\n
\n
\n \"${app.name}\"\n
\n
\n

${app.name}

\n

${app.description || 'No description available.'}

\n
\n
\n `;\n }\n\n // Display the apps in the sections\n function displayApps(searchTerm = '') {\n let filteredApps = apps;\n\n if (searchTerm) {\n const term = searchTerm.toLowerCase();\n filteredApps = filteredApps.filter(app =>\n app.name.toLowerCase().includes(term) ||\n (app.description && app.description.toLowerCase().includes(term)) ||\n (app.category && app.category.toLowerCase().includes(term))\n );\n }\n\n const displayedApps = new Set();\n let appSectionsHTML = '';\n\n categories.forEach((count, category) => {\n // Filter apps for this category\n const categoryApps = filteredApps.filter(app => {\n if (!app.category) return false;\n const appCategories = app.category.split(',').map(cat => cat.trim());\n return appCategories.includes(category) && !displayedApps.has(app.name);\n });\n\n // Skip if there are no apps in this category\n if (categoryApps.length === 0) {\n return;\n }\n\n // Collect the first six apps and mark them as displayed\n const firstSixApps = categoryApps.slice(0, 6);\n firstSixApps.forEach(app => displayedApps.add(app.name));\n\n // Generate HTML for app cards\n const appCards = firstSixApps.map(app => createAppCard(app)).join('');\n\n // Generate the section HTML\n appSectionsHTML += `\n
\n

${category}

\n
\n ${appCards}\n
\n ${categoryApps.length > 6 ? `` : ''}\n
\n `;\n });\n\n // Update the inner HTML of the app sections\n appSections.innerHTML = appSectionsHTML;\n\n // Add event listeners to app cards\n appSections.querySelectorAll('.card').forEach(card => {\n card.addEventListener('click', (e) => {\n const appName = e.currentTarget.dataset.name;\n showAppDetails(appName, apps);\n });\n });\n\n // Add event listeners to \"See more\" buttons\n appSections.querySelectorAll('.see-more-btn').forEach(button => {\n button.addEventListener('click', (e) => {\n const category = e.target.dataset.category;\n showAllAppsInCategory(category);\n });\n });\n\n // Lazy load images\n const lazyImages = [].slice.call(document.querySelectorAll('img.lazyload'));\n if ('IntersectionObserver' in window) {\n let lazyImageObserver = new IntersectionObserver(function(entries, observer) {\n entries.forEach(function(entry) {\n if (entry.isIntersecting) {\n let lazyImage = entry.target;\n lazyImage.src = lazyImage.dataset.src;\n lazyImage.classList.remove('lazyload');\n lazyImageObserver.unobserve(lazyImage);\n }\n });\n });\n\n lazyImages.forEach(function(lazyImage) {\n lazyImageObserver.observe(lazyImage);\n });\n } else {\n // Fallback for older browsers\n lazyImages.forEach(function(lazyImage) {\n lazyImage.src = lazyImage.dataset.src;\n lazyImage.classList.remove('lazyload');\n });\n }\n}\n\n // Show all apps in a specific category\n function showAllAppsInCategory(category) {\n const categoryApps = apps.filter(app => {\n if (!app.category) return false;\n const appCategories = app.category.split(',').map(cat => cat.trim());\n return appCategories.includes(category);\n });\n\n const appCards = categoryApps.map(app => createAppCard(app)).join('');\n\n appSections.innerHTML = `\n
\n

${category}

\n
\n ${appCards}\n
\n \n
\n `;\n\n // Add event listeners to app cards\n appSections.querySelectorAll('.card').forEach(card => {\n card.addEventListener('click', (e) => {\n const appName = e.currentTarget.dataset.name;\n showAppDetails(appName, apps);\n });\n });\n }\n\n // Event Listeners\n searchInput.addEventListener('input', (e) => {\n const searchTerm = e.target.value;\n displayApps(searchTerm);\n\n // Update URL with search term\n const url = new URL(window.location);\n url.searchParams.set('search', searchTerm);\n history.pushState({ search: searchTerm }, '', url);\n });\n\n // Initial load\n fetchAppData();\n\n // Handle popstate event to sync URL with app state\n window.addEventListener('popstate', (e) => {\n const url = new URL(window.location);\n const search = url.searchParams.get('search') || '';\n const app = url.searchParams.get('app') || '';\n\n displayApps(search);\n\n if (app) {\n showAppDetails(app, apps);\n } else {\n closeDetails();\n }\n });\n\n function closeDetails() {\n const appDetails = document.querySelector('.app-details');\n if (appDetails) {\n appDetails.classList.add('hidden');\n\n // Update URL to remove app details\n const url = new URL(window.location);\n url.searchParams.delete('app');\n history.pushState({}, '', url);\n }\n }\n});\n"], - "mappings": "MACO,IAAIA,EAAO,CAAC,EAGZ,SAASC,EAAQC,EAAS,CAC7BF,EAAOE,CACX,CCHA,SAAS,iBAAiB,mBAAoB,SAAY,CACtD,IAAMC,EAAc,SAAS,eAAe,cAAc,EACpDC,EAAc,SAAS,cAAc,eAAe,EAEtDC,EAAa,IAAI,IAGrB,eAAeC,GAAe,CAC1B,GAAI,CAEA,IAAMC,EAAO,MADI,MAAM,MAAM,qEAAqE,GACtE,KAAK,EACjCC,EAAQD,EAAK,KAAO,CAAC,CAAC,EACtBE,EAAkB,EAClBC,EAAkB,EAClBC,EAAY,CAChB,OAASC,EAAO,CACZ,QAAQ,MAAM,2BAA4BA,CAAK,EAC/CT,EAAY,UAAY,+EAC5B,CACJ,CAGA,SAASO,GAAoB,CACzB,IAAMG,EAAM,IAAI,IAAI,OAAO,QAAQ,EAC7BC,EAAgBD,EAAI,aAAa,IAAI,QAAQ,GAAK,GAClDE,EAAaF,EAAI,aAAa,IAAI,KAAK,GAAK,GAElDF,EAAYG,CAAa,EAErBC,GACA,eAAeA,EAAYC,CAAI,CAEvC,CAGA,SAASP,GAAoB,CACzBJ,EAAW,MAAM,EAEjBW,EAAK,QAAQC,GAAO,CACZA,EAAI,UACkBA,EAAI,SAAS,MAAM,GAAG,EAAE,IAAIC,G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newApps;\n}\n", "// script.js\nimport { setApps, apps } from './shared.js';\n\ndocument.addEventListener('DOMContentLoaded', async () => {\n const appSections = document.getElementById('app-sections');\n const searchInput = document.querySelector('.search-input');\n\n let categories = new Map();\n\n // Fetch app data from the provided URL\n async function fetchAppData() {\n try {\n const response = await fetch('https://raw.githubusercontent.com/xplshn/dbin-metadata/refs/heads/master/misc/cmd/modMetadataAIO/METADATA_AIO_amd64_linux.json');\n const data = await response.json();\n setApps(data.pkg || []);\n processCategories();\n initializeFromUrl(); // Initialize state from URL after data is fetched.\n displayApps();\n } catch (error) {\n console.error('Error fetching app data:', error);\n appSections.innerHTML = '
Failed to load applications. Please try again later.
';\n }\n }\n\n // Initialize app state from URL parameters\n function initializeFromUrl() {\n const url = new URL(window.location);\n const initialSearch = url.searchParams.get('search') || '';\n const initialApp = url.searchParams.get('app') || '';\n\n displayApps(initialSearch);\n\n if (initialApp) {\n showAppDetails(initialApp, apps);\n }\n }\n\n // Process categories from apps\n function processCategories() {\n categories.clear();\n\n apps.forEach(app => {\n if (app.category) {\n const appCategories = app.category.split(',').map(cat => cat.trim());\n appCategories.forEach(category => {\n if (category) {\n const count = categories.get(category) || 0;\n categories.set(category, count + 1);\n }\n });\n }\n });\n }\n\n // Create app card HTML\n function createAppCard(app) {\n return `\n
\n
\n \"${app.name}\"\n
\n
\n

${app.name}

\n

${app.description || 'No description available.'}

\n
\n
\n `;\n }\n\n // Display the apps in the sections\n function displayApps(searchTerm = '') {\n let filteredApps = apps;\n\n if (searchTerm) {\n const term = searchTerm.toLowerCase();\n filteredApps = filteredApps.filter(app =>\n app.name.toLowerCase().includes(term) ||\n (app.description && app.description.toLowerCase().includes(term)) ||\n (app.category && app.category.toLowerCase().includes(term))\n );\n }\n\n const displayedApps = new Set();\n let appSectionsHTML = '';\n\n categories.forEach((count, category) => {\n // Filter apps for this category\n const categoryApps = filteredApps.filter(app => {\n if (!app.category) return false;\n const appCategories = app.category.split(',').map(cat => cat.trim());\n return appCategories.includes(category) && !displayedApps.has(app.name);\n });\n\n // Skip if there are no apps in this category\n if (categoryApps.length === 0) {\n return;\n }\n\n // Collect the first six apps and mark them as displayed\n const firstSixApps = categoryApps.slice(0, 6);\n firstSixApps.forEach(app => displayedApps.add(app.name));\n\n // Generate HTML for app cards\n const appCards = firstSixApps.map(app => createAppCard(app)).join('');\n\n // Generate the section HTML\n appSectionsHTML += `\n
\n

${category}

\n
\n ${appCards}\n
\n ${categoryApps.length > 6 ? `` : ''}\n
\n `;\n });\n\n // Update the inner HTML of the app sections\n appSections.innerHTML = appSectionsHTML;\n\n // Add event listeners to app cards\n appSections.querySelectorAll('.card').forEach(card => {\n card.addEventListener('click', (e) => {\n const appName = e.currentTarget.dataset.name;\n showAppDetails(appName, apps);\n });\n });\n\n // Add event listeners to \"See more\" buttons\n appSections.querySelectorAll('.see-more-btn').forEach(button => {\n button.addEventListener('click', (e) => {\n const category = e.target.dataset.category;\n showAllAppsInCategory(category);\n });\n });\n\n // Lazy load images\n const lazyImages = [].slice.call(document.querySelectorAll('img.lazyload'));\n if ('IntersectionObserver' in window) {\n let lazyImageObserver = new IntersectionObserver(function(entries, observer) {\n entries.forEach(function(entry) {\n if (entry.isIntersecting) {\n let lazyImage = entry.target;\n lazyImage.src = lazyImage.dataset.src;\n lazyImage.classList.remove('lazyload');\n lazyImageObserver.unobserve(lazyImage);\n }\n });\n });\n\n lazyImages.forEach(function(lazyImage) {\n lazyImageObserver.observe(lazyImage);\n });\n } else {\n // Fallback for older browsers\n lazyImages.forEach(function(lazyImage) {\n lazyImage.src = lazyImage.dataset.src;\n lazyImage.classList.remove('lazyload');\n });\n }\n}\n\n // Show all apps in a specific category\n function showAllAppsInCategory(category) {\n const categoryApps = apps.filter(app => {\n if (!app.category) return false;\n const appCategories = app.category.split(',').map(cat => cat.trim());\n return appCategories.includes(category);\n });\n\n const appCards = categoryApps.map(app => createAppCard(app)).join('');\n\n appSections.innerHTML = `\n
\n

${category}

\n
\n ${appCards}\n
\n \n
\n `;\n\n // Add event listeners to app cards\n appSections.querySelectorAll('.card').forEach(card => {\n card.addEventListener('click', (e) => {\n const appName = e.currentTarget.dataset.name;\n showAppDetails(appName, apps);\n });\n });\n }\n\n // Event Listeners\n searchInput.addEventListener('input', (e) => {\n const searchTerm = e.target.value;\n displayApps(searchTerm);\n\n // Update URL with search term\n const url = new URL(window.location);\n url.searchParams.set('search', searchTerm);\n history.pushState({ search: searchTerm }, '', url);\n });\n\n // Initial load\n fetchAppData();\n\n // Handle popstate event to sync URL with app state\n window.addEventListener('popstate', (e) => {\n const url = new URL(window.location);\n const search = url.searchParams.get('search') || '';\n const app = url.searchParams.get('app') || '';\n\n displayApps(search);\n\n if (app) {\n showAppDetails(app, apps);\n } else {\n closeDetails();\n }\n });\n\n function closeDetails() {\n const appDetails = document.querySelector('.app-details');\n if (appDetails) {\n appDetails.classList.add('hidden');\n\n // Update URL to remove app details\n const url = new URL(window.location);\n url.searchParams.delete('app');\n history.pushState({}, '', url);\n }\n }\n});\n"], + "mappings": "MACO,IAAIA,EAAO,CAAC,EAGZ,SAASC,EAAQC,EAAS,CAC7BF,EAAOE,CACX,CCHA,SAAS,iBAAiB,mBAAoB,SAAY,CACtD,IAAMC,EAAc,SAAS,eAAe,cAAc,EACpDC,EAAc,SAAS,cAAc,eAAe,EAEtDC,EAAa,IAAI,IAGrB,eAAeC,GAAe,CAC1B,GAAI,CAEA,IAAMC,EAAO,MADI,MAAM,MAAM,gIAAgI,GACjI,KAAK,EACjCC,EAAQD,EAAK,KAAO,CAAC,CAAC,EACtBE,EAAkB,EAClBC,EAAkB,EAClBC,EAAY,CAChB,OAASC,EAAO,CACZ,QAAQ,MAAM,2BAA4BA,CAAK,EAC/CT,EAAY,UAAY,+EAC5B,CACJ,CAGA,SAASO,GAAoB,CACzB,IAAMG,EAAM,IAAI,IAAI,OAAO,QAAQ,EAC7BC,EAAgBD,EAAI,aAAa,IAAI,QAAQ,GAAK,GAClDE,EAAaF,EAAI,aAAa,IAAI,KAAK,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,IAAI,OAAO,QAAQ,EACnCA,EAAI,aAAa,OAAO,KAAK,EAC7B,QAAQ,UAAU,CAAC,EAAG,GAAIA,CAAG,CACjC,CACJ,CACJ,CAAC", "names": ["apps", "setApps", "newApps", "appSections", "searchInput", "categories", "fetchAppData", "data", "setApps", "processCategories", "initializeFromUrl", "displayApps", "error", "url", "initialSearch", "initialApp", "apps", "app", "cat", "category", "count", "createAppCard", "searchTerm", "filteredApps", "term", "displayedApps", "appSectionsHTML", "categoryApps", "firstSixApps", "appCards", "card", "e", "appName", "button", "showAllAppsInCategory", "lazyImages", "lazyImageObserver", "entries", "observer", "entry", "lazyImage", "search", "closeDetails", "appDetails"] } diff --git a/www/script.js b/www/script.js index c45b7a5..e44126f 100644 --- a/www/script.js +++ b/www/script.js @@ -10,7 +10,7 @@ document.addEventListener('DOMContentLoaded', async () => { // Fetch app data from the provided URL async function fetchAppData() { try { - const response = await fetch('https://corsproxy.io/?https://pkg.ajam.dev/x86_64/METADATA.AIO.json'); + const response = await fetch('https://raw.githubusercontent.com/xplshn/dbin-metadata/refs/heads/master/misc/cmd/modMetadataAIO/METADATA_AIO_amd64_linux.json'); const data = await response.json(); setApps(data.pkg || []); processCategories();