const snippetDatabase = [ { id: "brat-modules", title: "Brat Modules", category: "Feature", path: "../dokumentasi/feature/brat-modules.js", filename: "brat-modules.js", updatedAt: "2026-04-05" }, { id: "github-dl", title: "GitHub Downloader", category: "Feature", path: "../dokumentasi/feature/githubDl.js", filename: "githubDl.js", updatedAt: "2026-04-06" }, { id: "jadwal-sholat", title: "Jadwal Sholat", category: "Feature", path: "../dokumentasi/feature/jadwalSholat.js", filename: "jadwalSholat.js", updatedAt: "2026-04-06" }, { id: "tourl", title: "To URL (Upload Image)", category: "Feature", path: "../dokumentasi/feature/tourl.js", filename: "tourl.js", updatedAt: "2026-04-07" }, { id: "twitter-dl", title: "Twitter Downloader", category: "Feature", path: "../dokumentasi/feature/twitterDl.js", filename: "twitterDl.js", updatedAt: "2026-04-06" }, { id: "youtube-play", title: "YouTube Play", category: "Feature", path: "../dokumentasi/feature/youtubePlay.js", filename: "youtubePlay.js", updatedAt: "2026-04-07" }, { id: "youtube-search", title: "YouTube Search", category: "Feature", path: "../dokumentasi/feature/youtubeSearch.js", filename: "youtubeSearch.js", updatedAt: "2026-04-07" }, { id: "athars-uploader", title: "Athars Uploader", category: "Scraper", path: "../dokumentasi/scraper/athars-uploader.js", filename: "athars-uploader.js", updatedAt: "2026-04-05" }, { id: "flixpatrol", title: "FlixPatrol Data", category: "Scraper", path: "../dokumentasi/scraper/flixpatrol.js", filename: "flixpatrol.js", updatedAt: "2026-04-05" }, { id: "search-movies", title: "Search Movies", category: "Scraper", path: "../dokumentasi/scraper/searchMovies.js", filename: "searchMovies.js", updatedAt: "2026-04-07", password: "M0v1e$" }, { id: "soundcloud-dl", title: "SoundCloud Downloader", category: "Scraper", path: "../dokumentasi/scraper/souncloud-dl.js", filename: "souncloud-dl.js", updatedAt: "2026-04-06", password: "S0oundcloud*" }, { id: "ssweb", title: "SS Web", category: "Scraper", path: "../dokumentasi/scraper/ssweb.js", filename: "ssweb.js", updatedAt: "2026-04-06" }, { id: "steam", title: "Steam Search/Data", category: "Scraper", path: "../dokumentasi/scraper/steam.js", filename: "steam.js", updatedAt: "2026-04-06", password: "$Team%" }, { id: "tiktok-dl", title: "Tiktok Downloader (No Watermark)", category: "Scraper", path: "../dokumentasi/scraper/tiktokdl.js", filename: "tiktokdl.js", updatedAt: "2026-04-05", password: "tiktokdl-tikwm" } ]; let currentCategory = "Semua"; let searchQuery = ""; document.addEventListener("DOMContentLoaded", () => { snippetDatabase.sort((a, b) => a.title.localeCompare(b.title)); if (document.getElementById('snippets-container')) { initDocs(); } }); function initDocs() { renderSidebar(); renderSnippets(); document.addEventListener("click", handleCopyClick); const searchDesktop = document.getElementById('search-input'); const searchMobile = document.getElementById('search-input-mobile'); if (searchDesktop) { searchDesktop.addEventListener('input', (e) => { searchQuery = e.target.value.toLowerCase(); if (searchMobile) searchMobile.value = e.target.value; renderSnippets(); }); } if (searchMobile) { searchMobile.addEventListener('input', (e) => { searchQuery = e.target.value.toLowerCase(); if (searchDesktop) searchDesktop.value = e.target.value; renderSnippets(); }); } } function setCategory(cat) { currentCategory = cat; renderSidebar(); renderSnippets(); } function renderSidebar() { const uniqueCategories = [...new Set(snippetDatabase.map(item => item.category))]; const categoryList = document.getElementById('category-list'); categoryList.innerHTML = ''; const totalFiles = snippetDatabase.length; categoryList.appendChild(createSidebarItem("Semua", totalFiles)); uniqueCategories.forEach(cat => { const count = snippetDatabase.filter(item => item.category === cat).length; categoryList.appendChild(createSidebarItem(cat, count)); }); } function createSidebarItem(catName, count) { const li = document.createElement('li'); li.className = "flex-shrink-0 md:w-full"; const isActive = currentCategory === catName; li.innerHTML = ` `; return li; } async function renderSnippets() { const titleEl = document.getElementById('current-category-title'); const infoEl = document.getElementById('current-category-info'); titleEl.textContent = currentCategory === "Semua" ? "Lihat Semua Snippet" : `Kategori: ${currentCategory}`; infoEl.textContent = searchQuery ? `Menampilkan pencarian untuk "${searchQuery}"` : `Koleksi kode untuk ${currentCategory}.`; const container = document.getElementById('snippets-container'); container.innerHTML = `
Snippet tidak ditemukan.
Masukkan akses password untuk membuka kode dan fitur unduh.