chahuadev commited on
Commit
6e41605
·
verified ·
1 Parent(s): 033292d

finalize support page integration and link security

Browse files
README.md CHANGED
@@ -175,3 +175,22 @@ Chahuadev Hub is an Electron desktop app that brings everything from the Chahuad
175
 
176
  - [npm](https://www.npmjs.com/package/@chahuadev/chahuadev-hub-app)
177
  - [Hugging Face](https://huggingface.co/chahuadev)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
 
176
  - [npm](https://www.npmjs.com/package/@chahuadev/chahuadev-hub-app)
177
  - [Hugging Face](https://huggingface.co/chahuadev)
178
+
179
+ ---
180
+
181
+ ## Workspace layout
182
+
183
+ This repository contains the app source and the package workspace used for distribution.
184
+
185
+ - `main.js`, `preload.js`, `web/`: desktop app runtime and UI layers
186
+ - `assets/`, `icons/`: static assets used by the app shell
187
+ - `packages/`: package artifacts and package-level metadata
188
+
189
+ For package-specific instructions, see:
190
+
191
+ - [`packages/README.md`](packages/README.md)
192
+ - [`packages/@chahuadev/chahuadev-hub-app/README.md`](packages/@chahuadev/chahuadev-hub-app/README.md)
193
+ ## 💖 Support the Project
194
+ Chahuadev tools are 100% free and open-source. If this project helped you save time, please consider buying me a coffee to help keep the servers running!
195
+
196
+ <a href="https://www.buymeacoffee.com/chahuadevm" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
index.html CHANGED
The diff for this file is too large to render. See raw diff
 
main.js CHANGED
@@ -13,6 +13,7 @@
13
  'use strict';
14
 
15
  const { app, BrowserWindow, ipcMain, shell, session, Menu } = require('electron');
 
16
  const path = require('path');
17
  const fs = require('fs');
18
  const os = require('os');
@@ -32,13 +33,18 @@ const HF_AUTHOR = 'chahuadev';
32
  const HF_REPO = 'chahuadev/chahuadev-framework-binaries';
33
  const HF_API_URL = `https://huggingface.co/api/datasets/${HF_REPO}/tree/main`;
34
  const HF_COMMITS_URL = `https://huggingface.co/api/datasets/${HF_REPO}/commits/main`;
35
- const R2_CDN_BASE = 'https://pub-419d22521da042dfb27d1f404b3eb8a6.r2.dev';
36
- const R2_CATALOG_URL = 'https://pub-419d22521da042dfb27d1f404b3eb8a6.r2.dev/catalog.json';
 
37
  const GITHUB_CATALOG_URL = 'https://raw.githubusercontent.com/toyspata00/chahuadev-hub/main/catalog.json';
38
  const HF_DATASETS_API = `https://huggingface.co/api/datasets?author=${HF_AUTHOR}&full=true`;
39
  const HF_MODELS_API = `https://huggingface.co/api/models?author=${HF_AUTHOR}&full=true`;
40
  const HF_SPACES_API = `https://huggingface.co/api/spaces?author=${HF_AUTHOR}&full=true`;
41
  const DOWNLOAD_DIR = path.join(os.homedir(), 'Downloads', 'ChahuadevHub');
 
 
 
 
42
 
43
  // ── npm Registry Constants ────────────────────────────────────────────────────
44
  const NPM_ORG = 'chahuadev';
@@ -50,6 +56,8 @@ const NPM_DL_BASE = 'https://api.npmjs.org/downloads/point/last-month';
50
  let cachedChangelog = null;
51
  let lastChangelogFetch = 0;
52
  const CACHE_COOLDOWN = 5 * 60 * 1000; // 5 นาที
 
 
53
 
54
  // npm cache
55
  let cachedNpmPackages = null;
@@ -58,6 +66,9 @@ let lastNpmFetch = 0;
58
  // Hugging Face API cache (keyed by endpoint) with in-flight de-duplication
59
  const hfApiCache = new Map();
60
  const hfPendingRequests = new Map();
 
 
 
61
 
62
  const SKIP_FILES = new Set([
63
  '.gitattributes', 'README.md',
@@ -67,14 +78,95 @@ const SKIP_FILES = new Set([
67
  // Allowed npm packages for self-update / install (whitelist — renderer cannot override)
68
  const NPM_PKG_WHITELIST = new Set([
69
  '@chahuadev/chahuadev-hub-app',
 
70
  '@chahuadev/junk-sweeper-app',
71
  '@chahuadev/emoji-cleaner-app',
72
  '@chahuadev/framework'
73
  ]);
74
 
75
  const isDev = !app.isPackaged && process.argv.includes('--dev');
 
 
 
 
 
 
 
 
76
  const security = new SecurityCore();
77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  function createDevMenuTemplate() {
79
  return [
80
  {
@@ -187,7 +279,8 @@ function fetchJSON(urlStr, redirectCount = 0) {
187
  }, (res) => {
188
  if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
189
  res.resume();
190
- fetchJSON(res.headers.location, redirectCount + 1).then(resolve).catch(reject);
 
191
  return;
192
  }
193
  if (res.statusCode !== 200) {
@@ -231,6 +324,204 @@ async function fetchWithCooldownCache(cacheKey, fetcher) {
231
  }
232
  }
233
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
234
  // ── Semver comparison helper ──────────────────────────────────────────────────
235
  function semverGt(a, b) {
236
  const pa = String(a || '0').split('.').map(Number);
@@ -243,6 +534,21 @@ function semverGt(a, b) {
243
  return false;
244
  }
245
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  // ── Raw file downloader used by hot-patch ─────────────────────────────────────
247
  function downloadRaw(urlStr, destPath, redirectCount = 0) {
248
  return new Promise((resolve, reject) => {
@@ -255,7 +561,8 @@ function downloadRaw(urlStr, destPath, redirectCount = 0) {
255
  }, (res) => {
256
  if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
257
  res.resume();
258
- downloadRaw(res.headers.location, destPath, redirectCount + 1).then(resolve).catch(reject);
 
259
  return;
260
  }
261
  if (res.statusCode !== 200) { res.resume(); return reject(new Error(`HTTP ${res.statusCode}`)); }
@@ -301,6 +608,7 @@ function createMainWindow() {
301
  minHeight: 580,
302
  show: false,
303
  backgroundColor: '#09090f',
 
304
  autoHideMenuBar: !isDev,
305
  webPreferences: {
306
  preload: path.join(__dirname, 'preload.js'),
@@ -322,7 +630,7 @@ function createMainWindow() {
322
  applyProductionWindowHardening(mainWindow);
323
 
324
  mainWindow.once('ready-to-show', () => {
325
- const delay = isDev ? 400 : 1800;
326
  setTimeout(() => {
327
  if (splashWindow && !splashWindow.isDestroyed()) {
328
  splashWindow.close();
@@ -341,14 +649,15 @@ function createMainWindow() {
341
 
342
  // ── App lifecycle ─────────────────────────────────────────────────────────────
343
  app.whenReady().then(() => {
 
344
  initSecurity();
 
345
  if (isDev) {
346
  Menu.setApplicationMenu(Menu.buildFromTemplate(createDevMenuTemplate()));
347
  } else {
348
  Menu.setApplicationMenu(null);
349
  }
350
  fs.mkdirSync(DOWNLOAD_DIR, { recursive: true });
351
- createSplashWindow();
352
  createMainWindow();
353
 
354
  app.on('activate', () => {
@@ -487,10 +796,59 @@ ipcMain.handle('fetch-repo-commits', async (_, repoId, repoType) => {
487
 
488
  // Fetch file tree for a specific repo
489
  ipcMain.handle('fetch-repo-tree', async (_, repoId, repoType, options = {}) => {
490
- const expand = !!options?.expand;
491
- const suffix = expand ? '?expand=true' : '';
492
- const url = `https://huggingface.co/api/${repoType}s/${repoId}/tree/main${suffix}`;
493
- return await fetchWithCooldownCache(url, () => fetchJSON(url));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
494
  });
495
 
496
  // Fetch dashboard stats: datasets + models + spaces counts, total downloads, recent activity
@@ -547,6 +905,15 @@ ipcMain.handle('fetch-npm-packages', async () => {
547
 
548
  const latest = meta?.['dist-tags']?.latest || '';
549
  const verData = meta?.versions?.[latest] || {};
 
 
 
 
 
 
 
 
 
550
  return {
551
  name,
552
  version: latest,
@@ -556,6 +923,11 @@ ipcMain.handle('fetch-npm-packages', async () => {
556
  license: verData.license || '',
557
  updatedAt: meta?.time?.[latest] || '',
558
  downloads: dlData?.downloads || 0,
 
 
 
 
 
559
  };
560
  })
561
  );
@@ -636,19 +1008,29 @@ ipcMain.handle('open-downloads', async () => {
636
  return shell.openPath(DOWNLOAD_DIR);
637
  });
638
 
639
- // Open external URL — allow whitelisted domains only
640
- const ALLOWED_EXTERNAL = [
641
- 'https://huggingface.co/',
642
- 'https://www.tiktok.com/@chahuadev',
643
- 'https://chahuadev.com/',
644
- 'https://www.npmjs.com/org/chahuadev',
645
- 'https://www.npmjs.com/package/',
646
- 'https://pub-419d22521da042dfb27d1f404b3eb8a6.r2.dev/',
647
- ];
 
 
 
 
648
  ipcMain.handle('open-external-url', (_, url) => {
649
  if (typeof url !== 'string') return;
650
- const allowed = ALLOWED_EXTERNAL.some(prefix => url.startsWith(prefix));
651
- if (allowed) shell.openExternal(url);
 
 
 
 
 
 
652
  });
653
 
654
  // Download a file with streaming progress events
@@ -674,7 +1056,8 @@ ipcMain.handle('download-file', (event, filePath, fileSize) => {
674
  // Follow redirect
675
  if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
676
  res.resume();
677
- download(res.headers.location, redirectCount + 1);
 
678
  return;
679
  }
680
  if (res.statusCode !== 200) {
@@ -728,19 +1111,43 @@ ipcMain.handle('download-file', (event, filePath, fileSize) => {
728
  // Return current app version
729
  ipcMain.handle('get-app-version', () => app.getVersion());
730
 
731
- // Fetch version.json from R2, compare with running version
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
732
  ipcMain.handle('check-app-update', async () => {
733
  try {
734
- const latest = await fetchJSON(`${R2_CDN_BASE}/version.json`);
 
 
 
 
735
  const current = app.getVersion();
736
- const hasUpdate = semverGt(String(latest.version || ''), current);
 
737
  return {
738
  hasUpdate,
739
  current,
740
- latest: String(latest.version || ''),
741
- releaseDate: String(latest.releaseDate || ''),
742
- notes: String(latest.notes || ''),
743
- patchFiles: Array.isArray(latest.patchFiles) ? latest.patchFiles : []
 
744
  };
745
  } catch (e) {
746
  return { hasUpdate: false, error: e.message };
 
13
  'use strict';
14
 
15
  const { app, BrowserWindow, ipcMain, shell, session, Menu } = require('electron');
16
+ const { autoUpdater } = require('electron-updater');
17
  const path = require('path');
18
  const fs = require('fs');
19
  const os = require('os');
 
33
  const HF_REPO = 'chahuadev/chahuadev-framework-binaries';
34
  const HF_API_URL = `https://huggingface.co/api/datasets/${HF_REPO}/tree/main`;
35
  const HF_COMMITS_URL = `https://huggingface.co/api/datasets/${HF_REPO}/commits/main`;
36
+ const R2_CDN_BASE = 'https://r2.chahuadev.com';
37
+ const R2_CATALOG_URL = 'https://r2.chahuadev.com/catalog.json';
38
+ const APP_CATALOG_ID = 'chahuadev-hub';
39
  const GITHUB_CATALOG_URL = 'https://raw.githubusercontent.com/toyspata00/chahuadev-hub/main/catalog.json';
40
  const HF_DATASETS_API = `https://huggingface.co/api/datasets?author=${HF_AUTHOR}&full=true`;
41
  const HF_MODELS_API = `https://huggingface.co/api/models?author=${HF_AUTHOR}&full=true`;
42
  const HF_SPACES_API = `https://huggingface.co/api/spaces?author=${HF_AUTHOR}&full=true`;
43
  const DOWNLOAD_DIR = path.join(os.homedir(), 'Downloads', 'ChahuadevHub');
44
+ const APP_BASE_DIR = app.isPackaged
45
+ ? (process.env.PORTABLE_EXECUTABLE_DIR || path.dirname(process.execPath))
46
+ : __dirname;
47
+ const HF_SANDBOX_DIR = path.join(APP_BASE_DIR, '.hf-sandbox-cache');
48
 
49
  // ── npm Registry Constants ────────────────────────────────────────────────────
50
  const NPM_ORG = 'chahuadev';
 
56
  let cachedChangelog = null;
57
  let lastChangelogFetch = 0;
58
  const CACHE_COOLDOWN = 5 * 60 * 1000; // 5 นาที
59
+ const HF_TREE_STALE_MS = 5 * 60 * 1000;
60
+ const HF_PREVIEW_MAX_BYTES = 256 * 1024;
61
 
62
  // npm cache
63
  let cachedNpmPackages = null;
 
66
  // Hugging Face API cache (keyed by endpoint) with in-flight de-duplication
67
  const hfApiCache = new Map();
68
  const hfPendingRequests = new Map();
69
+ const hfRepoTreeCache = new Map();
70
+ const hfRepoCommitHeadCache = new Map();
71
+ const hfRepoFileCacheMeta = new Map();
72
 
73
  const SKIP_FILES = new Set([
74
  '.gitattributes', 'README.md',
 
78
  // Allowed npm packages for self-update / install (whitelist — renderer cannot override)
79
  const NPM_PKG_WHITELIST = new Set([
80
  '@chahuadev/chahuadev-hub-app',
81
+ '@chahuadev/dev-launcher',
82
  '@chahuadev/junk-sweeper-app',
83
  '@chahuadev/emoji-cleaner-app',
84
  '@chahuadev/framework'
85
  ]);
86
 
87
  const isDev = !app.isPackaged && process.argv.includes('--dev');
88
+ const UPDATE_CHANNEL = ((process.env.APP_UPDATE_CHANNEL || process.env.UPDATE_CHANNEL || 'stable').toLowerCase() === 'beta') ? 'beta' : 'stable';
89
+ const UPDATE_BASE_URL = 'https://r2.chahuadev.com';
90
+ let updaterInitialized = false;
91
+ let updaterState = {
92
+ lastCheckedAt: null,
93
+ lastResult: 'idle',
94
+ lastError: null
95
+ };
96
  const security = new SecurityCore();
97
 
98
+ function configureUpdaterFeed() {
99
+ const feedUrl = `${UPDATE_BASE_URL}/`;
100
+ autoUpdater.setFeedURL({
101
+ provider: 'generic',
102
+ url: feedUrl
103
+ });
104
+ autoUpdater.allowPrerelease = UPDATE_CHANNEL === 'beta';
105
+ autoUpdater.allowDowngrade = true;
106
+ autoUpdater.channel = UPDATE_CHANNEL;
107
+ console.log(`[Updater] Channel: ${UPDATE_CHANNEL} | Feed: ${feedUrl}`);
108
+ }
109
+
110
+ async function checkForUpdatesNow() {
111
+ updaterState.lastCheckedAt = new Date().toISOString();
112
+ try {
113
+ const result = await autoUpdater.checkForUpdates();
114
+ const version = result && result.updateInfo && result.updateInfo.version ? result.updateInfo.version : null;
115
+ updaterState.lastResult = version ? 'update-available' : 'no-update';
116
+ updaterState.lastError = null;
117
+ return {
118
+ ok: true,
119
+ channel: UPDATE_CHANNEL,
120
+ updateAvailable: Boolean(version),
121
+ version
122
+ };
123
+ } catch (error) {
124
+ updaterState.lastResult = 'error';
125
+ updaterState.lastError = error && error.message ? error.message : String(error);
126
+ return {
127
+ ok: false,
128
+ channel: UPDATE_CHANNEL,
129
+ error: updaterState.lastError
130
+ };
131
+ }
132
+ }
133
+
134
+ function initAutoUpdater() {
135
+ if (!app.isPackaged || isDev) return;
136
+ configureUpdaterFeed();
137
+ autoUpdater.autoDownload = true;
138
+ autoUpdater.autoInstallOnAppQuit = true;
139
+ autoUpdater.logger = console;
140
+ autoUpdater.on('error', (e) => {
141
+ updaterState.lastResult = 'error';
142
+ updaterState.lastError = e && e.message ? e.message : String(e);
143
+ console.warn('[Updater] Error:', updaterState.lastError);
144
+ });
145
+ autoUpdater.on('update-available', () => {
146
+ updaterState.lastResult = 'update-available';
147
+ updaterState.lastError = null;
148
+ });
149
+ autoUpdater.on('update-not-available', () => {
150
+ updaterState.lastResult = 'no-update';
151
+ updaterState.lastError = null;
152
+ });
153
+ autoUpdater.on('update-downloaded', (info) => {
154
+ updaterState.lastResult = 'downloaded';
155
+ const r = require('electron').dialog.showMessageBoxSync({
156
+ type: 'info',
157
+ buttons: ['Restart now', 'Later'],
158
+ defaultId: 0,
159
+ cancelId: 1,
160
+ title: 'Update ready',
161
+ message: `Version ${info && info.version ? info.version : 'new'} is ready to install.`
162
+ });
163
+ if (r === 0) autoUpdater.quitAndInstall();
164
+ });
165
+ setTimeout(() => autoUpdater.checkForUpdates().catch(() => {}), 12000);
166
+ setInterval(() => autoUpdater.checkForUpdates().catch(() => {}), 6 * 60 * 60 * 1000);
167
+ updaterInitialized = true;
168
+ }
169
+
170
  function createDevMenuTemplate() {
171
  return [
172
  {
 
279
  }, (res) => {
280
  if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
281
  res.resume();
282
+ const nextUrl = new URL(res.headers.location, urlStr).toString();
283
+ fetchJSON(nextUrl, redirectCount + 1).then(resolve).catch(reject);
284
  return;
285
  }
286
  if (res.statusCode !== 200) {
 
324
  }
325
  }
326
 
327
+ function normalizeRepoPath(input) {
328
+ const raw = String(input || '').replace(/\\/g, '/').trim();
329
+ if (!raw) return '';
330
+ const cleaned = raw
331
+ .split('/')
332
+ .filter(Boolean)
333
+ .filter(seg => seg !== '.' && seg !== '..')
334
+ .join('/');
335
+ return cleaned;
336
+ }
337
+
338
+ function getRepoTypeSegment(repoType) {
339
+ const t = String(repoType || '').toLowerCase();
340
+ if (t === 'dataset') return 'datasets';
341
+ if (t === 'space') return 'spaces';
342
+ return 'models';
343
+ }
344
+
345
+ function buildRepoTreeApiUrl(repoId, repoType, repoPath = '', expand = false) {
346
+ const typeSegment = getRepoTypeSegment(repoType);
347
+ const normalizedPath = normalizeRepoPath(repoPath);
348
+ const encodedPath = normalizedPath
349
+ ? '/' + normalizedPath.split('/').map(encodeURIComponent).join('/')
350
+ : '';
351
+ const suffix = expand ? '?expand=true' : '';
352
+ return `https://huggingface.co/api/${typeSegment}/${repoId}/tree/main${encodedPath}${suffix}`;
353
+ }
354
+
355
+ function buildRepoRawFileUrl(repoId, repoType, repoPath) {
356
+ const normalizedPath = normalizeRepoPath(repoPath);
357
+ const encodedPath = normalizedPath.split('/').map(encodeURIComponent).join('/');
358
+ const prefix = repoType === 'dataset' ? 'datasets/' : repoType === 'space' ? 'spaces/' : '';
359
+ return `https://huggingface.co/${prefix}${repoId}/resolve/main/${encodedPath}?download=true`;
360
+ }
361
+
362
+ function getRepoCacheRoot(repoId, repoType) {
363
+ const safeRepo = String(repoId || '').replace(/[^a-zA-Z0-9._\/-]/g, '_');
364
+ const root = path.join(HF_SANDBOX_DIR, getRepoTypeSegment(repoType), safeRepo);
365
+ fs.mkdirSync(root, { recursive: true });
366
+ return root;
367
+ }
368
+
369
+ function resolveSafeRepoLocalPath(repoId, repoType, repoPath) {
370
+ const repoRoot = getRepoCacheRoot(repoId, repoType);
371
+ const parts = normalizeRepoPath(repoPath).split('/').filter(Boolean);
372
+ const target = path.resolve(repoRoot, ...parts);
373
+ const safeRoot = path.resolve(repoRoot);
374
+ if (!target.startsWith(safeRoot)) {
375
+ throw new Error('Invalid file path');
376
+ }
377
+ fs.mkdirSync(path.dirname(target), { recursive: true });
378
+ return target;
379
+ }
380
+
381
+ async function getLatestRepoCommitHead(repoId, repoType) {
382
+ const key = `${repoType}:${repoId}`;
383
+ const now = Date.now();
384
+ const cached = hfRepoCommitHeadCache.get(key);
385
+ if (cached && (now - cached.checkedAt < HF_TREE_STALE_MS)) {
386
+ return cached;
387
+ }
388
+
389
+ const url = `https://huggingface.co/api/${getRepoTypeSegment(repoType)}/${repoId}/commits/main`;
390
+ const commits = await fetchJSON(url);
391
+ const head = Array.isArray(commits) && commits[0] ? commits[0] : {};
392
+ const value = {
393
+ id: String(head.id || head.sha || ''),
394
+ date: String(head.date || head.createdAt || ''),
395
+ checkedAt: now
396
+ };
397
+ hfRepoCommitHeadCache.set(key, value);
398
+ return value;
399
+ }
400
+
401
+ async function fetchRepoTreeSmart(repoId, repoType, options = {}) {
402
+ const normalizedPath = normalizeRepoPath(options.path || '');
403
+ const expand = !!options.expand;
404
+ const force = !!options.force;
405
+ const cacheKey = `${repoType}:${repoId}:${normalizedPath}:${expand ? 'expand' : 'flat'}`;
406
+ const now = Date.now();
407
+ const cached = hfRepoTreeCache.get(cacheKey);
408
+
409
+ if (cached && !force && (now - cached.checkedAt < HF_TREE_STALE_MS)) {
410
+ return cached.entries;
411
+ }
412
+
413
+ let head = null;
414
+ try {
415
+ head = await getLatestRepoCommitHead(repoId, repoType);
416
+ } catch {
417
+ // If commit endpoint fails but we have cached tree, serve cache.
418
+ if (cached && !force) {
419
+ cached.checkedAt = now;
420
+ return cached.entries;
421
+ }
422
+ }
423
+
424
+ if (cached && !force && head && head.id && cached.commitId && head.id === cached.commitId) {
425
+ cached.checkedAt = now;
426
+ return cached.entries;
427
+ }
428
+
429
+ const url = buildRepoTreeApiUrl(repoId, repoType, normalizedPath, expand);
430
+ const entries = await fetchJSON(url);
431
+ const normalizedEntries = Array.isArray(entries) ? entries : [];
432
+ hfRepoTreeCache.set(cacheKey, {
433
+ entries: normalizedEntries,
434
+ checkedAt: now,
435
+ commitId: head && head.id ? head.id : (cached && cached.commitId ? cached.commitId : ''),
436
+ path: normalizedPath,
437
+ expand
438
+ });
439
+ return normalizedEntries;
440
+ }
441
+
442
+ function detectLanguageFromPath(filePath) {
443
+ const ext = path.extname(String(filePath || '')).toLowerCase();
444
+ const map = {
445
+ '.js': 'javascript', '.cjs': 'javascript', '.mjs': 'javascript',
446
+ '.ts': 'typescript', '.tsx': 'typescript', '.jsx': 'javascript',
447
+ '.json': 'json', '.md': 'markdown', '.txt': 'plaintext',
448
+ '.html': 'html', '.css': 'css', '.scss': 'scss',
449
+ '.py': 'python', '.java': 'java', '.go': 'go',
450
+ '.yml': 'yaml', '.yaml': 'yaml', '.xml': 'xml',
451
+ '.sh': 'shell', '.bat': 'bat', '.ps1': 'powershell',
452
+ '.rs': 'rust', '.cpp': 'cpp', '.c': 'c'
453
+ };
454
+ return map[ext] || 'plaintext';
455
+ }
456
+
457
+ function isLikelyTextBuffer(buffer) {
458
+ if (!buffer || buffer.length === 0) return true;
459
+ const sample = buffer.subarray(0, Math.min(buffer.length, 4096));
460
+ for (let i = 0; i < sample.length; i++) {
461
+ if (sample[i] === 0) return false;
462
+ }
463
+ return true;
464
+ }
465
+
466
+ async function cacheRepoFileLocally(repoId, repoType, repoPath) {
467
+ const normalizedPath = normalizeRepoPath(repoPath);
468
+ if (!normalizedPath) throw new Error('Missing repo file path');
469
+
470
+ const metaKey = `${repoType}:${repoId}:${normalizedPath}`;
471
+ const head = await getLatestRepoCommitHead(repoId, repoType).catch(() => null);
472
+ const localPath = resolveSafeRepoLocalPath(repoId, repoType, normalizedPath);
473
+ const prevMeta = hfRepoFileCacheMeta.get(metaKey);
474
+
475
+ if (
476
+ prevMeta &&
477
+ fs.existsSync(prevMeta.localPath) &&
478
+ head &&
479
+ head.id &&
480
+ prevMeta.commitId === head.id
481
+ ) {
482
+ return { localPath: prevMeta.localPath, commitId: prevMeta.commitId };
483
+ }
484
+
485
+ const rawUrl = buildRepoRawFileUrl(repoId, repoType, normalizedPath);
486
+ await downloadRaw(rawUrl, localPath);
487
+ try {
488
+ fs.chmodSync(localPath, 0o444);
489
+ } catch {
490
+ // Best effort only; some environments may not support chmod semantics.
491
+ }
492
+
493
+ const commitId = head && head.id ? head.id : (prevMeta && prevMeta.commitId ? prevMeta.commitId : '');
494
+ hfRepoFileCacheMeta.set(metaKey, { localPath, commitId, updatedAt: Date.now() });
495
+ return { localPath, commitId };
496
+ }
497
+
498
+ function openFileInBestEditor(targetPath) {
499
+ return new Promise((resolve) => {
500
+ const safePath = String(targetPath || '');
501
+ if (!safePath) return resolve('not-found');
502
+
503
+ const quoted = safePath.replace(/"/g, '\\"');
504
+ exec(`code -g "${quoted}"`, { windowsHide: true }, (codeErr) => {
505
+ if (!codeErr) return resolve('ok-vscode');
506
+
507
+ const npCandidates = [
508
+ process.env.NotepadPlusPlusPath || '',
509
+ 'C:\\Program Files\\Notepad++\\notepad++.exe',
510
+ 'C:\\Program Files (x86)\\Notepad++\\notepad++.exe'
511
+ ].filter(Boolean);
512
+
513
+ const npPath = npCandidates.find(p => fs.existsSync(p));
514
+ if (npPath) {
515
+ const child = spawn(npPath, [safePath], { detached: true, stdio: 'ignore', windowsHide: true });
516
+ child.unref();
517
+ return resolve('ok-notepadpp');
518
+ }
519
+
520
+ shell.openPath(safePath).then(() => resolve('ok-default')).catch(() => resolve('error'));
521
+ });
522
+ });
523
+ }
524
+
525
  // ── Semver comparison helper ──────────────────────────────────────────────────
526
  function semverGt(a, b) {
527
  const pa = String(a || '0').split('.').map(Number);
 
534
  return false;
535
  }
536
 
537
+ function mapPlatformToCatalogOs(platform) {
538
+ if (platform === 'win32') return 'Windows';
539
+ if (platform === 'linux') return 'Linux';
540
+ if (platform === 'darwin') return 'macOS';
541
+ return 'Unknown';
542
+ }
543
+
544
+ function findCatalogEntry(catalog) {
545
+ const files = catalog && Array.isArray(catalog.files) ? catalog.files : [];
546
+ const platformOs = mapPlatformToCatalogOs(process.platform);
547
+ const exact = files.find((f) => f && f.id === APP_CATALOG_ID && f.os === platformOs);
548
+ if (exact) return exact;
549
+ return files.find((f) => f && f.id === APP_CATALOG_ID) || null;
550
+ }
551
+
552
  // ── Raw file downloader used by hot-patch ─────────────────────────────────────
553
  function downloadRaw(urlStr, destPath, redirectCount = 0) {
554
  return new Promise((resolve, reject) => {
 
561
  }, (res) => {
562
  if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
563
  res.resume();
564
+ const nextUrl = new URL(res.headers.location, urlStr).toString();
565
+ downloadRaw(nextUrl, destPath, redirectCount + 1).then(resolve).catch(reject);
566
  return;
567
  }
568
  if (res.statusCode !== 200) { res.resume(); return reject(new Error(`HTTP ${res.statusCode}`)); }
 
608
  minHeight: 580,
609
  show: false,
610
  backgroundColor: '#09090f',
611
+ icon: path.join(__dirname, 'icons', 'icon.png'),
612
  autoHideMenuBar: !isDev,
613
  webPreferences: {
614
  preload: path.join(__dirname, 'preload.js'),
 
630
  applyProductionWindowHardening(mainWindow);
631
 
632
  mainWindow.once('ready-to-show', () => {
633
+ const delay = isDev ? 120 : 350;
634
  setTimeout(() => {
635
  if (splashWindow && !splashWindow.isDestroyed()) {
636
  splashWindow.close();
 
649
 
650
  // ── App lifecycle ─────────────────────────────────────────────────────────────
651
  app.whenReady().then(() => {
652
+ createSplashWindow();
653
  initSecurity();
654
+ initAutoUpdater();
655
  if (isDev) {
656
  Menu.setApplicationMenu(Menu.buildFromTemplate(createDevMenuTemplate()));
657
  } else {
658
  Menu.setApplicationMenu(null);
659
  }
660
  fs.mkdirSync(DOWNLOAD_DIR, { recursive: true });
 
661
  createMainWindow();
662
 
663
  app.on('activate', () => {
 
796
 
797
  // Fetch file tree for a specific repo
798
  ipcMain.handle('fetch-repo-tree', async (_, repoId, repoType, options = {}) => {
799
+ return fetchRepoTreeSmart(repoId, repoType, options);
800
+ });
801
+
802
+ ipcMain.handle('fetch-repo-file', async (_, repoId, repoType, repoPath) => {
803
+ try {
804
+ const normalizedPath = normalizeRepoPath(repoPath);
805
+ if (!normalizedPath) {
806
+ return { ok: false, error: 'Missing file path' };
807
+ }
808
+
809
+ const { localPath } = await cacheRepoFileLocally(repoId, repoType, normalizedPath);
810
+ const stat = fs.statSync(localPath);
811
+ const isTooLarge = stat.size > HF_PREVIEW_MAX_BYTES;
812
+ const previewSize = Math.min(stat.size, HF_PREVIEW_MAX_BYTES);
813
+ const buffer = Buffer.alloc(previewSize);
814
+ const fd = fs.openSync(localPath, 'r');
815
+ try {
816
+ fs.readSync(fd, buffer, 0, previewSize, 0);
817
+ } finally {
818
+ fs.closeSync(fd);
819
+ }
820
+ const isText = isLikelyTextBuffer(buffer);
821
+ let content = '';
822
+
823
+ if (isText) {
824
+ content = buffer.toString('utf8');
825
+ }
826
+
827
+ return {
828
+ ok: true,
829
+ path: normalizedPath,
830
+ localPath,
831
+ isText,
832
+ size: stat.size,
833
+ truncated: isTooLarge,
834
+ language: detectLanguageFromPath(normalizedPath),
835
+ content
836
+ };
837
+ } catch (error) {
838
+ return { ok: false, error: error && error.message ? error.message : String(error) };
839
+ }
840
+ });
841
+
842
+ ipcMain.handle('open-repo-file-editor', async (_, repoId, repoType, repoPath) => {
843
+ try {
844
+ const normalizedPath = normalizeRepoPath(repoPath);
845
+ if (!normalizedPath) return { ok: false, error: 'Missing file path' };
846
+ const { localPath } = await cacheRepoFileLocally(repoId, repoType, normalizedPath);
847
+ const result = await openFileInBestEditor(localPath);
848
+ return { ok: result !== 'error', mode: result, localPath };
849
+ } catch (error) {
850
+ return { ok: false, error: error && error.message ? error.message : String(error) };
851
+ }
852
  });
853
 
854
  // Fetch dashboard stats: datasets + models + spaces counts, total downloads, recent activity
 
905
 
906
  const latest = meta?.['dist-tags']?.latest || '';
907
  const verData = meta?.versions?.[latest] || {};
908
+ const timeMap = meta?.time || {};
909
+ const versionTimeRows = Object.entries(timeMap)
910
+ .filter(([v]) => v !== 'created' && v !== 'modified')
911
+ .sort((a, b) => String(b[1] || '').localeCompare(String(a[1] || '')));
912
+ const repositoryUrl = typeof verData.repository === 'string'
913
+ ? verData.repository
914
+ : (verData.repository && verData.repository.url ? verData.repository.url : '');
915
+ const readmeRaw = typeof meta?.readme === 'string' ? meta.readme : '';
916
+ const readmeExcerpt = readmeRaw.slice(0, 12000);
917
  return {
918
  name,
919
  version: latest,
 
923
  license: verData.license || '',
924
  updatedAt: meta?.time?.[latest] || '',
925
  downloads: dlData?.downloads || 0,
926
+ versionsCount: Object.keys(meta?.versions || {}).length,
927
+ recentVersions: versionTimeRows.slice(0, 12).map(([version, date]) => ({ version, date })),
928
+ repositoryUrl,
929
+ npmUrl: `https://www.npmjs.com/package/${encodeURIComponent(name)}`,
930
+ readmeExcerpt,
931
  };
932
  })
933
  );
 
1008
  return shell.openPath(DOWNLOAD_DIR);
1009
  });
1010
 
1011
+ // Open external URL — allow whitelisted hosts only
1012
+ const ALLOWED_EXTERNAL_HOSTS = new Set([
1013
+ 'huggingface.co',
1014
+ 'github.com',
1015
+ 'raw.githubusercontent.com',
1016
+ 'www.tiktok.com',
1017
+ 'chahuadev.com',
1018
+ 'www.chahuadev.com',
1019
+ 'www.npmjs.com',
1020
+ 'r2.chahuadev.com',
1021
+ 'www.buymeacoffee.com',
1022
+ 'buymeacoffee.com',
1023
+ ]);
1024
  ipcMain.handle('open-external-url', (_, url) => {
1025
  if (typeof url !== 'string') return;
1026
+ try {
1027
+ const parsed = new URL(url);
1028
+ if (parsed.protocol !== 'https:') return;
1029
+ if (!ALLOWED_EXTERNAL_HOSTS.has(parsed.hostname)) return;
1030
+ shell.openExternal(parsed.toString());
1031
+ } catch (_) {
1032
+ return;
1033
+ }
1034
  });
1035
 
1036
  // Download a file with streaming progress events
 
1056
  // Follow redirect
1057
  if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
1058
  res.resume();
1059
+ const nextUrl = new URL(res.headers.location, urlStr).toString();
1060
+ download(nextUrl, redirectCount + 1);
1061
  return;
1062
  }
1063
  if (res.statusCode !== 200) {
 
1111
  // Return current app version
1112
  ipcMain.handle('get-app-version', () => app.getVersion());
1113
 
1114
+ ipcMain.handle('updater:get-channel', () => UPDATE_CHANNEL);
1115
+
1116
+ ipcMain.handle('updater:get-status', () => ({
1117
+ initialized: updaterInitialized,
1118
+ channel: UPDATE_CHANNEL,
1119
+ ...updaterState
1120
+ }));
1121
+
1122
+ ipcMain.handle('updater:check-now', async () => {
1123
+ if (!app.isPackaged || isDev) {
1124
+ return { ok: false, channel: UPDATE_CHANNEL, error: 'Updater is disabled in development mode.' };
1125
+ }
1126
+ if (!updaterInitialized) {
1127
+ return { ok: false, channel: UPDATE_CHANNEL, error: 'Updater is not initialized yet.' };
1128
+ }
1129
+ return checkForUpdatesNow();
1130
+ });
1131
+
1132
+ // Fetch catalog.json from R2, compare with running version
1133
  ipcMain.handle('check-app-update', async () => {
1134
  try {
1135
+ const catalog = await fetchJSON(R2_CATALOG_URL);
1136
+ const latestEntry = findCatalogEntry(catalog);
1137
+ if (!latestEntry || !latestEntry.version) {
1138
+ return { hasUpdate: false, error: `No catalog entry for ${APP_CATALOG_ID}` };
1139
+ }
1140
  const current = app.getVersion();
1141
+ const latestVersion = String(latestEntry.version || '');
1142
+ const hasUpdate = semverGt(latestVersion, current);
1143
  return {
1144
  hasUpdate,
1145
  current,
1146
+ latest: latestVersion,
1147
+ releaseDate: String(latestEntry.releaseDate || ''),
1148
+ notes: String(latestEntry.notes || ''),
1149
+ path: String(latestEntry.path || ''),
1150
+ os: String(latestEntry.os || '')
1151
  };
1152
  } catch (e) {
1153
  return { hasUpdate: false, error: e.message };
package.json CHANGED
@@ -1,75 +1,105 @@
1
- {
2
- "name": "@chahuadev/hub",
3
- "version": "3.1.0",
4
- "description": "Chahuadev Hub — Official App Distribution Center (Electron)",
5
- "main": "main.js",
6
- "type": "commonjs",
7
- "scripts": {
8
- "start": "electron .",
9
- "dev": "electron . --dev",
10
- "build": "electron-builder",
11
- "build-win": "electron-builder --win",
12
- "build-nsis": "electron-builder --win nsis --x64",
13
- "build-portable": "electron-builder --win portable --x64",
14
- "build:linux": "electron-builder --linux --x64 --publish never",
15
- "pack": "electron-builder --dir",
16
- "dist": "electron-builder"
17
- },
18
- "keywords": [
19
- "chahuadev",
20
- "hub",
21
- "electron",
22
- "huggingface",
23
- "downloader",
24
- "desktop"
25
- ],
26
- "author": {
27
- "name": "Chahuadev",
28
- "email": "chahuadev@gmail.com",
29
- "url": "https://chahuadev.com"
30
- },
31
- "license": "SEE LICENSE IN LICENSE.md",
32
- "engines": {
33
- "node": ">=18.0.0"
34
- },
35
- "devDependencies": {
36
- "electron": "^33.4.11",
37
- "electron-builder": "^26.0.0"
38
- },
39
- "build": {
40
- "asar": false,
41
- "appId": "com.chahuadev.hub",
42
- "productName": "Chahuadev-Hub",
43
- "directories": {
44
- "output": "dist"
45
- },
46
- "files": [
47
- "main.js",
48
- "preload.js",
49
- "index.html",
50
- "splash.html",
51
- "icons/**",
52
- "web/**",
53
- "security/**"
54
- ],
55
- "win": {
56
- "target": [
57
- { "target": "nsis", "arch": ["x64"] },
58
- { "target": "portable", "arch": ["x64"] }
59
- ],
60
- "icon": "icon.ico"
61
- },
62
- "linux": {
63
- "target": ["AppImage"],
64
- "icon": "icon.png",
65
- "category": "Utility"
66
- },
67
- "nsis": {
68
- "oneClick": false,
69
- "allowToChangeInstallationDirectory": true,
70
- "installerIcon": "icon.ico",
71
- "uninstallerIcon": "icon.ico"
72
- },
73
- "publish": null
74
- }
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@chahuadev/hub",
3
+ "version": "7.0.3",
4
+ "description": "Chahuadev Hub โ€” Official App Distribution Center (Electron)",
5
+ "main": "main.js",
6
+ "scripts": {
7
+ "start": "electron .",
8
+ "dev": "electron . --dev",
9
+ "build": "electron-builder",
10
+ "build-win": "electron-builder --win",
11
+ "build-nsis": "electron-builder --win nsis --x64",
12
+ "build-portable": "electron-builder --win portable --x64",
13
+ "build:linux": "electron-builder --linux --x64 --publish never",
14
+ "build:linux:wsl": "wsl bash build-linux-wsl.sh",
15
+ "build-v8": "node scripts/build-v8-bytecode.js",
16
+ "pack": "electron-builder --dir",
17
+ "dist": "electron-builder"
18
+ },
19
+ "keywords": [
20
+ "chahuadev",
21
+ "huggingface",
22
+ "downloader",
23
+ "desktop"
24
+ ],
25
+ "author": {
26
+ "name": "Chahuadev",
27
+ "email": "chahuadev@gmail.com",
28
+ "url": "https://chahuadev.com"
29
+ },
30
+ "license": "SEE LICENSE IN LICENSE.md",
31
+ "engines": {
32
+ "node": ">=18.0.0"
33
+ },
34
+ "devDependencies": {
35
+ "electron": "^41.0.3",
36
+ "electron-builder": "^26.0.0"
37
+ },
38
+ "dependencies": {
39
+ "bytenode": "^1.5.7",
40
+ "electron-updater": "^6.6.2"
41
+ },
42
+ "build": {
43
+ "asar": false,
44
+ "appId": "com.chahuadev.hub",
45
+ "productName": "Chahuadev-Hub",
46
+ "artifactName": "Chahuadev-Hub.${ext}",
47
+ "icon": "icons/icon.png",
48
+ "directories": {
49
+ "output": "dist"
50
+ },
51
+ "asarUnpack": [
52
+ "*.jsc"
53
+ ],
54
+ "files": [
55
+ "main.js",
56
+ "*.jsc",
57
+ "preload.js",
58
+ "index.html",
59
+ "splash.html",
60
+ "icons/**",
61
+ "web/**",
62
+ "assets/**/*",
63
+ "security/**"
64
+ ],
65
+ "win": {
66
+ "target": [
67
+ {
68
+ "target": "nsis",
69
+ "arch": [
70
+ "x64"
71
+ ]
72
+ },
73
+ {
74
+ "target": "portable",
75
+ "arch": [
76
+ "x64"
77
+ ]
78
+ }
79
+ ]
80
+ },
81
+ "mac": {
82
+ "target": [
83
+ "dmg",
84
+ "zip"
85
+ ],
86
+ "artifactName": "Chahuadev-Hub-${arch}.${ext}"
87
+ },
88
+ "linux": {
89
+ "target": [
90
+ "AppImage"
91
+ ],
92
+ "category": "Utility"
93
+ },
94
+ "nsis": {
95
+ "oneClick": false,
96
+ "allowToChangeInstallationDirectory": true
97
+ },
98
+ "publish": [
99
+ {
100
+ "provider": "generic",
101
+ "url": "https://r2.chahuadev.com/hub/"
102
+ }
103
+ ]
104
+ }
105
+ }
packages/@chahuadev/chahuadev-hub-app/LICENSE.md ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CHAHUADEV NON-COMMERCIAL & ACCEPTABLE USE LICENSE
2
+
3
+ Copyright (c) 2026 Chahuadev. All rights reserved.
4
+
5
+ This software and its source code are provided for educational, personal, and open-source community use. By downloading, accessing, or using this software, you agree to the following conditions:
6
+
7
+ ---
8
+
9
+ ## 1. FREE DISTRIBUTION ONLY (การแจกจ่ายต้องฟรีเท่านั้น)
10
+
11
+ You are permitted to download, copy, modify, and distribute the software and its source code, provided that such distribution is **strictly free of charge**.
12
+
13
+ ---
14
+
15
+ ## 2. NO COMMERCIAL USE (ห้ามใช้หรือดัดแปลงเพื่อการค้า)
16
+
17
+ You may **NOT** use, modify, distribute, or incorporate this software (or any of its parts) for any commercial purposes. This includes, but is not limited to:
18
+
19
+ - Selling the software or derived versions.
20
+ - Locking the software behind a paywall or subscription.
21
+ - Using the software to provide commercial services.
22
+ - Placing advertisements within the software.
23
+
24
+ ---
25
+
26
+ ## 3. ACCEPTABLE USE / NO MALICIOUS USE (ห้ามใช้ในทางที่ผิด)
27
+
28
+ This software must not be used for any illegal, malicious, or harmful activities. You are strictly prohibited from using this codebase to:
29
+
30
+ - Create malware, ransomware, or any destructive software.
31
+ - Bypass security systems, steal data, or perform unauthorized access.
32
+ - Violate any local, national, or international laws.
33
+
34
+ If the software is found to be used in violation of these terms, your license to use it is immediately and permanently terminated without notice.
35
+
36
+ ---
37
+
38
+ ## 4. ATTRIBUTION (ต้องแสดงแหล่งที่มา)
39
+
40
+ Any permitted distribution or modification must clearly credit the original author:
41
+
42
+ > Original work by **Chahuadev** — https://chahuadev.com
43
+
44
+ You may not remove, obscure, or alter any copyright notices or attribution present in the source code or documentation.
45
+
46
+ ---
47
+
48
+ ## 5. DISCLAIMER OF LIABILITY (ข้อสงวนสิทธิ์ความรับผิดชอบ)
49
+
50
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
51
+
52
+ ---
53
+
54
+ For questions regarding licensing, contact: **Chahuadev** via https://chahuadev.com
packages/@chahuadev/chahuadev-hub-app/README.md ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ language:
4
+ - en
5
+ tags:
6
+ - code-analysis
7
+ - static-analysis
8
+ - javascript
9
+ - electron
10
+ - emoji-cleaner
11
+ - junk-sweeper
12
+ - plugin-management
13
+ - desktop-app
14
+ - electron-app
15
+ - security
16
+ ---
17
+ # Chahuadev Hub
18
+
19
+ # @chahuadev/chahuadev-hub-app
20
+
21
+ **Chahuadev Hub** — The official desktop hub by Chahuadev. Browse repositories, download apps, explore npm packages, and chat with the community — all in one dark-mode Electron app.
22
+
23
+ <div align="center">
24
+
25
+ <p align="center">
26
+ <img src="https://huggingface.co/datasets/chahuadev/chahuadev-png/resolve/main/chahuadev-hub.png" width="600" alt="Chahuadev Hub">
27
+ </p>
28
+
29
+ <p align="center">
30
+ <a href="https://www.npmjs.com/package/@chahuadev/chahuadev-hub-app"><img src="https://img.shields.io/npm/v/@chahuadev/chahuadev-hub-app?style=for-the-badge&color=blue" alt="NPM Version"></a>
31
+ <a href="https://www.npmjs.com/package/@chahuadev/chahuadev-hub-app"><img src="https://img.shields.io/npm/dt/@chahuadev/chahuadev-hub-app?style=for-the-badge&color=success" alt="NPM Downloads"></a>
32
+ <img src="https://img.shields.io/badge/Platform-Windows%20%7C%20Linux-0078D4?style=for-the-badge" alt="Windows | Linux">
33
+ <a href="LICENSE.md"><img src="https://img.shields.io/badge/License-Non--Commercial-blue?style=for-the-badge" alt="Non-Commercial License"></a>
34
+ </p>
35
+
36
+ </div>
37
+
38
+ ---
39
+
40
+ ## ⚙️ Installation
41
+
42
+ > **Requires Node.js 18+.** Use `--foreground-scripts` to see install progress.
43
+
44
+ ### 🪟 Windows — Global Install
45
+
46
+ ```bash
47
+ npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
48
+
49
+ ```
50
+ > The installer auto-downloads the correct binary for your platform. Use `--foreground-scripts` to see the download progress bar.
51
+
52
+ ---
53
+
54
+ ### 🐧 Linux — Global Install
55
+
56
+ Linux requires `sudo` for global npm packages:
57
+
58
+ ```bash
59
+ sudo npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
60
+ ```
61
+
62
+ > **Alternative (no sudo required):** Set npm prefix to your home folder first:
63
+ > ```bash
64
+ > mkdir -p ~/.npm-global
65
+ > npm config set prefix '~/.npm-global'
66
+ > echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
67
+ > source ~/.bashrc
68
+ > ```
69
+ > Then install without sudo:
70
+ > ```bash
71
+ > npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
72
+ > ```
73
+
74
+ ### Launch
75
+
76
+ ```bash
77
+ chahuadev-hub
78
+ ```
79
+
80
+ > **Note:** Downloaded apps are saved automatically to your `Downloads/ChahuadevHub` folder.
81
+
82
+ ### 🐧 Running the AppImage on Linux / WSL2 (Ubuntu)
83
+
84
+ First install the required system libraries (one-time setup):
85
+
86
+ ```bash
87
+ sudo apt-get update && sudo apt-get install -y \
88
+ libnss3 libatk1.0-0 libatk-bridge2.0-0 libcups2 \
89
+ libdrm2 libxkbcommon0 libxcomposite1 libxdamage1 \
90
+ libxrandr2 libgbm1 libasound2
91
+ ```
92
+
93
+ Then run the AppImage:
94
+
95
+ ```bash
96
+ chmod +x "Chahuadev-Hub.AppImage"
97
+ DISPLAY=:0 WAYLAND_DISPLAY=wayland-0 \
98
+ ./"Chahuadev-Hub.AppImage" \
99
+ --appimage-extract-and-run --no-sandbox --disable-gpu
100
+ ```
101
+
102
+ > **WSL2 tip:** Copy to WSL native filesystem first:
103
+ > ```bash
104
+ > # Path after: npm install -g @chahuadev/chahuadev-hub-app
105
+ > # (no sudo)
106
+ >
107
+ > cp ~/.npm-global/lib/node_modules/@chahuadev/chahuadev-hub-app/bin/Chahuadev-Hub.AppImage /tmp/ChahuadevHub.AppImage
108
+ >
109
+ > # (with sudo)
110
+ > # cp /usr/lib/node_modules/@chahuadev/chahuadev-hub-app/bin/Chahuadev-Hub.AppImage /tmp/ChahuadevHub.AppImage
111
+ >
112
+ > chmod +x /tmp/ChahuadevHub.AppImage
113
+ > DISPLAY=:0 WAYLAND_DISPLAY=wayland-0 /tmp/ChahuadevHub.AppImage \
114
+ > --appimage-extract-and-run --no-sandbox --disable-gpu
115
+ > ```
116
+
117
+ ---
118
+
119
+
120
+ ---
121
+
122
+ ## Troubleshooting
123
+
124
+ ### `node\r: No such file or directory` (Linux)
125
+
126
+ The entry script has Windows line endings (CRLF). Reinstall to fix:
127
+
128
+ ```bash
129
+ rm -rf ~/.npm-global/lib/node_modules/@chahuadev/chahuadev-hub-app
130
+ npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
131
+ ```
132
+
133
+ ### `ENOTEMPTY` error on Linux
134
+
135
+ A previous failed install left files behind. Clear them first:
136
+
137
+ ```bash
138
+ # With npm-global prefix
139
+ rm -rf ~/.npm-global/lib/node_modules/@chahuadev/chahuadev-hub-app
140
+ npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
141
+
142
+ # With sudo
143
+ sudo rm -rf /usr/lib/node_modules/@chahuadev/chahuadev-hub-app
144
+ sudo npm install -g @chahuadev/chahuadev-hub-app --foreground-scripts --force
145
+ ```
146
+
147
+ ### `chahuadev-hub` command not found
148
+
149
+ Make sure `~/.npm-global/bin` is in your PATH:
150
+
151
+ ```bash
152
+ echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
153
+ source ~/.bashrc
154
+ chahuadev-hub
155
+ ```
156
+
157
+ ---
158
+
159
+ ## What It Does
160
+
161
+ Chahuadev Hub is an Electron desktop app that brings everything from the Chahuadev ecosystem into one place.
162
+
163
+ ### Features
164
+
165
+ - 📊 **Dashboard** — Live stats and a full landing page webview with real-time download counts
166
+ - 📦 **npm Packages** — Browse all `@chahuadev` packages with version, description, and monthly download stats
167
+ - 🤗 **Hugging Face** — Explore all public datasets, models, and spaces with file browser and commit history
168
+ - ⬇️ **Downloads** — Download and manage official Chahuadev desktop apps (Windows & Linux) with progress tracking
169
+ - 💬 **Community Chat** — Real-time chat via Firebase with auto-translation across 11 languages
170
+ - 🌐 **Cross-Platform** — Windows & Linux
171
+
172
+ ---
173
+
174
+ ## 🔗 Links
175
+
176
+ - [npm](https://www.npmjs.com/package/@chahuadev/chahuadev-hub-app)
177
+ - [Hugging Face](https://huggingface.co/chahuadev)
178
+ ## 💖 Support the Project
179
+ Chahuadev tools are 100% free and open-source. If this project helped you save time, please consider buying me a coffee to help keep the servers running!
180
+
181
+ <a href="https://www.buymeacoffee.com/chahuadevm" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
packages/@chahuadev/chahuadev-hub-app/index.js ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ const path = require('path');
4
+ const { spawnSync } = require('child_process');
5
+ const os = require('os');
6
+ const fs = require('fs');
7
+
8
+ const platform = os.platform();
9
+ const arch = os.arch();
10
+
11
+ let exeName = '';
12
+ if (platform === 'win32') {
13
+ exeName = 'Chahuadev-Hub.exe';
14
+ } else if (platform === 'linux') {
15
+ exeName = 'Chahuadev-Hub.AppImage';
16
+ } else {
17
+ console.error(`Chahuadev Hub does not support ${platform} ${arch}`);
18
+ process.exit(1);
19
+ }
20
+
21
+ const getPath = () => {
22
+ const exePath = path.join(__dirname, 'bin', exeName);
23
+ if (!fs.existsSync(exePath)) {
24
+ console.error(`Executable not found: ${exePath}`);
25
+ console.error('Try running "npm install" again to download the binary.');
26
+ process.exit(1);
27
+ }
28
+ return exePath;
29
+ };
30
+
31
+ const run = () => {
32
+ try {
33
+ spawnSync(getPath(), process.argv.slice(2), { stdio: 'inherit' });
34
+ } catch (error) {
35
+ console.error('Failed to start Chahuadev Hub:', error.message);
36
+ process.exit(1);
37
+ }
38
+ };
39
+
40
+ if (require.main === module) run();
41
+ else module.exports = { run, getPath };
packages/@chahuadev/chahuadev-hub-app/install.js ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+ const https = require('https');
5
+ const os = require('os');
6
+
7
+ const platform = os.platform();
8
+ const arch = os.arch();
9
+
10
+ const R2_BASE = 'https://r2.chahuadev.com/hub';
11
+
12
+ let downloadUrl = '';
13
+ let fileName = '';
14
+
15
+ if (platform === 'win32') {
16
+ downloadUrl = `${R2_BASE}/Chahuadev-Hub.exe`;
17
+ fileName = 'Chahuadev-Hub.exe';
18
+ } else if (platform === 'linux') {
19
+ downloadUrl = `${R2_BASE}/Chahuadev-Hub.AppImage`;
20
+ fileName = 'Chahuadev-Hub.AppImage';
21
+ } else if (platform === 'darwin') {
22
+ downloadUrl = `${R2_BASE}/Chahuadev-Hub`;
23
+ fileName = 'Chahuadev-Hub';
24
+ } else {
25
+ console.warn(`Chahuadev Hub does not support ${platform} ${arch} yet.`);
26
+ process.exit(0);
27
+ }
28
+
29
+ const binDir = path.join(__dirname, 'bin');
30
+ if (!fs.existsSync(binDir)) fs.mkdirSync(binDir, { recursive: true });
31
+
32
+ const filePath = path.join(binDir, fileName);
33
+ console.log(`\nChahuadev Hub -- Downloading binary for ${platform} (${arch})...`);
34
+ console.log('Please wait, this may take a few minutes.\n');
35
+
36
+ function downloadFile(url, dest) {
37
+ https.get(url, (response) => {
38
+ if (response.statusCode === 301 || response.statusCode === 302) {
39
+ return downloadFile(response.headers.location, dest);
40
+ }
41
+ if (response.statusCode !== 200) {
42
+ console.error(`Download failed: HTTP ${response.statusCode}`);
43
+ process.exit(1);
44
+ }
45
+ const totalBytes = parseInt(response.headers['content-length'], 10);
46
+ let downloadedBytes = 0;
47
+ const file = fs.createWriteStream(dest);
48
+ response.on('data', (chunk) => {
49
+ downloadedBytes += chunk.length;
50
+ if (!isNaN(totalBytes)) {
51
+ const percent = ((downloadedBytes / totalBytes) * 100).toFixed(1);
52
+ const dlMB = (downloadedBytes / (1024 * 1024)).toFixed(1);
53
+ const totalMB = (totalBytes / (1024 * 1024)).toFixed(1);
54
+ const filled = Math.round(30 * downloadedBytes / totalBytes);
55
+ const bar = '#'.repeat(filled) + '-'.repeat(30 - filled);
56
+ process.stdout.write(`\r[${bar}] ${percent}% (${dlMB} MB / ${totalMB} MB)`);
57
+ } else {
58
+ process.stdout.write(`\rDownloading... ${(downloadedBytes / (1024 * 1024)).toFixed(1)} MB`);
59
+ }
60
+ });
61
+ response.pipe(file);
62
+ file.on('finish', () => {
63
+ file.close();
64
+ console.log('\n\nDownload completed.');
65
+ console.log(`Saved to: ${dest}`);
66
+ console.log('\nLaunch the app with:');
67
+ console.log(' chahuadev-hub');
68
+ console.log(' npx @chahuadev/chahuadev-hub-app\n');
69
+ if (platform !== 'win32') fs.chmodSync(dest, 0o755);
70
+ });
71
+ }).on('error', (err) => {
72
+ fs.unlink(dest, () => {});
73
+ console.error('\nDownload failed:', err.message);
74
+ process.exit(1);
75
+ });
76
+ }
77
+
78
+ downloadFile(downloadUrl, filePath);
packages/@chahuadev/chahuadev-hub-app/package.json ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "@chahuadev/chahuadev-hub-app",
3
+ "version": "7.0.3",
4
+ "description": "Chahuadev Hub” Official app launcher and distribution hub by Chahuadev",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "chahuadev-hub": "index.js"
8
+ },
9
+ "scripts": {
10
+ "postinstall": "node install.js"
11
+ },
12
+ "files": [
13
+ "index.js",
14
+ "install.js"
15
+ ],
16
+ "keywords": [
17
+ "chahuadev",
18
+ "chahuadev-hub",
19
+ "app-launcher",
20
+ "distribution",
21
+ "hub",
22
+ "electron",
23
+ "python"
24
+ ],
25
+ "author": {
26
+ "name": "Chahuadev",
27
+ "email": "chahuadev@gmail.com",
28
+ "url": "https://huggingface.co/chahuadev"
29
+ },
30
+ "license": "SEE LICENSE IN LICENSE.md",
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "repository": {
35
+ "type": "git",
36
+ "url": "https://huggingface.co/datasets/chahuadev/chahuadev-hub"
37
+ },
38
+ "homepage": "https://huggingface.co/chahuadev"
39
+ }
packages/@chahuadev/chahuadev-hub-app/web/support-the-project.html ADDED
@@ -0,0 +1,365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Support the Project</title>
7
+ <style>
8
+ :root {
9
+ --bg: #060b16;
10
+ --bg-2: #091225;
11
+ --glass: rgba(11, 21, 41, 0.62);
12
+ --glass-2: rgba(18, 35, 66, 0.45);
13
+ --line: rgba(123, 170, 255, 0.3);
14
+ --line-strong: rgba(123, 170, 255, 0.55);
15
+ --text: #ecf4ff;
16
+ --muted: #a9bfdd;
17
+ --accent: #7bb1ff;
18
+ --accent-2: #3f89ff;
19
+ --gold: #f4b43f;
20
+ --gold-2: #dc8f12;
21
+ }
22
+
23
+ * { box-sizing: border-box; }
24
+ html, body { margin: 0; padding: 0; }
25
+
26
+ body {
27
+ min-height: 100vh;
28
+ color: var(--text);
29
+ font-family: "Segoe UI", "Noto Sans", "Tahoma", sans-serif;
30
+ background:
31
+ radial-gradient(900px 500px at 15% 5%, rgba(63, 137, 255, 0.16), transparent 65%),
32
+ radial-gradient(900px 500px at 85% 95%, rgba(123, 177, 255, 0.12), transparent 70%),
33
+ linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
34
+ line-height: 1.7;
35
+ }
36
+
37
+ .page {
38
+ max-width: 1100px;
39
+ margin: 0 auto;
40
+ padding: 28px 20px 36px;
41
+ position: relative;
42
+ }
43
+
44
+ .topbar {
45
+ display: flex;
46
+ justify-content: space-between;
47
+ align-items: center;
48
+ gap: 12px;
49
+ margin-bottom: 18px;
50
+ }
51
+
52
+ .top-title {
53
+ display: inline-flex;
54
+ align-items: center;
55
+ gap: 10px;
56
+ font-size: 13px;
57
+ letter-spacing: 0.09em;
58
+ text-transform: uppercase;
59
+ color: var(--accent);
60
+ }
61
+
62
+ .top-title-dot {
63
+ width: 8px;
64
+ height: 8px;
65
+ border-radius: 999px;
66
+ background: var(--accent);
67
+ box-shadow: 0 0 14px rgba(123, 177, 255, 0.8);
68
+ }
69
+
70
+ .support-btn {
71
+ display: inline-flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ gap: 9px;
75
+ border: 1px solid rgba(244, 180, 63, 0.7);
76
+ background: linear-gradient(135deg, var(--gold), var(--gold-2));
77
+ color: #101624;
78
+ text-decoration: none;
79
+ border-radius: 12px;
80
+ padding: 12px 18px;
81
+ min-width: 220px;
82
+ font-size: 15px;
83
+ font-weight: 800;
84
+ box-shadow: 0 10px 24px rgba(244, 180, 63, 0.22);
85
+ transition: transform .2s ease, box-shadow .2s ease;
86
+ }
87
+
88
+ .support-btn:hover {
89
+ transform: translateY(-2px);
90
+ box-shadow: 0 14px 30px rgba(244, 180, 63, 0.3);
91
+ }
92
+
93
+ .hero {
94
+ border: 1px solid var(--line-strong);
95
+ border-radius: 18px;
96
+ padding: 24px;
97
+ background: linear-gradient(180deg, var(--glass) 0%, var(--glass-2) 100%);
98
+ backdrop-filter: blur(8px);
99
+ margin-bottom: 18px;
100
+ }
101
+
102
+ .hero h1 {
103
+ margin: 0 0 10px;
104
+ font-size: clamp(30px, 5vw, 48px);
105
+ line-height: 1.1;
106
+ letter-spacing: -0.02em;
107
+ }
108
+
109
+ .hero p {
110
+ margin: 0;
111
+ color: var(--muted);
112
+ font-size: 15px;
113
+ max-width: 900px;
114
+ }
115
+
116
+ .grid {
117
+ display: grid;
118
+ grid-template-columns: repeat(2, minmax(0, 1fr));
119
+ gap: 12px;
120
+ }
121
+
122
+ .lang-card {
123
+ border: 1px solid var(--line);
124
+ border-radius: 14px;
125
+ background: rgba(7, 17, 33, 0.62);
126
+ padding: 15px 15px 13px;
127
+ }
128
+
129
+ .lang-head {
130
+ display: flex;
131
+ align-items: baseline;
132
+ justify-content: space-between;
133
+ gap: 8px;
134
+ margin-bottom: 8px;
135
+ }
136
+
137
+ .lang-code {
138
+ font-size: 12px;
139
+ letter-spacing: 0.08em;
140
+ text-transform: uppercase;
141
+ color: var(--accent);
142
+ font-weight: 700;
143
+ }
144
+
145
+ .lang-name {
146
+ font-size: 12px;
147
+ color: #c9dcfa;
148
+ opacity: 0.9;
149
+ }
150
+
151
+ .lang-card p {
152
+ margin: 0;
153
+ color: #d9e7fb;
154
+ font-size: 14px;
155
+ white-space: pre-line;
156
+ }
157
+
158
+ .footer {
159
+ margin-top: 16px;
160
+ color: #99b4d8;
161
+ font-size: 12px;
162
+ text-align: center;
163
+ }
164
+
165
+ .footer-links {
166
+ margin-top: 6px;
167
+ display: inline-flex;
168
+ gap: 12px;
169
+ flex-wrap: wrap;
170
+ justify-content: center;
171
+ }
172
+
173
+ .footer-link {
174
+ color: #bcd5f8;
175
+ text-decoration: none;
176
+ border-bottom: 1px solid rgba(123, 170, 255, 0.4);
177
+ transition: color .2s ease, border-color .2s ease;
178
+ }
179
+
180
+ .footer-link:hover {
181
+ color: #e6f0ff;
182
+ border-color: rgba(123, 170, 255, 0.8);
183
+ }
184
+
185
+ @media (max-width: 860px) {
186
+ .grid { grid-template-columns: 1fr; }
187
+ .topbar {
188
+ flex-direction: column;
189
+ align-items: flex-start;
190
+ }
191
+ .support-btn {
192
+ width: 100%;
193
+ }
194
+ }
195
+ </style>
196
+ </head>
197
+ <body>
198
+ <main class="page">
199
+ <div class="topbar">
200
+ <div class="top-title"><span class="top-title-dot"></span>Support the Project</div>
201
+ <a class="support-btn" href="https://www.buymeacoffee.com/chahuadevm" target="_blank" rel="noopener noreferrer">Buy me a coffee</a>
202
+ </div>
203
+
204
+ <section class="hero">
205
+ <h1>Support the Project</h1>
206
+ <p>This page is available for everyone in the Chahuadev ecosystem. If these tools save your time, your support helps keep the project stable, maintained, and growing.</p>
207
+ </section>
208
+
209
+ <section class="grid">
210
+ <article class="lang-card">
211
+ <div class="lang-head"><div class="lang-code">EN</div><div class="lang-name">English</div></div>
212
+ <p>Building open-source tools to make developers' lives easier!
213
+ I'm the creator of Junk Sweeper and Dev Launcher. I believe in providing high-quality diagnostic tools completely for free.
214
+
215
+ If you find my projects helpful, you can support me here. Your contributions help cover the hidden costs of development (VPS, AI services, servers, and caffeine) and keep the chahuadev ecosystem growing. Cheers!</p>
216
+ </article>
217
+
218
+ <article class="lang-card">
219
+ <div class="lang-head"><div class="lang-code">TH</div><div class="lang-name">Thai</div></div>
220
+ <p>เครื่องมือของ Chahuadev เปิดให้ใช้งานฟรี 100% ถ้าซอฟต์แวร์ตัวนี้ช่วยประหยัดเวลาการทำงานของคุณได้ คุณสามารถช่วยสมทบทุนค่าเซิร์ฟเวอร์และค่าไฟได้ ด้วยการ "เลี้ยงกาแฟผมสักแก้ว" เพื่อให้โปรเจกต์นี้พัฒนาต่อไปได้ครับ!</p>
221
+ </article>
222
+
223
+ <article class="lang-card">
224
+ <div class="lang-head"><div class="lang-code">ES</div><div class="lang-name">Spanish</div></div>
225
+ <p>Estoy creando herramientas open-source para facilitar la vida de los desarrolladores.
226
+ Si mis proyectos te ayudan, puedes apoyarme aquí. Tu aporte cubre costos reales de desarrollo (VPS, servicios de IA, servidores y café) y ayuda a que el ecosistema de chahuadev siga creciendo.</p>
227
+ </article>
228
+
229
+ <article class="lang-card">
230
+ <div class="lang-head"><div class="lang-code">FR</div><div class="lang-name">French</div></div>
231
+ <p>Je construis des outils open-source pour simplifier la vie des développeurs.
232
+ Si mes projets vous sont utiles, vous pouvez me soutenir ici. Vos contributions couvrent les coûts cachés du développement (VPS, services IA, serveurs et café) et permettent à l'écosystème chahuadev de continuer à grandir.</p>
233
+ </article>
234
+
235
+ <article class="lang-card">
236
+ <div class="lang-head"><div class="lang-code">DE</div><div class="lang-name">German</div></div>
237
+ <p>Ich entwickle Open-Source-Tools, um den Alltag von Entwicklerinnen und Entwicklern zu erleichtern.
238
+ Wenn dir meine Projekte helfen, kannst du mich hier unterstützen. Dein Beitrag deckt versteckte Entwicklungskosten (VPS, KI-Dienste, Server und Kaffee) und hält das chahuadev-Ökosystem am Wachsen.</p>
239
+ </article>
240
+
241
+ <article class="lang-card">
242
+ <div class="lang-head"><div class="lang-code">PT</div><div class="lang-name">Portuguese</div></div>
243
+ <p>Estou criando ferramentas open-source para facilitar a vida de desenvolvedores.
244
+ Se meus projetos ajudam você, pode me apoiar aqui. Sua contribuição cobre custos reais de desenvolvimento (VPS, serviços de IA, servidores e café) e mantém o ecossistema chahuadev em crescimento.</p>
245
+ </article>
246
+
247
+ <article class="lang-card">
248
+ <div class="lang-head"><div class="lang-code">JA</div><div class="lang-name">Japanese</div></div>
249
+ <p>開発者の作業をもっと楽にするために、オープンソースツールを作っています。
250
+ プロジェクトが役に立ったら、ここから応援していただけるとうれしいです。ご支援は VPS、AI サービス、サーバー運用、そしてコーヒー代などの継続コストに使われ、chahuadev エコシステムの成長につながります。</p>
251
+ </article>
252
+
253
+ <article class="lang-card">
254
+ <div class="lang-head"><div class="lang-code">ZH</div><div class="lang-name">Chinese</div></div>
255
+ <p>我正在构建开源工具,让开发者的工作更轻松。
256
+ 如果这些项目对你有帮助,欢迎在这里支持我。你的支持将用于支付开发中的隐藏成本(VPS、AI 服务、服务器和咖啡),并帮助 chahuadev 生态持续成长。</p>
257
+ </article>
258
+
259
+ <article class="lang-card">
260
+ <div class="lang-head"><div class="lang-code">KO</div><div class="lang-name">Korean</div></div>
261
+ <p>개발자의 일을 더 쉽게 만들기 위해 오픈소스 도구를 만들고 있습니다.
262
+ 프로젝트가 도움이 되었다면 여기에서 후원해 주세요. 여러분의 후원은 VPS, AI 서비스, 서버 운영, 그리고 커피 같은 개발 비용을 충당하고 chahuadev 생��계의 성장을 돕습니다.</p>
263
+ </article>
264
+
265
+ <article class="lang-card">
266
+ <div class="lang-head"><div class="lang-code">BN</div><div class="lang-name">Bengali</div></div>
267
+ <p>ডেভেলপারদের কাজ সহজ করতে আমি ওপেন-সোর্স টুল তৈরি করি।
268
+ আমার প্রজেক্টগুলো আপনার কাজে লাগলে এখানে সাপোর্ট করতে পারেন। আপনার সহায়তা VPS, AI সার্ভিস, সার্ভার এবং ডেভেলপমেন্টের লুকানো খরচ সামলাতে সাহায্য করে, আর chahuadev ইকোসিস্টেমকে এগিয়ে নেয়।</p>
269
+ </article>
270
+
271
+ <article class="lang-card">
272
+ <div class="lang-head"><div class="lang-code">UR</div><div class="lang-name">Urdu</div></div>
273
+ <p>میں ڈویلپرز کی زندگی آسان بنانے کے لیے اوپن سورس ٹولز بناتا ہوں۔
274
+ اگر میرے پروجیکٹس آپ کے کام آئیں تو یہاں سپورٹ کریں۔ آپ کی مدد VPS، AI سروسز، سرورز اور دیگر اخراجات پورے کرنے میں مدد دیتی ہے، اور chahuadev ایکو سسٹم کو آگے بڑھاتی ہے۔</p>
275
+ </article>
276
+
277
+ <article class="lang-card">
278
+ <div class="lang-head"><div class="lang-code">HI</div><div class="lang-name">Hindi</div></div>
279
+ <p>मैं डेवलपर्स की ज़िंदगी आसान बनाने के लिए ओपन-सोर्स टूल्स बनाता हूँ।
280
+ अगर मेरे प्रोजेक्ट आपके काम आते हैं, तो आप यहाँ सपोर्ट कर सकते हैं। आपका सहयोग VPS, AI सेवाओं, सर्वर और डेवलपमेंट की छिपी लागत को पूरा करने में मदद करता है और chahuadev इकोसिस्टम को आगे बढ़ाता है।</p>
281
+ </article>
282
+
283
+ <article class="lang-card">
284
+ <div class="lang-head"><div class="lang-code">AR</div><div class="lang-name">Arabic</div></div>
285
+ <p>أبني أدوات مفتوحة المصدر لتسهيل حياة المطورين.
286
+ إذا كانت مشاريعي مفيدة لك، يمكنك دعمي من هنا. مساهمتك تساعد في تغطية التكاليف الخفية للتطوير مثل VPS وخدمات الذكاء الاصطناعي والخوادم والقهوة، وتدعم نمو منظومة chahuadev.</p>
287
+ </article>
288
+ </section>
289
+
290
+ <div class="footer">
291
+ Chahuadev Support the Project
292
+ <div class="footer-links">
293
+ <a class="footer-link" href="https://www.chahuadev.com" target="_blank" rel="noopener noreferrer">Main Website</a>
294
+ <a class="footer-link" href="https://huggingface.co/chahuadev" target="_blank" rel="noopener noreferrer">Hugging Face</a>
295
+ </div>
296
+ </div>
297
+ </main>
298
+ <script>
299
+ (function () {
300
+ const ALLOWED_HOSTS = new Set([
301
+ 'www.buymeacoffee.com',
302
+ 'buymeacoffee.com',
303
+ 'www.chahuadev.com',
304
+ 'chahuadev.com',
305
+ 'huggingface.co'
306
+ ]);
307
+
308
+ function isAllowedExternalUrl(url) {
309
+ try {
310
+ const parsed = new URL(url);
311
+ return parsed.protocol === 'https:' && ALLOWED_HOSTS.has(parsed.hostname);
312
+ } catch (_) {
313
+ return false;
314
+ }
315
+ }
316
+
317
+ async function openViaBridge(url) {
318
+ const root = window.parent && window.parent !== window ? window.parent : window;
319
+
320
+ if (root.api && typeof root.api.openExternal === 'function') {
321
+ return root.api.openExternal(url);
322
+ }
323
+ if (root.electronAPI && typeof root.electronAPI.openExternal === 'function') {
324
+ return root.electronAPI.openExternal(url);
325
+ }
326
+ if (root.chahuadevHub && typeof root.chahuadevHub.openExternalUrl === 'function') {
327
+ return root.chahuadevHub.openExternalUrl(url);
328
+ }
329
+ if (root.chahuadev && typeof root.chahuadev.openExternalUrl === 'function') {
330
+ return root.chahuadev.openExternalUrl(url);
331
+ }
332
+ if (root.emojiCleanerAPI && typeof root.emojiCleanerAPI.openExternal === 'function') {
333
+ return root.emojiCleanerAPI.openExternal(url);
334
+ }
335
+
336
+ return false;
337
+ }
338
+
339
+ async function openExternalSafely(url) {
340
+ if (!isAllowedExternalUrl(url)) return;
341
+
342
+ try {
343
+ const result = await openViaBridge(url);
344
+ if (result === false) {
345
+ window.open(url, '_blank', 'noopener,noreferrer');
346
+ }
347
+ } catch (_) {
348
+ window.open(url, '_blank', 'noopener,noreferrer');
349
+ }
350
+ }
351
+
352
+ document.addEventListener('click', function (event) {
353
+ const anchor = event.target.closest('a[href]');
354
+ if (!anchor) return;
355
+
356
+ const href = anchor.getAttribute('href');
357
+ if (!href || !/^https?:\/\//i.test(href)) return;
358
+
359
+ event.preventDefault();
360
+ openExternalSafely(anchor.href);
361
+ });
362
+ })();
363
+ </script>
364
+ </body>
365
+ </html>
preload.js CHANGED
@@ -47,6 +47,12 @@ contextBridge.exposeInMainWorld('chahuadevHub', {
47
  fetchRepoTree: (repoId, repoType, options) =>
48
  ipcRenderer.invoke('fetch-repo-tree', repoId, repoType, options),
49
 
 
 
 
 
 
 
50
  fetchNpmPackages: () =>
51
  ipcRenderer.invoke('fetch-npm-packages'),
52
 
@@ -97,6 +103,12 @@ contextBridge.exposeInMainWorld('chahuadevHub', {
97
  checkAppUpdate: () =>
98
  ipcRenderer.invoke('check-app-update'),
99
 
 
 
 
 
 
 
100
  // Run npm install -g @chahuadev/chahuadev-hub-app in background
101
  // Command is hardcoded in main process — cannot be overridden from renderer
102
  npmSelfUpdate: () =>
 
47
  fetchRepoTree: (repoId, repoType, options) =>
48
  ipcRenderer.invoke('fetch-repo-tree', repoId, repoType, options),
49
 
50
+ fetchRepoFile: (repoId, repoType, repoPath) =>
51
+ ipcRenderer.invoke('fetch-repo-file', repoId, repoType, repoPath),
52
+
53
+ openRepoFileEditor: (repoId, repoType, repoPath) =>
54
+ ipcRenderer.invoke('open-repo-file-editor', repoId, repoType, repoPath),
55
+
56
  fetchNpmPackages: () =>
57
  ipcRenderer.invoke('fetch-npm-packages'),
58
 
 
103
  checkAppUpdate: () =>
104
  ipcRenderer.invoke('check-app-update'),
105
 
106
+ updater: {
107
+ getChannel: () => ipcRenderer.invoke('updater:get-channel'),
108
+ getStatus: () => ipcRenderer.invoke('updater:get-status'),
109
+ checkNow: () => ipcRenderer.invoke('updater:check-now')
110
+ },
111
+
112
  // Run npm install -g @chahuadev/chahuadev-hub-app in background
113
  // Command is hardcoded in main process — cannot be overridden from renderer
114
  npmSelfUpdate: () =>
web/hub.css ADDED
@@ -0,0 +1,1463 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
2
+ :root {
3
+ --bg: #09090f; --surface: #0f172a; --card: #1e293b; --border: #334155;
4
+ --muted: #475569; --dim: #64748b; --sub: #94a3b8; --text: #f1f5f9;
5
+ --accent: #3b82f6; --accent-d: #1d4ed8; --success: #10b981;
6
+ --warn: #f59e0b; --danger: #ef4444; --purple: #2563eb; --purple-light: #60a5fa;
7
+ }
8
+ html, body { height: 100%; overflow: hidden; }
9
+ body {
10
+ font-family: 'Inter', system-ui, sans-serif;
11
+ background: var(--bg);
12
+ color: var(--text);
13
+ display: flex;
14
+ flex-direction: column;
15
+ height: 100vh;
16
+ }
17
+
18
+ /* Top Nav */
19
+ #topnav {
20
+ display: flex;
21
+ align-items: center;
22
+ height: 52px;
23
+ background: var(--surface);
24
+ border-bottom: 1px solid var(--border);
25
+ padding: 0 16px;
26
+ gap: 4px;
27
+ flex-shrink: 0;
28
+ -webkit-app-region: drag;
29
+ }
30
+ #topnav * { -webkit-app-region: no-drag; }
31
+
32
+ .brand-box {
33
+ display: flex;
34
+ align-items: center;
35
+ gap: 8px;
36
+ margin-right: 12px;
37
+ }
38
+ .brand-box svg { color: var(--accent); }
39
+ .brand-name {
40
+ font-size: 13px;
41
+ font-weight: 700;
42
+ letter-spacing: 0.05em;
43
+ color: var(--text);
44
+ }
45
+ .nav-sep { width: 1px; height: 24px; background: var(--border); margin: 0 6px; }
46
+
47
+ .nav-tab {
48
+ display: flex;
49
+ align-items: center;
50
+ gap: 6px;
51
+ padding: 6px 12px;
52
+ border-radius: 6px;
53
+ border: none;
54
+ background: transparent;
55
+ color: var(--sub);
56
+ font-size: 13px;
57
+ font-weight: 500;
58
+ cursor: pointer;
59
+ transition: background 0.15s, color 0.15s;
60
+ }
61
+ .nav-tab:hover { background: var(--card); color: var(--text); }
62
+ .nav-tab.active { background: var(--accent); color: #fff; }
63
+
64
+ .nav-spacer { flex: 1; }
65
+
66
+ .nav-action {
67
+ display: flex;
68
+ align-items: center;
69
+ gap: 6px;
70
+ padding: 5px 10px;
71
+ border-radius: 6px;
72
+ border: 1px solid var(--border);
73
+ background: transparent;
74
+ color: var(--sub);
75
+ font-size: 12px;
76
+ font-weight: 500;
77
+ cursor: pointer;
78
+ transition: all 0.15s;
79
+ }
80
+ .nav-action:hover { background: var(--card); color: var(--text); border-color: var(--muted); }
81
+ .nav-action + .nav-action { margin-left: 4px; }
82
+
83
+ /* Pages */
84
+ #content-wrap {
85
+ flex: 1;
86
+ overflow: hidden;
87
+ position: relative;
88
+ }
89
+ .page {
90
+ position: absolute;
91
+ inset: 0;
92
+ overflow-y: auto;
93
+ padding: 24px;
94
+ display: none;
95
+ background-image:
96
+ linear-gradient(rgba(59,130,246,0.035) 1px, transparent 1px),
97
+ linear-gradient(90deg, rgba(59,130,246,0.035) 1px, transparent 1px),
98
+ radial-gradient(ellipse 700px 350px at 100% 0%, rgba(59,130,246,0.08), transparent 60%),
99
+ radial-gradient(ellipse 500px 300px at 0% 100%, rgba(14,165,233,0.05), transparent 60%);
100
+ background-size: 60px 60px, 60px 60px, auto, auto;
101
+ }
102
+ .page.active { display: block; }
103
+
104
+ /* Scrollbar */
105
+ ::-webkit-scrollbar { width: 6px; }
106
+ ::-webkit-scrollbar-track { background: transparent; }
107
+ ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
108
+ ::-webkit-scrollbar-thumb:hover { background: var(--muted); }
109
+
110
+ /* Status bar */
111
+ #statusbar {
112
+ height: 26px;
113
+ background: var(--surface);
114
+ border-top: 1px solid var(--border);
115
+ padding: 0 14px;
116
+ font-size: 11px;
117
+ color: var(--dim);
118
+ display: flex;
119
+ align-items: center;
120
+ gap: 8px;
121
+ flex-shrink: 0;
122
+ }
123
+ .status-dot {
124
+ width: 6px; height: 6px;
125
+ border-radius: 50%;
126
+ background: var(--success);
127
+ flex-shrink: 0;
128
+ }
129
+ .status-dot.loading { background: var(--warn); animation: blinkdot 1s infinite; }
130
+ .status-dot.error { background: var(--danger); }
131
+ @keyframes blinkdot { 0%,100%{opacity:1} 50%{opacity:0.3} }
132
+
133
+ /* Page header */
134
+ .page-eyebrow {
135
+ display: flex; align-items: center; gap: 8px;
136
+ font-size: 11px; font-weight: 700;
137
+ text-transform: uppercase; letter-spacing: 0.1em;
138
+ color: var(--purple-light); margin-bottom: 8px;
139
+ }
140
+ .page-eyebrow::before {
141
+ content: ''; width: 3px; height: 14px; border-radius: 2px;
142
+ background: linear-gradient(180deg, #2563eb, #38bdf8); flex-shrink: 0;
143
+ }
144
+ .page-header {
145
+ display: flex;
146
+ align-items: flex-start;
147
+ justify-content: space-between;
148
+ margin-bottom: 24px;
149
+ }
150
+ .page-title {
151
+ font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2;
152
+ background: linear-gradient(135deg, #f1f5f9 0%, #93c5fd 100%);
153
+ -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
154
+ }
155
+ .page-sub { font-size: 13px; color: var(--sub); margin-top: 6px; line-height: 1.6; }
156
+
157
+ /* Loading / Empty / Error */
158
+ .loading-box, .empty-box, .error-box {
159
+ padding: 56px 20px;
160
+ text-align: center;
161
+ color: var(--dim);
162
+ font-size: 14px;
163
+ }
164
+ .loading-box svg, .empty-box svg, .error-box svg {
165
+ display: block;
166
+ margin: 0 auto 12px;
167
+ opacity: 0.4;
168
+ }
169
+ .error-box { color: var(--danger); }
170
+ .error-box svg { opacity: 0.7; }
171
+ .spin { animation: spin 0.9s linear infinite; }
172
+ @keyframes spin { to { transform: rotate(360deg); } }
173
+
174
+ /* DASHBOARD */
175
+ .stat-grid {
176
+ display: grid;
177
+ grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
178
+ gap: 14px;
179
+ margin-bottom: 28px;
180
+ }
181
+ .stat-card {
182
+ background: var(--card);
183
+ border: 1px solid var(--border);
184
+ border-radius: 12px;
185
+ padding: 18px 20px;
186
+ display: flex;
187
+ flex-direction: column;
188
+ gap: 6px;
189
+ transition: border-color 0.2s, transform 0.2s;
190
+ }
191
+ .stat-card:hover { border-color: var(--muted); transform: translateY(-2px); }
192
+ .stat-card-icon {
193
+ width: 32px; height: 32px;
194
+ border-radius: 8px;
195
+ display: flex; align-items: center; justify-content: center;
196
+ margin-bottom: 4px;
197
+ }
198
+ .sci-blue { background: rgba(59,130,246,0.15); color: var(--accent); }
199
+ .sci-purple { background: rgba(59,130,246,0.15); color: var(--purple); }
200
+ .sci-sky { background: rgba(14,165,233,0.15); color: #38bdf8; }
201
+ .sci-cyan { background: rgba(6,182,212,0.15); color: #22d3ee; }
202
+ .sci-lt-blue { background: rgba(56,189,248,0.15); color: #7dd3fc; }
203
+ .sci-green { background: rgba(16,185,129,0.15); color: var(--success); }
204
+ .sci-orange { background: rgba(245,158,11,0.15); color: var(--warn); }
205
+ .stat-card-value {
206
+ font-size: 28px;
207
+ font-weight: 800;
208
+ line-height: 1;
209
+ background: linear-gradient(135deg, #60a5fa 0%, #38bdf8 100%);
210
+ -webkit-background-clip: text; -webkit-text-fill-color: transparent;
211
+ background-clip: text;
212
+ }
213
+ .stat-card-label {
214
+ font-size: 12px;
215
+ color: var(--sub);
216
+ font-weight: 500;
217
+ }
218
+ .section-label {
219
+ display: flex; align-items: center; gap: 8px;
220
+ font-size: 11px; font-weight: 700;
221
+ text-transform: uppercase; letter-spacing: 0.09em;
222
+ color: var(--purple-light); margin-bottom: 12px;
223
+ }
224
+ .section-label::before {
225
+ content: ''; width: 3px; height: 14px; border-radius: 2px;
226
+ background: linear-gradient(180deg, #2563eb, #38bdf8); flex-shrink: 0;
227
+ }
228
+ .activity-list {
229
+ background: var(--card);
230
+ border: 1px solid var(--border);
231
+ border-radius: 10px;
232
+ overflow: hidden;
233
+ }
234
+ .activity-item {
235
+ display: flex;
236
+ align-items: flex-start;
237
+ gap: 12px;
238
+ padding: 11px 16px;
239
+ border-bottom: 1px solid var(--border);
240
+ font-size: 13px;
241
+ }
242
+ .activity-item:last-child { border-bottom: none; }
243
+ .activity-dot {
244
+ width: 7px; height: 7px;
245
+ border-radius: 50%;
246
+ background: var(--accent);
247
+ flex-shrink: 0;
248
+ margin-top: 4px;
249
+ }
250
+ .activity-text { flex: 1; color: var(--text); }
251
+ .activity-time { font-size: 11px; color: var(--dim); flex-shrink: 0; }
252
+
253
+ /* DASHBOARD WEBVIEW */
254
+ #page-dashboard.active {
255
+ display: flex;
256
+ flex-direction: column;
257
+ height: calc(100vh - 52px - 26px);
258
+ overflow: hidden;
259
+ padding: 0;
260
+ }
261
+ .dash-webview-wrap {
262
+ flex: 1;
263
+ overflow: hidden;
264
+ position: relative;
265
+ }
266
+ .dash-webview-wrap iframe {
267
+ width: 100%;
268
+ height: 100%;
269
+ border: none;
270
+ display: block;
271
+ background: var(--bg);
272
+ }
273
+
274
+ /* SUPPORT PAGE */
275
+ #page-support.active {
276
+ display: flex;
277
+ flex-direction: column;
278
+ height: calc(100vh - 52px - 26px);
279
+ overflow: hidden;
280
+ padding: 0;
281
+ }
282
+ .support-webview-wrap {
283
+ flex: 1;
284
+ overflow: hidden;
285
+ position: relative;
286
+ }
287
+ #support-iframe {
288
+ width: 100%;
289
+ height: 100%;
290
+ border: none;
291
+ display: block;
292
+ background: var(--bg);
293
+ }
294
+
295
+ /* REPOS */
296
+ #page-repos.active {
297
+ display: flex;
298
+ flex-direction: column;
299
+ overflow: hidden;
300
+ }
301
+ .repos-page-head {
302
+ display: flex;
303
+ align-items: center;
304
+ justify-content: space-between;
305
+ gap: 14px;
306
+ margin-bottom: 8px;
307
+ }
308
+ .repos-page-head .page-eyebrow { margin-bottom: 0; }
309
+ .repos-mini-dl {
310
+ display: inline-flex;
311
+ align-items: center;
312
+ gap: 8px;
313
+ padding: 7px 11px;
314
+ border-radius: 10px;
315
+ border: 1px solid var(--border);
316
+ background: rgba(255,255,255,0.03);
317
+ flex-shrink: 0;
318
+ margin-top: 2px;
319
+ }
320
+ .repos-mini-dl-label {
321
+ font-size: 11px;
322
+ letter-spacing: 0.2px;
323
+ color: var(--dim);
324
+ }
325
+ .repos-mini-dl-value {
326
+ font-size: 13px;
327
+ font-weight: 700;
328
+ color: var(--text);
329
+ min-width: 30px;
330
+ text-align: right;
331
+ }
332
+ .repos-layout {
333
+ display: flex;
334
+ background: var(--card);
335
+ border: 1px solid var(--border);
336
+ border-radius: 12px;
337
+ overflow: hidden;
338
+ flex: 1;
339
+ min-height: 0;
340
+ user-select: none;
341
+ }
342
+ .repos-left {
343
+ width: 345px;
344
+ min-width: 140px;
345
+ max-width: 60%;
346
+ border-right: 1px solid var(--border);
347
+ display: flex;
348
+ flex-direction: column;
349
+ flex-shrink: 0;
350
+ }
351
+ .repos-resizer {
352
+ width: 4px;
353
+ background: transparent;
354
+ cursor: col-resize;
355
+ flex-shrink: 0;
356
+ transition: background 0.15s;
357
+ position: relative;
358
+ }
359
+ .repos-resizer:hover,
360
+ .repos-resizer.dragging { background: var(--accent); }
361
+ .repos-left-hdr {
362
+ padding: 10px 12px;
363
+ border-bottom: 1px solid var(--border);
364
+ display: flex;
365
+ gap: 5px;
366
+ flex-wrap: wrap;
367
+ }
368
+ .filter-chip {
369
+ padding: 3px 10px;
370
+ border-radius: 20px;
371
+ border: 1px solid var(--border);
372
+ background: transparent;
373
+ color: var(--sub);
374
+ font-size: 12px;
375
+ cursor: pointer;
376
+ transition: all 0.15s;
377
+ }
378
+ .filter-chip:hover { border-color: var(--muted); color: var(--text); }
379
+ .filter-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
380
+ .repos-list { flex: 1; overflow-y: auto; }
381
+ .repo-item {
382
+ display: flex;
383
+ align-items: center;
384
+ gap: 9px;
385
+ padding: 9px 12px;
386
+ cursor: pointer;
387
+ border-bottom: 1px solid transparent;
388
+ transition: background 0.1s;
389
+ border-left: 2px solid transparent;
390
+ }
391
+ .repo-item:hover { background: rgba(255,255,255,0.04); }
392
+ .repo-item.active { background: rgba(59,130,246,0.1); border-left-color: var(--accent); }
393
+ .repo-item-icon { color: var(--dim); flex-shrink: 0; }
394
+ .repo-item-info { flex: 1; min-width: 0; }
395
+ .repo-item-name {
396
+ font-size: 13px; font-weight: 500;
397
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
398
+ }
399
+ .repo-badge {
400
+ font-size: 10px; padding: 2px 6px;
401
+ border-radius: 4px; font-weight: 600; flex-shrink: 0;
402
+ }
403
+ .rb-dataset { background: rgba(59,130,246,0.15); color: var(--accent); }
404
+ .rb-model { background: rgba(59,130,246,0.15); color: var(--purple); }
405
+ .rb-space { background: rgba(16,185,129,0.15); color: var(--success); }
406
+
407
+ .repos-right { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
408
+ .detail-hdr {
409
+ padding: 12px 16px;
410
+ border-bottom: 1px solid var(--border);
411
+ display: flex;
412
+ align-items: center;
413
+ justify-content: space-between;
414
+ background: rgba(255,255,255,0.02);
415
+ }
416
+ .detail-hdr-title { font-size: 21px; font-weight: 700; letter-spacing: 0.1px; }
417
+ .detail-hdr-link {
418
+ display: inline-flex;
419
+ align-items: center;
420
+ gap: 6px;
421
+ font-size: 12px;
422
+ color: #9bc2ff;
423
+ background: rgba(37,99,235,0.12);
424
+ border: 1px solid rgba(59,130,246,0.35);
425
+ border-radius: 8px;
426
+ cursor: pointer;
427
+ padding: 5px 10px;
428
+ transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
429
+ animation: hfBtnPulse 2.2s ease-in-out infinite;
430
+ }
431
+ .detail-hdr-link:hover {
432
+ background: rgba(59,130,246,0.2);
433
+ border-color: rgba(125,176,255,0.62);
434
+ color: #d5e6ff;
435
+ transform: translateY(-1px);
436
+ text-decoration: none;
437
+ }
438
+ .detail-hdr-link:active { transform: translateY(0) scale(0.98); }
439
+ .detail-hdr-link svg { transition: transform 0.16s ease; }
440
+ .detail-hdr-link:hover svg { transform: translateX(1px) translateY(-1px); }
441
+ @keyframes hfBtnPulse {
442
+ 0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.0); }
443
+ 50% { box-shadow: 0 0 0 6px rgba(59,130,246,0.07); }
444
+ }
445
+ .detail-tabs {
446
+ display: flex;
447
+ border-bottom: 1px solid var(--border);
448
+ padding: 0 14px;
449
+ background: rgba(255,255,255,0.015);
450
+ }
451
+ .detail-tab {
452
+ padding: 8px 14px;
453
+ font-size: 13px; font-weight: 500;
454
+ color: var(--sub);
455
+ border: none; background: none; cursor: pointer;
456
+ border-bottom: 2px solid transparent;
457
+ margin-bottom: -1px;
458
+ transition: color 0.15s;
459
+ }
460
+ .detail-tab:hover { color: var(--text); }
461
+ .detail-tab.active { color: var(--text); border-bottom-color: var(--accent); }
462
+ .detail-body { flex: 1; overflow-y: auto; background: rgba(7,11,26,0.5); }
463
+ .detail-panel { display: none; }
464
+ .detail-panel.active { display: block; }
465
+
466
+ .file-list { padding: 0; }
467
+ .file-head {
468
+ display: grid;
469
+ grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) 120px 80px 42px;
470
+ gap: 10px;
471
+ padding: 8px 16px;
472
+ border-top: 1px solid rgba(255,255,255,0.03);
473
+ border-bottom: 1px solid rgba(255,255,255,0.06);
474
+ color: var(--dim);
475
+ font-size: 11px;
476
+ letter-spacing: 0.35px;
477
+ text-transform: uppercase;
478
+ background: rgba(255,255,255,0.015);
479
+ position: sticky;
480
+ top: 0;
481
+ z-index: 1;
482
+ }
483
+ .file-item {
484
+ display: grid;
485
+ grid-template-columns: minmax(220px, 1.4fr) minmax(180px, 1fr) 120px 80px 42px;
486
+ gap: 10px;
487
+ align-items: center;
488
+ padding: 8px 16px;
489
+ font-size: 13px;
490
+ color: var(--sub);
491
+ border-top: 1px solid rgba(255,255,255,0.03);
492
+ }
493
+ .file-item:hover { background: rgba(255,255,255,0.03); }
494
+ .file-name-wrap { display: flex; align-items: center; gap: 9px; min-width: 0; }
495
+ .file-item svg { color: var(--dim); flex-shrink: 0; }
496
+ .file-name {
497
+ color: var(--text);
498
+ white-space: nowrap;
499
+ overflow: hidden;
500
+ text-overflow: ellipsis;
501
+ }
502
+ .file-commit {
503
+ white-space: nowrap;
504
+ overflow: hidden;
505
+ text-overflow: ellipsis;
506
+ color: var(--sub);
507
+ font-size: 12px;
508
+ }
509
+ .file-updated,
510
+ .file-size { font-size: 11px; color: var(--dim); text-align: right; }
511
+ .file-action {
512
+ display: flex;
513
+ justify-content: flex-end;
514
+ }
515
+ .file-dl-btn {
516
+ width: 24px;
517
+ height: 24px;
518
+ border-radius: 6px;
519
+ border: 1px solid rgba(96, 165, 250, 0.35);
520
+ background: rgba(30, 58, 138, 0.2);
521
+ color: #cfe3ff;
522
+ cursor: pointer;
523
+ display: inline-flex;
524
+ align-items: center;
525
+ justify-content: center;
526
+ transition: all 0.15s;
527
+ padding: 0;
528
+ }
529
+ .file-dl-btn:hover {
530
+ border-color: rgba(147, 197, 253, 0.7);
531
+ background: rgba(59, 130, 246, 0.35);
532
+ color: #f8fbff;
533
+ transform: translateY(-1px);
534
+ }
535
+ .file-dl-btn svg {
536
+ color: currentColor;
537
+ }
538
+
539
+ .repo-files-shell {
540
+ display: flex;
541
+ flex-direction: column;
542
+ min-height: 0;
543
+ height: 100%;
544
+ }
545
+ .repo-files-toolbar {
546
+ display: flex;
547
+ align-items: center;
548
+ gap: 8px;
549
+ padding: 10px 12px;
550
+ border-bottom: 1px solid rgba(147, 197, 253, 0.16);
551
+ background:
552
+ linear-gradient(180deg, rgba(23, 37, 84, 0.28), rgba(15, 23, 42, 0.16)),
553
+ rgba(12, 20, 44, 0.35);
554
+ backdrop-filter: blur(6px);
555
+ }
556
+ .repo-tool-btn {
557
+ height: 30px;
558
+ padding: 0 10px;
559
+ border-radius: 8px;
560
+ border: 1px solid rgba(148, 163, 184, 0.35);
561
+ background: rgba(15, 23, 42, 0.55);
562
+ color: #d7e5ff;
563
+ font-size: 12px;
564
+ font-weight: 600;
565
+ cursor: pointer;
566
+ transition: all 0.16s ease;
567
+ display: inline-flex;
568
+ align-items: center;
569
+ gap: 6px;
570
+ }
571
+ .repo-tool-btn:hover {
572
+ border-color: rgba(96, 165, 250, 0.62);
573
+ background: rgba(30, 64, 175, 0.24);
574
+ color: #edf4ff;
575
+ transform: translateY(-1px);
576
+ }
577
+ .repo-tool-btn:disabled {
578
+ opacity: 0.45;
579
+ cursor: not-allowed;
580
+ transform: none;
581
+ }
582
+ .repo-breadcrumb {
583
+ flex: 1;
584
+ min-width: 0;
585
+ display: flex;
586
+ align-items: center;
587
+ gap: 4px;
588
+ overflow-x: auto;
589
+ white-space: nowrap;
590
+ scrollbar-width: thin;
591
+ padding-bottom: 1px;
592
+ }
593
+ .repo-crumb {
594
+ border: 1px solid rgba(59, 130, 246, 0.28);
595
+ background: rgba(30, 58, 138, 0.2);
596
+ color: #dbeafe;
597
+ border-radius: 999px;
598
+ height: 24px;
599
+ padding: 0 10px;
600
+ font-size: 11px;
601
+ font-weight: 600;
602
+ cursor: pointer;
603
+ transition: all 0.15s;
604
+ }
605
+ .repo-crumb:hover {
606
+ background: rgba(59, 130, 246, 0.28);
607
+ border-color: rgba(147, 197, 253, 0.56);
608
+ }
609
+ .repo-crumb.current {
610
+ cursor: default;
611
+ background: rgba(59, 130, 246, 0.35);
612
+ border-color: rgba(147, 197, 253, 0.68);
613
+ color: #f8fbff;
614
+ }
615
+ .repo-cache-pill {
616
+ border: 1px solid rgba(30, 64, 175, 0.45);
617
+ background: rgba(30, 64, 175, 0.16);
618
+ color: #bfdbfe;
619
+ border-radius: 999px;
620
+ padding: 3px 8px;
621
+ font-size: 10px;
622
+ font-weight: 700;
623
+ letter-spacing: 0.05em;
624
+ text-transform: uppercase;
625
+ flex-shrink: 0;
626
+ }
627
+ .repo-tree-pane {
628
+ overflow: auto;
629
+ min-height: 0;
630
+ flex: 1;
631
+ }
632
+ .file-item.repo-entry {
633
+ cursor: pointer;
634
+ transition: background 0.14s ease, border-color 0.14s ease;
635
+ }
636
+ .file-item.repo-entry:hover {
637
+ background: rgba(59, 130, 246, 0.08);
638
+ }
639
+ .file-item.repo-entry.selected {
640
+ background: rgba(37, 99, 235, 0.2);
641
+ border-left: 2px solid rgba(147, 197, 253, 0.85);
642
+ padding-left: 14px;
643
+ }
644
+ .repo-dblclick-hint {
645
+ margin-top: 8px;
646
+ color: #7da6dd;
647
+ font-size: 11px;
648
+ padding: 0 2px;
649
+ }
650
+
651
+ .commit-list { padding: 2px 0; }
652
+ .commit-item {
653
+ padding: 9px 16px;
654
+ border-top: 1px solid rgba(255,255,255,0.03);
655
+ }
656
+ .commit-item:hover { background: rgba(255,255,255,0.03); }
657
+ .commit-msg {
658
+ font-size: 13px; color: var(--text); margin-bottom: 4px;
659
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
660
+ }
661
+ .commit-meta { font-size: 11px; color: var(--dim); display: flex; gap: 8px; }
662
+ .commit-hash { font-family: monospace; color: var(--accent); }
663
+
664
+ /* DOWNLOADS */
665
+ .dl-ad-wrap {
666
+ position: relative;
667
+ border-radius: 16px;
668
+ border: 1px solid rgba(130,145,214,0.26);
669
+ min-height: 280px;
670
+ margin-bottom: 14px;
671
+ overflow: hidden;
672
+ background: #0a1026;
673
+ box-shadow:
674
+ inset 0 1px 0 rgba(200,220,255,0.05),
675
+ 0 14px 30px rgba(4, 10, 28, 0.44);
676
+ }
677
+ .dl-ad-bg {
678
+ position: absolute;
679
+ inset: 0;
680
+ background-size: contain;
681
+ background-repeat: no-repeat;
682
+ background-position: 58% center;
683
+ filter: saturate(1.04) contrast(1.02);
684
+ transform: scale(1);
685
+ transition: background-image 0.35s ease;
686
+ }
687
+ .dl-ad-bg::after {
688
+ content: '';
689
+ position: absolute;
690
+ inset: 0;
691
+ background:
692
+ linear-gradient(90deg, rgba(8, 14, 34, 0.92) 0%, rgba(8, 14, 34, 0.74) 42%, rgba(8, 14, 34, 0.48) 65%, rgba(8, 14, 34, 0.8) 100%),
693
+ radial-gradient(500px 190px at 14% 8%, rgba(80, 130, 255, 0.23), transparent 62%);
694
+ }
695
+ .dl-ad-content {
696
+ position: relative;
697
+ z-index: 1;
698
+ display: flex;
699
+ flex-direction: column;
700
+ gap: 9px;
701
+ padding: 24px 24px 24px 58px;
702
+ max-width: 56%;
703
+ }
704
+ .dl-ad-kicker {
705
+ color: #9fbcff;
706
+ font-size: 11px;
707
+ font-weight: 700;
708
+ letter-spacing: 0.9px;
709
+ text-transform: uppercase;
710
+ }
711
+ .dl-ad-title {
712
+ margin: 0;
713
+ color: #ecf1ff;
714
+ font-size: clamp(24px, 3vw, 37px);
715
+ line-height: 1.1;
716
+ font-weight: 800;
717
+ }
718
+ .dl-ad-desc {
719
+ margin: 0;
720
+ color: #c9d4f1;
721
+ font-size: 13px;
722
+ line-height: 1.55;
723
+ max-width: 720px;
724
+ }
725
+ .dl-ad-actions {
726
+ margin-top: 4px;
727
+ display: flex;
728
+ gap: 8px;
729
+ flex-wrap: wrap;
730
+ }
731
+ .dl-ad-btn {
732
+ border: 1px solid rgba(130,160,255,0.45);
733
+ background: rgba(72, 125, 255, 0.2);
734
+ color: #dcebff;
735
+ border-radius: 10px;
736
+ height: 36px;
737
+ padding: 0 14px;
738
+ font-size: 12px;
739
+ font-weight: 700;
740
+ cursor: pointer;
741
+ transition: all 0.15s;
742
+ }
743
+ .dl-ad-btn:hover {
744
+ transform: translateY(-1px);
745
+ background: rgba(90, 141, 255, 0.3);
746
+ border-color: rgba(153, 184, 255, 0.78);
747
+ }
748
+ .dl-ad-btn.ghost {
749
+ background: rgba(0, 0, 0, 0.24);
750
+ border-color: rgba(200, 212, 242, 0.3);
751
+ color: #d6ddf5;
752
+ }
753
+ .dl-ad-btn.os {
754
+ min-width: 130px;
755
+ justify-content: center;
756
+ display: inline-flex;
757
+ align-items: center;
758
+ gap: 6px;
759
+ background: rgba(8, 15, 38, 0.62);
760
+ border-color: rgba(168, 186, 236, 0.4);
761
+ color: #dce6ff;
762
+ }
763
+ .dl-ad-btn.os:hover {
764
+ background: rgba(22, 36, 79, 0.85);
765
+ }
766
+ .dl-ad-btn.os.active {
767
+ background: rgba(72, 125, 255, 0.32);
768
+ border-color: rgba(153, 184, 255, 0.88);
769
+ color: #f2f7ff;
770
+ }
771
+ .dl-ad-arrow {
772
+ position: absolute;
773
+ top: 50%;
774
+ transform: translateY(-50%);
775
+ width: 34px;
776
+ height: 34px;
777
+ border-radius: 999px;
778
+ border: 1px solid rgba(180, 198, 239, 0.4);
779
+ background: rgba(12, 20, 46, 0.8);
780
+ color: #dde6ff;
781
+ display: flex;
782
+ align-items: center;
783
+ justify-content: center;
784
+ cursor: pointer;
785
+ z-index: 2;
786
+ }
787
+ .dl-ad-arrow:hover { background: rgba(22, 33, 72, 0.96); }
788
+ .dl-ad-arrow.prev { left: 12px; }
789
+ .dl-ad-arrow.next { right: 12px; }
790
+ .dl-ad-dots {
791
+ position: absolute;
792
+ left: 0;
793
+ right: 0;
794
+ bottom: 10px;
795
+ display: flex;
796
+ justify-content: center;
797
+ gap: 7px;
798
+ z-index: 2;
799
+ }
800
+ .dl-ad-dot {
801
+ width: 7px;
802
+ height: 7px;
803
+ border-radius: 50%;
804
+ border: 0;
805
+ background: rgba(225, 234, 255, 0.38);
806
+ cursor: pointer;
807
+ padding: 0;
808
+ }
809
+ .dl-ad-dot.active {
810
+ width: 20px;
811
+ border-radius: 999px;
812
+ background: rgba(219, 231, 255, 0.95);
813
+ }
814
+
815
+ .dl-channel-grid {
816
+ display: grid;
817
+ grid-template-columns: repeat(4, minmax(0, 1fr));
818
+ gap: 10px;
819
+ margin-bottom: 20px;
820
+ }
821
+ .dl-channel {
822
+ display: flex;
823
+ align-items: center;
824
+ justify-content: center;
825
+ gap: 8px;
826
+ min-height: 42px;
827
+ border: 1px solid var(--border);
828
+ border-radius: 10px;
829
+ background: rgba(15, 23, 42, 0.52);
830
+ color: var(--sub);
831
+ font-size: 13px;
832
+ font-weight: 700;
833
+ cursor: pointer;
834
+ transition: all 0.15s;
835
+ }
836
+ .dl-channel:hover {
837
+ border-color: var(--muted);
838
+ color: var(--text);
839
+ transform: translateY(-1px);
840
+ }
841
+ .dl-channel.active {
842
+ background: linear-gradient(180deg, rgba(59, 130, 246, 0.34), rgba(59, 130, 246, 0.22));
843
+ border-color: rgba(147, 197, 253, 0.85);
844
+ color: #f8fbff;
845
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
846
+ }
847
+ .dl-toolbar {
848
+ display: flex; align-items: center; gap: 6px;
849
+ margin-bottom: 20px;
850
+ flex-wrap: wrap;
851
+ }
852
+ .os-chip {
853
+ display: flex; align-items: center; gap: 5px;
854
+ padding: 5px 12px;
855
+ border-radius: 6px;
856
+ border: 1px solid var(--border);
857
+ background: transparent;
858
+ color: var(--sub);
859
+ font-size: 12px; font-weight: 500;
860
+ cursor: pointer;
861
+ transition: all 0.15s;
862
+ }
863
+ .os-chip:hover { border-color: var(--muted); color: var(--text); }
864
+ .os-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
865
+ .os-chip-count {
866
+ display: inline-flex;
867
+ align-items: center;
868
+ justify-content: center;
869
+ min-width: 18px;
870
+ height: 18px;
871
+ padding: 0 6px;
872
+ border-radius: 999px;
873
+ background: rgba(255,255,255,0.1);
874
+ color: inherit;
875
+ font-size: 11px;
876
+ font-weight: 700;
877
+ line-height: 1;
878
+ }
879
+
880
+ .dl-grid {
881
+ display: grid;
882
+ grid-template-columns: repeat(4, minmax(0, 1fr));
883
+ gap: 12px;
884
+ position: relative;
885
+ isolation: isolate;
886
+ align-items: start;
887
+ }
888
+ .dl-grid::before {
889
+ content: '';
890
+ position: absolute;
891
+ inset: -12px -8px;
892
+ border-radius: 18px;
893
+ background:
894
+ radial-gradient(560px 180px at 16% 8%, rgba(79,130,255,0.13), transparent 64%),
895
+ radial-gradient(620px 220px at 88% 20%, rgba(142,92,255,0.1), transparent 67%);
896
+ filter: blur(6px);
897
+ opacity: 0.8;
898
+ pointer-events: none;
899
+ z-index: 0;
900
+ }
901
+
902
+ @media (max-width: 1080px) {
903
+ .dl-ad-content { max-width: 72%; padding-left: 54px; }
904
+ .dl-channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
905
+ .dl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
906
+ }
907
+ @media (max-width: 860px) {
908
+ .dl-ad-wrap { min-height: 260px; }
909
+ .dl-ad-content { max-width: calc(100% - 88px); padding: 20px 18px 20px 52px; }
910
+ .dl-ad-bg { background-position: 66% center; }
911
+ .dl-channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
912
+ .dl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
913
+ }
914
+ @media (max-width: 560px) {
915
+ .dl-ad-wrap { min-height: 240px; }
916
+ .dl-ad-title { font-size: clamp(21px, 7vw, 28px); }
917
+ .dl-ad-desc { font-size: 12px; }
918
+ .dl-ad-content { max-width: calc(100% - 30px); }
919
+ .dl-ad-bg { background-position: center; }
920
+ .dl-ad-arrow { display: none; }
921
+ .dl-channel-grid { grid-template-columns: 1fr; }
922
+ .dl-grid { grid-template-columns: 1fr; }
923
+ }
924
+ .dl-card {
925
+ background: var(--card);
926
+ border: 1px solid var(--border);
927
+ border-radius: 10px;
928
+ padding: 18px 20px;
929
+ display: flex;
930
+ flex-direction: column;
931
+ gap: 10px;
932
+ transition: border-color 0.15s;
933
+ }
934
+ .dl-card:hover { border-color: var(--muted); }
935
+ .dl-card-header { display: flex; align-items: flex-start; gap: 12px; }
936
+ .dl-card-icon {
937
+ width: 36px; height: 36px;
938
+ border-radius: 8px;
939
+ background: rgba(59,130,246,0.15);
940
+ display: flex; align-items: center; justify-content: center;
941
+ color: var(--accent);
942
+ flex-shrink: 0;
943
+ }
944
+ .dl-card-icon.linux { background: rgba(245,158,11,0.15); color: var(--warn); }
945
+ .dl-card-icon.mac { background: rgba(16,185,129,0.15); color: var(--success); }
946
+ .dl-card-icon.apk { background: rgba(14,165,233,0.15); color: #38bdf8; }
947
+ .dl-card-name { font-size: 14px; font-weight: 600; line-height: 1.3; }
948
+ .dl-card-meta { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; }
949
+ .dl-tag {
950
+ font-size: 11px; padding: 2px 7px;
951
+ border-radius: 4px; font-weight: 500;
952
+ }
953
+ .dl-tag.version { background: rgba(59,130,246,0.15); color: var(--accent); }
954
+ .dl-tag.size { background: rgba(255,255,255,0.06); color: var(--sub); }
955
+ .dl-tag.date { background: rgba(255,255,255,0.06); color: var(--sub); }
956
+ .dl-card-notes { font-size: 12px; color: var(--dim); line-height: 1.5; }
957
+ .dl-card-footer { display: flex; gap: 7px; align-items: center; margin-top: 4px; }
958
+ .dl-btn {
959
+ flex: 1; padding: 7px 14px;
960
+ border-radius: 6px; border: none;
961
+ font-size: 13px; font-weight: 600;
962
+ cursor: pointer;
963
+ display: flex; align-items: center; justify-content: center; gap: 6px;
964
+ transition: all 0.15s;
965
+ }
966
+ .dl-btn.primary { background: var(--accent); color: #fff; }
967
+ .dl-btn.primary:hover { background: var(--accent-d); }
968
+ .dl-btn.primary:disabled { background: var(--muted); cursor: not-allowed; opacity: 0.7; }
969
+ .dl-btn.installed {
970
+ background: rgba(16,185,129,0.1); color: var(--success);
971
+ border: 1px solid rgba(16,185,129,0.25); cursor: default;
972
+ }
973
+ .dl-btn.open-btn {
974
+ background: transparent; color: var(--sub);
975
+ border: 1px solid var(--border); flex: none; padding: 7px 10px;
976
+ }
977
+ .dl-btn.open-btn:hover { color: var(--text); border-color: var(--muted); }
978
+ .dl-btn.update {
979
+ background: rgba(251,146,60,0.12); color: #fb923c;
980
+ border: 1px solid rgba(251,146,60,0.35); flex: 1;
981
+ }
982
+ .dl-btn.update:hover { background: rgba(251,146,60,0.22); border-color: rgba(251,146,60,0.6); }
983
+ .dl-tag.update-badge {
984
+ background: rgba(251,146,60,0.15); color: #fb923c;
985
+ border: 1px solid rgba(251,146,60,0.3); border-radius: 4px;
986
+ font-size: 10px; font-weight: 700; padding: 1px 6px; letter-spacing: 0.4px;
987
+ }
988
+
989
+ /* APP UPDATE TOAST */
990
+ #app-update-toast {
991
+ position: fixed; top: 54px; right: 18px; z-index: 9999;
992
+ background: var(--card); border: 1px solid rgba(251,146,60,0.45);
993
+ border-radius: 12px; padding: 14px 16px;
994
+ min-width: 280px; max-width: 340px;
995
+ box-shadow: 0 8px 32px rgba(0,0,0,0.5);
996
+ display: flex; flex-direction: column; gap: 8px;
997
+ animation: toastIn 0.22s ease;
998
+ }
999
+ #app-update-toast.hidden { display: none; }
1000
+ .toast-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
1001
+ .toast-head-label { display: flex; align-items: center; gap: 7px; color: #fb923c; font-weight: 700; font-size: 13px; }
1002
+ .toast-close-btn {
1003
+ background: none; border: none; color: var(--dim); cursor: pointer;
1004
+ font-size: 14px; line-height: 1; padding: 2px 4px; border-radius: 4px; font-family: inherit;
1005
+ }
1006
+ .toast-close-btn:hover { color: var(--text); background: var(--border); }
1007
+ .toast-ver { font-size: 11px; color: var(--dim); }
1008
+ .toast-notes { font-size: 12px; color: var(--sub); line-height: 1.5; }
1009
+ .toast-actions { display: flex; gap: 8px; margin-top: 2px; }
1010
+ .toast-act-btn {
1011
+ flex: 1; padding: 7px 12px; border-radius: 7px;
1012
+ font-size: 12px; font-weight: 600; cursor: pointer;
1013
+ border: none; font-family: inherit; transition: all 0.15s;
1014
+ }
1015
+ .toast-act-btn.primary { background: #fb923c; color: #000; }
1016
+ .toast-act-btn.primary:hover { background: #f97316; }
1017
+ .toast-act-btn.primary:disabled { opacity: 0.6; cursor: not-allowed; }
1018
+ .toast-act-btn.secondary {
1019
+ background: transparent; border: 1px solid var(--border); color: var(--sub);
1020
+ }
1021
+ .toast-act-btn.secondary:hover { color: var(--text); border-color: var(--muted); }
1022
+ @keyframes toastIn {
1023
+ from { opacity: 0; transform: translateY(-10px) scale(0.96); }
1024
+ to { opacity: 1; transform: translateY(0) scale(1); }
1025
+ }
1026
+ .prog-wrap {
1027
+ height: 4px; background: var(--border);
1028
+ border-radius: 2px; overflow: hidden;
1029
+ }
1030
+ .prog-bar {
1031
+ height: 100%; background: var(--accent);
1032
+ border-radius: 2px; width: 0%;
1033
+ transition: width 0.2s;
1034
+ }
1035
+ .npm-log-line {
1036
+ font-size: 11px; color: var(--dim); padding: 4px 2px 0;
1037
+ white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
1038
+ }
1039
+
1040
+ /* NPM PACKAGES */
1041
+ .npm-topbar {
1042
+ display: flex;
1043
+ align-items: center;
1044
+ gap: 12px;
1045
+ margin-bottom: 12px;
1046
+ }
1047
+ .npm-search-input {
1048
+ flex: 1;
1049
+ background: var(--card);
1050
+ border: 1px solid var(--border);
1051
+ border-radius: 10px;
1052
+ padding: 10px 14px;
1053
+ color: var(--text);
1054
+ font-size: 14px;
1055
+ font-family: inherit;
1056
+ outline: none;
1057
+ transition: border-color 0.15s, box-shadow 0.15s;
1058
+ }
1059
+ .npm-search-input:focus {
1060
+ border-color: rgba(96, 165, 250, 0.75);
1061
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
1062
+ }
1063
+ .npm-inline-stats {
1064
+ display: flex;
1065
+ gap: 8px;
1066
+ flex-shrink: 0;
1067
+ }
1068
+ .npm-inline-stat {
1069
+ min-width: 110px;
1070
+ padding: 8px 10px;
1071
+ border-radius: 10px;
1072
+ background: rgba(22, 35, 64, 0.75);
1073
+ border: 1px solid rgba(148, 163, 184, 0.26);
1074
+ text-align: right;
1075
+ }
1076
+ .npm-inline-stat .label {
1077
+ display: block;
1078
+ color: var(--dim);
1079
+ font-size: 10px;
1080
+ text-transform: uppercase;
1081
+ letter-spacing: 0.06em;
1082
+ margin-bottom: 2px;
1083
+ }
1084
+ .npm-inline-stat .value {
1085
+ color: #60a5fa;
1086
+ font-size: 22px;
1087
+ font-weight: 800;
1088
+ line-height: 1;
1089
+ }
1090
+ .npm-layout {
1091
+ display: grid;
1092
+ grid-template-columns: minmax(260px, 0.9fr) minmax(420px, 1.6fr);
1093
+ gap: 12px;
1094
+ min-height: calc(100vh - 260px);
1095
+ }
1096
+ .npm-panel {
1097
+ border: 1px solid rgba(148, 163, 184, 0.28);
1098
+ border-radius: 12px;
1099
+ background: rgba(15, 23, 42, 0.7);
1100
+ overflow: hidden;
1101
+ min-height: 0;
1102
+ display: flex;
1103
+ flex-direction: column;
1104
+ }
1105
+ .npm-panel-head {
1106
+ padding: 9px 12px;
1107
+ font-size: 11px;
1108
+ letter-spacing: 0.07em;
1109
+ text-transform: uppercase;
1110
+ color: #93c5fd;
1111
+ border-bottom: 1px solid rgba(148, 163, 184, 0.2);
1112
+ background: rgba(20, 31, 57, 0.85);
1113
+ }
1114
+ .npm-list {
1115
+ flex: 1;
1116
+ overflow-y: auto;
1117
+ }
1118
+ .npm-list-item {
1119
+ width: 100%;
1120
+ border: none;
1121
+ border-bottom: 1px solid rgba(148, 163, 184, 0.14);
1122
+ background: transparent;
1123
+ color: var(--text);
1124
+ display: flex;
1125
+ align-items: center;
1126
+ justify-content: space-between;
1127
+ gap: 10px;
1128
+ text-align: left;
1129
+ padding: 10px 12px;
1130
+ cursor: pointer;
1131
+ transition: background 0.12s;
1132
+ }
1133
+ .npm-list-item:hover { background: rgba(59, 130, 246, 0.08); }
1134
+ .npm-list-item.active {
1135
+ background: rgba(59, 130, 246, 0.18);
1136
+ box-shadow: inset 2px 0 0 #60a5fa;
1137
+ }
1138
+ .npm-list-name {
1139
+ font-size: 13px;
1140
+ font-weight: 700;
1141
+ line-height: 1.3;
1142
+ word-break: break-all;
1143
+ }
1144
+ .npm-list-meta {
1145
+ margin-top: 2px;
1146
+ color: var(--dim);
1147
+ font-size: 11px;
1148
+ }
1149
+ .npm-list-dl {
1150
+ color: #93c5fd;
1151
+ font-size: 11px;
1152
+ font-weight: 700;
1153
+ flex-shrink: 0;
1154
+ }
1155
+ .npm-detail {
1156
+ flex: 1;
1157
+ overflow-y: auto;
1158
+ padding: 14px;
1159
+ }
1160
+ .npm-detail-title {
1161
+ font-size: 26px;
1162
+ line-height: 1.15;
1163
+ font-weight: 800;
1164
+ color: #e5edff;
1165
+ word-break: break-all;
1166
+ margin-bottom: 6px;
1167
+ }
1168
+ .npm-badges {
1169
+ display: flex;
1170
+ flex-wrap: wrap;
1171
+ gap: 6px;
1172
+ margin-bottom: 10px;
1173
+ }
1174
+ .npm-badge {
1175
+ font-size: 11px;
1176
+ border-radius: 999px;
1177
+ padding: 3px 9px;
1178
+ border: 1px solid rgba(96, 165, 250, 0.36);
1179
+ background: rgba(30, 58, 138, 0.24);
1180
+ color: #bfdbfe;
1181
+ font-weight: 700;
1182
+ }
1183
+ .npm-detail-desc {
1184
+ color: var(--sub);
1185
+ font-size: 13px;
1186
+ line-height: 1.6;
1187
+ margin-bottom: 12px;
1188
+ }
1189
+ .npm-actions {
1190
+ display: flex;
1191
+ gap: 8px;
1192
+ flex-wrap: wrap;
1193
+ margin-bottom: 14px;
1194
+ }
1195
+ .npm-open-btn {
1196
+ display: inline-flex;
1197
+ align-items: center;
1198
+ gap: 6px;
1199
+ padding: 7px 12px;
1200
+ border-radius: 8px;
1201
+ border: 1px solid rgba(148, 163, 184, 0.36);
1202
+ background: rgba(15, 23, 42, 0.5);
1203
+ color: #d6e6ff;
1204
+ font-size: 12px;
1205
+ font-weight: 600;
1206
+ font-family: inherit;
1207
+ cursor: pointer;
1208
+ transition: all 0.15s;
1209
+ }
1210
+ .npm-open-btn:hover {
1211
+ border-color: rgba(96, 165, 250, 0.7);
1212
+ color: #ffffff;
1213
+ background: rgba(37, 99, 235, 0.28);
1214
+ }
1215
+ .npm-kv-grid {
1216
+ display: grid;
1217
+ grid-template-columns: repeat(2, minmax(0, 1fr));
1218
+ gap: 8px;
1219
+ margin-bottom: 14px;
1220
+ }
1221
+ .npm-kv-card {
1222
+ border: 1px solid rgba(148, 163, 184, 0.22);
1223
+ border-radius: 10px;
1224
+ background: rgba(15, 23, 42, 0.45);
1225
+ padding: 8px 10px;
1226
+ }
1227
+ .npm-kv-label {
1228
+ color: var(--dim);
1229
+ font-size: 10px;
1230
+ text-transform: uppercase;
1231
+ letter-spacing: 0.06em;
1232
+ }
1233
+ .npm-kv-value {
1234
+ color: #dbeafe;
1235
+ font-size: 14px;
1236
+ font-weight: 700;
1237
+ margin-top: 3px;
1238
+ word-break: break-word;
1239
+ }
1240
+ .npm-section-title {
1241
+ margin-top: 4px;
1242
+ margin-bottom: 6px;
1243
+ color: #93c5fd;
1244
+ font-size: 11px;
1245
+ text-transform: uppercase;
1246
+ letter-spacing: 0.07em;
1247
+ font-weight: 700;
1248
+ }
1249
+ .npm-readme {
1250
+ border: 1px solid rgba(148, 163, 184, 0.2);
1251
+ border-radius: 10px;
1252
+ background: rgba(9, 14, 29, 0.8);
1253
+ color: #d4deee;
1254
+ padding: 10px;
1255
+ font-size: 12px;
1256
+ line-height: 1.55;
1257
+ max-height: 260px;
1258
+ overflow-y: auto;
1259
+ margin-bottom: 10px;
1260
+ }
1261
+ .npm-readme-preview h1,
1262
+ .npm-readme-preview h2,
1263
+ .npm-readme-preview h3,
1264
+ .npm-readme-preview h4,
1265
+ .npm-readme-preview h5,
1266
+ .npm-readme-preview h6 {
1267
+ color: #eef4ff;
1268
+ margin: 12px 0 8px;
1269
+ line-height: 1.3;
1270
+ position: relative;
1271
+ padding-right: 22px;
1272
+ }
1273
+ .npm-md-anchor {
1274
+ position: absolute;
1275
+ right: 0;
1276
+ top: 50%;
1277
+ transform: translateY(-50%);
1278
+ border: 1px solid rgba(148, 163, 184, 0.3);
1279
+ background: rgba(15, 23, 42, 0.5);
1280
+ color: #93c5fd;
1281
+ border-radius: 6px;
1282
+ width: 18px;
1283
+ height: 18px;
1284
+ font-size: 11px;
1285
+ line-height: 1;
1286
+ cursor: pointer;
1287
+ opacity: 0;
1288
+ transition: opacity 0.12s, background 0.12s, border-color 0.12s;
1289
+ display: inline-flex;
1290
+ align-items: center;
1291
+ justify-content: center;
1292
+ padding: 0;
1293
+ }
1294
+ .npm-readme-preview h1:hover .npm-md-anchor,
1295
+ .npm-readme-preview h2:hover .npm-md-anchor,
1296
+ .npm-readme-preview h3:hover .npm-md-anchor,
1297
+ .npm-readme-preview h4:hover .npm-md-anchor,
1298
+ .npm-readme-preview h5:hover .npm-md-anchor,
1299
+ .npm-readme-preview h6:hover .npm-md-anchor {
1300
+ opacity: 1;
1301
+ }
1302
+ .npm-md-anchor:hover {
1303
+ background: rgba(37, 99, 235, 0.35);
1304
+ border-color: rgba(147, 197, 253, 0.75);
1305
+ color: #eaf2ff;
1306
+ }
1307
+ .npm-readme-preview h1 { font-size: 20px; }
1308
+ .npm-readme-preview h2 { font-size: 17px; }
1309
+ .npm-readme-preview h3 { font-size: 15px; }
1310
+ .npm-readme-preview p {
1311
+ margin: 7px 0;
1312
+ color: #d4deee;
1313
+ white-space: normal;
1314
+ word-break: break-word;
1315
+ }
1316
+ .npm-readme-preview a {
1317
+ color: #93c5fd;
1318
+ text-decoration: underline;
1319
+ text-underline-offset: 2px;
1320
+ cursor: pointer;
1321
+ }
1322
+ .npm-readme-preview a:hover {
1323
+ color: #bfdbfe;
1324
+ }
1325
+ .npm-readme-preview ul,
1326
+ .npm-readme-preview ol {
1327
+ margin: 6px 0 10px 18px;
1328
+ color: #d4deee;
1329
+ }
1330
+ .npm-readme-preview li {
1331
+ margin: 3px 0;
1332
+ }
1333
+ .npm-readme-preview li.md-nested {
1334
+ list-style-position: outside;
1335
+ }
1336
+ .npm-readme-preview li.check-item {
1337
+ list-style: none;
1338
+ margin-left: -14px;
1339
+ display: flex;
1340
+ align-items: flex-start;
1341
+ gap: 7px;
1342
+ }
1343
+ .npm-readme-preview li.check-item input {
1344
+ margin-top: 2px;
1345
+ accent-color: #3b82f6;
1346
+ }
1347
+ .npm-readme-preview table {
1348
+ width: 100%;
1349
+ border-collapse: collapse;
1350
+ margin: 10px 0;
1351
+ border: 1px solid rgba(148, 163, 184, 0.25);
1352
+ border-radius: 8px;
1353
+ overflow: hidden;
1354
+ background: rgba(15, 23, 42, 0.38);
1355
+ }
1356
+ .npm-readme-preview thead th {
1357
+ background: rgba(30, 58, 138, 0.32);
1358
+ color: #dbeafe;
1359
+ font-size: 12px;
1360
+ text-align: left;
1361
+ border-bottom: 1px solid rgba(148, 163, 184, 0.22);
1362
+ padding: 7px 8px;
1363
+ }
1364
+ .npm-readme-preview tbody td {
1365
+ border-top: 1px solid rgba(148, 163, 184, 0.15);
1366
+ padding: 7px 8px;
1367
+ color: #d4deee;
1368
+ font-size: 12px;
1369
+ vertical-align: top;
1370
+ }
1371
+ .npm-readme-preview img {
1372
+ max-width: 100%;
1373
+ height: auto;
1374
+ display: block;
1375
+ margin: 10px auto;
1376
+ border-radius: 10px;
1377
+ border: 1px solid rgba(148, 163, 184, 0.22);
1378
+ background: rgba(2, 6, 23, 0.55);
1379
+ }
1380
+ .npm-md-missing-image {
1381
+ display: inline-block;
1382
+ margin: 3px 0;
1383
+ font-size: 11px;
1384
+ color: #94a3b8;
1385
+ padding: 2px 6px;
1386
+ border-radius: 6px;
1387
+ border: 1px dashed rgba(148, 163, 184, 0.38);
1388
+ background: rgba(15, 23, 42, 0.4);
1389
+ }
1390
+ .npm-readme-preview blockquote {
1391
+ margin: 10px 0;
1392
+ padding: 8px 10px;
1393
+ border-left: 3px solid rgba(96, 165, 250, 0.6);
1394
+ background: rgba(30, 58, 138, 0.2);
1395
+ color: #bfdbfe;
1396
+ border-radius: 0 8px 8px 0;
1397
+ }
1398
+ .npm-readme-preview pre {
1399
+ margin: 10px 0;
1400
+ border: 1px solid rgba(148, 163, 184, 0.24);
1401
+ border-radius: 8px;
1402
+ background: rgba(6, 10, 24, 0.9);
1403
+ color: #c7d8f8;
1404
+ padding: 10px;
1405
+ overflow: auto;
1406
+ line-height: 1.5;
1407
+ }
1408
+ .npm-readme-preview code {
1409
+ font-family: 'Cascadia Code', Consolas, 'Courier New', monospace;
1410
+ font-size: 11px;
1411
+ background: rgba(37, 99, 235, 0.2);
1412
+ border-radius: 5px;
1413
+ padding: 1px 5px;
1414
+ color: #dbeafe;
1415
+ }
1416
+ .npm-readme-preview pre code {
1417
+ background: transparent;
1418
+ padding: 0;
1419
+ color: inherit;
1420
+ }
1421
+ .npm-readme-preview hr {
1422
+ border: none;
1423
+ border-top: 1px solid rgba(148, 163, 184, 0.3);
1424
+ margin: 10px 0;
1425
+ }
1426
+ .npm-readme-empty {
1427
+ color: var(--dim);
1428
+ font-size: 12px;
1429
+ padding: 2px 0;
1430
+ }
1431
+ .npm-version-list {
1432
+ border: 1px solid rgba(148, 163, 184, 0.2);
1433
+ border-radius: 10px;
1434
+ overflow: hidden;
1435
+ background: rgba(9, 14, 29, 0.72);
1436
+ }
1437
+ .npm-version-row {
1438
+ display: grid;
1439
+ grid-template-columns: 1fr auto;
1440
+ gap: 8px;
1441
+ padding: 7px 10px;
1442
+ font-size: 12px;
1443
+ border-top: 1px solid rgba(148, 163, 184, 0.14);
1444
+ color: #dbeafe;
1445
+ }
1446
+ .npm-version-row:first-child { border-top: none; }
1447
+ .npm-version-date { color: var(--dim); font-size: 11px; }
1448
+
1449
+ @media (max-width: 980px) {
1450
+ .npm-topbar {
1451
+ flex-direction: column;
1452
+ align-items: stretch;
1453
+ }
1454
+ .npm-inline-stats {
1455
+ justify-content: flex-end;
1456
+ }
1457
+ .npm-layout {
1458
+ grid-template-columns: 1fr;
1459
+ }
1460
+ .npm-kv-grid {
1461
+ grid-template-columns: 1fr;
1462
+ }
1463
+ }
web/hub.js ADDED
@@ -0,0 +1,1396 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ 'use strict';
2
+
3
+ const hub = window.chahuadevHub;
4
+ let allRepos = [];
5
+ let repoFilter = 'all';
6
+ let osFilter = 'Windows';
7
+ let currentRepo = null;
8
+ let currentDetailTab = 'files';
9
+ let currentRepoPath = '';
10
+ let currentRepoEntries = [];
11
+ let isDownloading = {};
12
+ let dlFiles = [];
13
+ let dlApps = [];
14
+ let npmPackages = [];
15
+ let devMenuEnabled = false;
16
+ let dlSlideIndex = 0;
17
+ let dlSlideTimer = null;
18
+
19
+ const DOWNLOAD_SLIDE_IMAGE_BY_ID = {
20
+ 'chahuadev-hub': 'assets/download-slides/chahuadev-hub.png',
21
+ 'junk-sweeper': 'assets/download-slides/chahuadev-junk-sweeper.png',
22
+ 'emoji-cleaner': 'assets/download-slides/chahuadev-emoji-cleaner-app.png',
23
+ 'framework': 'assets/download-slides/chahuadev-framework.png'
24
+ };
25
+
26
+ let DOWNLOAD_AD_SLIDES = [
27
+ {
28
+ appId: 'chahuadev-hub',
29
+ kicker: 'Featured Build',
30
+ title: 'Chahuadev App Releases',
31
+ description: 'Official builds from catalog with quick install and update tracking.',
32
+ image: 'assets/download-slides/chahuadev-hub.png',
33
+ cta: 'View Release',
34
+ os: 'All'
35
+ }
36
+ ];
37
+
38
+ // -- Page navigation -----------------------------------------------------------
39
+ function switchPage(name) {
40
+ if (name === 'dev' && !devMenuEnabled) {
41
+ name = 'dashboard';
42
+ }
43
+ document.querySelectorAll('.page').forEach(p => p.classList.remove('active'));
44
+ document.querySelectorAll('.nav-tab').forEach(t => t.classList.remove('active'));
45
+ document.getElementById('page-' + name).classList.add('active');
46
+ document.getElementById('tab-' + name).classList.add('active');
47
+ if (name === 'repos' && allRepos.length === 0) loadRepos();
48
+ if (name === 'npm' && npmPackages.length === 0) loadNpmPackages();
49
+ if (name === 'downloads') restartDownloadSliderAuto();
50
+ else stopDownloadSliderAuto();
51
+ }
52
+
53
+ // -- Status bar ----------------------------------------------------------------
54
+ function setStatus(msg, state = 'ok') {
55
+ const dot = document.getElementById('status-dot');
56
+ const txt = document.getElementById('status-text');
57
+ dot.className = 'status-dot' +
58
+ (state === 'loading' ? ' loading' : state === 'error' ? ' error' : '');
59
+ txt.textContent = msg;
60
+ }
61
+
62
+ // -- Refresh -------------------------------------------------------------------
63
+ function doRefresh() {
64
+ const icon = document.getElementById('refresh-icon');
65
+ icon.classList.add('spin');
66
+ const active = document.querySelector('.page.active')?.id?.replace('page-', '');
67
+ const done = () => icon.classList.remove('spin');
68
+ if (active === 'dashboard') loadDashboard().finally(done);
69
+ else if (active === 'repos') { allRepos = []; loadRepos().finally(done); }
70
+ else if (active === 'downloads') loadDownloads().finally(done);
71
+ else if (active === 'npm') { npmPackages = []; loadNpmPackages().finally(done); }
72
+ else done();
73
+ }
74
+
75
+ function openDownloadsFolder() { hub.openDownloads(); }
76
+
77
+ // -- Helpers -------------------------------------------------------------------
78
+ function fmtSize(bytes) {
79
+ if (!bytes) return '';
80
+ if (bytes >= 1073741824) return (bytes / 1073741824).toFixed(2) + ' GB';
81
+ if (bytes >= 1048576) return (bytes / 1048576).toFixed(2) + ' MB';
82
+ return (bytes / 1024).toFixed(0) + ' KB';
83
+ }
84
+
85
+ function relTime(dateStr) {
86
+ if (!dateStr) return '';
87
+ const s = Math.floor((Date.now() - new Date(dateStr)) / 1000);
88
+ if (s < 60) return 'just now';
89
+ if (s < 3600) return Math.floor(s / 60) + 'm ago';
90
+ if (s < 86400) return Math.floor(s / 3600) + 'h ago';
91
+ if (s < 2592000) return Math.floor(s / 86400) + 'd ago';
92
+ return new Date(dateStr).toLocaleDateString();
93
+ }
94
+
95
+ function esc(str) {
96
+ return String(str ?? '')
97
+ .replace(/&/g, '&amp;').replace(/</g, '&lt;')
98
+ .replace(/>/g, '&gt;').replace(/"/g, '&quot;');
99
+ }
100
+
101
+ function _isWindowsFile(f) {
102
+ const p = String(f.path || '').toLowerCase();
103
+ const o = String(f.os || '').toLowerCase();
104
+ return o === 'windows' || p.endsWith('.exe') || p.endsWith('.msi') || p.includes('win');
105
+ }
106
+
107
+ function _isLinuxFile(f) {
108
+ const p = String(f.path || '').toLowerCase();
109
+ const o = String(f.os || '').toLowerCase();
110
+ return o === 'linux' || p.endsWith('.appimage') || p.endsWith('.deb') || p.endsWith('.rpm');
111
+ }
112
+
113
+ function _isMacFile(f) {
114
+ const p = String(f.path || '').toLowerCase();
115
+ const o = String(f.os || '').toLowerCase();
116
+ return o === 'macos' || o === 'mac' || p.endsWith('.dmg') || p.endsWith('.pkg');
117
+ }
118
+
119
+ function _isApkFile(f) {
120
+ const p = String(f.path || '').toLowerCase();
121
+ const o = String(f.os || '').toLowerCase();
122
+ return o === 'android' || o === 'apk' || p.endsWith('.apk') || p.endsWith('.aab') || p.endsWith('.xapk');
123
+ }
124
+
125
+ // -- Dashboard -----------------------------------------------------------------
126
+ async function loadDashboard() {
127
+ setStatus('Loading dashboard...', 'loading');
128
+ try {
129
+ const [data, npmList] = await Promise.allSettled([
130
+ hub.fetchDashboard(),
131
+ hub.fetchNpmPackages()
132
+ ]);
133
+ const s = (data.value?.stats) || {};
134
+ const _setText = (id, value) => {
135
+ const n = document.getElementById(id);
136
+ if (n) n.textContent = value;
137
+ };
138
+ _setText('dash-datasets', (s.datasets ?? 0).toLocaleString());
139
+ _setText('dash-models', (s.models ?? 0).toLocaleString());
140
+ _setText('dash-spaces', (s.spaces ?? 0).toLocaleString());
141
+ _setText('dash-downloads', (s.totalDownloads ?? 0).toLocaleString());
142
+
143
+ // Compute npm total downloads and pass to webview
144
+ const npmTotal = (npmList.value || []).reduce((sum, p) => sum + (p.downloads || 0), 0);
145
+ const webviewStats = { ...s, totalDownloads: npmTotal };
146
+ const iframe = document.getElementById('dash-webview');
147
+ if (iframe) {
148
+ const send = () => iframe.contentWindow?.postMessage({ type: 'stats', stats: webviewStats }, '*');
149
+ if (iframe.contentDocument?.readyState === 'complete') send();
150
+ else iframe.addEventListener('load', send, { once: true });
151
+ }
152
+ setStatus('Dashboard loaded', 'ok');
153
+ } catch (e) {
154
+ setStatus('Dashboard error', 'error');
155
+ }
156
+ }
157
+
158
+ // -- Repos ---------------------------------------------------------------------
159
+ async function loadRepos() {
160
+ setStatus('Loading repositories...', 'loading');
161
+ document.getElementById('repo-list').innerHTML =
162
+ `<div class="loading-box">
163
+ <svg class="spin" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
164
+ <path d="M21 12a9 9 0 11-6.219-8.56"/>
165
+ </svg>
166
+ Loading repos...
167
+ </div>`;
168
+ try {
169
+ const data = await hub.fetchAllRepos();
170
+ allRepos = [
171
+ ...(data.datasets || []).map(r => ({ ...r, _type: 'dataset' })),
172
+ ...(data.models || []).map(r => ({ ...r, _type: 'model' })),
173
+ ...(data.spaces || []).map(r => ({ ...r, _type: 'space' })),
174
+ ];
175
+ renderRepoList();
176
+ setStatus(`${allRepos.length} repositories`, 'ok');
177
+ } catch (e) {
178
+ document.getElementById('repo-list').innerHTML =
179
+ `<div class="error-box">
180
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
181
+ <circle cx="12" cy="12" r="10"/>
182
+ <line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/>
183
+ </svg>
184
+ ${esc(e.message)}
185
+ </div>`;
186
+ setStatus('Repos load failed', 'error');
187
+ }
188
+ }
189
+
190
+ function setRepoFilter(filter, btn) {
191
+ repoFilter = filter;
192
+ document.querySelectorAll('#repo-filters .filter-chip').forEach(c => c.classList.remove('active'));
193
+ btn.classList.add('active');
194
+ renderRepoList();
195
+ }
196
+
197
+ function renderRepoList() {
198
+ const list = repoFilter === 'all' ? allRepos : allRepos.filter(r => r._type === repoFilter);
199
+ const el = document.getElementById('repo-list');
200
+ if (list.length === 0) { el.innerHTML = '<div class="empty-box">No repositories found</div>'; return; }
201
+
202
+ const svgDataset = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
203
+ <ellipse cx="12" cy="5" rx="9" ry="3"/>
204
+ <path d="M21 12c0 1.66-4 3-9 3s-9-1.34-9-3"/><path d="M3 5v14c0 1.66 4 3 9 3s9-1.34 9-3V5"/>
205
+ </svg>`;
206
+ const svgModel = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
207
+ <path d="M12 2L2 7l10 5 10-5-10-5z"/>
208
+ <path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/>
209
+ </svg>`;
210
+ const svgSpace = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
211
+ <circle cx="12" cy="12" r="10"/><polygon points="10 8 16 12 10 16 10 8"/>
212
+ </svg>`;
213
+
214
+ el.innerHTML = list.map(r => {
215
+ const id = r.id || r.modelId || r._id || r.name || '?';
216
+ const name = id.split('/').pop();
217
+ const icon = r._type === 'dataset' ? svgDataset : r._type === 'model' ? svgModel : svgSpace;
218
+ const active = currentRepo?.id === id ? ' active' : '';
219
+ const idEsc = esc(id);
220
+ return `<div class="repo-item${active}" onclick="selectRepo('${idEsc}','${r._type}')">
221
+ <div class="repo-item-icon">${icon}</div>
222
+ <div class="repo-item-info">
223
+ <div class="repo-item-name">${esc(name)}</div>
224
+ </div>
225
+ <span class="repo-badge rb-${r._type}">${r._type}</span>
226
+ </div>`;
227
+ }).join('');
228
+ }
229
+
230
+ async function selectRepo(id, type) {
231
+ currentRepo = { id, type };
232
+ currentRepoPath = '';
233
+ currentRepoEntries = [];
234
+ document.querySelectorAll('.repo-item').forEach(el => {
235
+ const onclick = el.getAttribute('onclick') || '';
236
+ el.classList.toggle('active', onclick.includes(`'${id}'`));
237
+ });
238
+ document.getElementById('detail-repo-name').textContent = id.split('/').pop();
239
+ document.getElementById('detail-hf-link').style.display = 'flex';
240
+ document.getElementById('detail-tabs').style.display = 'flex';
241
+ if (currentDetailTab === 'files') loadRepoFiles(id, type);
242
+ else loadRepoCommits(id, type);
243
+ }
244
+
245
+ function openRepoOnHF() {
246
+ if (!currentRepo) return;
247
+ const { id, type } = currentRepo;
248
+ const base = type === 'dataset' ? 'datasets/' : type === 'space' ? 'spaces/' : '';
249
+ const normalizedPath = currentRepoPath ? '/' + currentRepoPath.split('/').map(encodeURIComponent).join('/') : '';
250
+ hub.openExternalUrl(`https://huggingface.co/${base}${id}/tree/main${normalizedPath}`);
251
+ }
252
+
253
+ function switchDetailTab(tab, btn) {
254
+ currentDetailTab = tab;
255
+ document.querySelectorAll('.detail-tab').forEach(t => t.classList.remove('active'));
256
+ btn.classList.add('active');
257
+ document.querySelectorAll('.detail-panel').forEach(p => p.classList.remove('active'));
258
+ document.getElementById('detail-' + tab).classList.add('active');
259
+ if (!currentRepo) return;
260
+ if (tab === 'files') loadRepoFiles(currentRepo.id, currentRepo.type, currentRepoPath);
261
+ else loadRepoCommits(currentRepo.id, currentRepo.type);
262
+ }
263
+
264
+ function normalizeRepoPathClient(input) {
265
+ const raw = String(input || '').replace(/\\/g, '/').trim();
266
+ if (!raw) return '';
267
+ return raw
268
+ .split('/')
269
+ .filter(Boolean)
270
+ .filter(seg => seg !== '.' && seg !== '..')
271
+ .join('/');
272
+ }
273
+
274
+ function makeRepoCrumbs(pathValue) {
275
+ const segments = normalizeRepoPathClient(pathValue).split('/').filter(Boolean);
276
+ const crumbs = [{ label: 'main', path: '' }];
277
+ let cursor = '';
278
+ for (const seg of segments) {
279
+ cursor = cursor ? `${cursor}/${seg}` : seg;
280
+ crumbs.push({ label: seg, path: cursor });
281
+ }
282
+ return crumbs;
283
+ }
284
+
285
+ function openRepoFileOnHF(repoPath, event) {
286
+ if (event && typeof event.stopPropagation === 'function') {
287
+ event.stopPropagation();
288
+ event.preventDefault();
289
+ }
290
+ if (!currentRepo || !repoPath) return;
291
+ const { id, type } = currentRepo;
292
+ const base = type === 'dataset' ? 'datasets/' : type === 'space' ? 'spaces/' : '';
293
+ const pathPart = repoPath.split('/').map(encodeURIComponent).join('/');
294
+ hub.openExternalUrl(`https://huggingface.co/${base}${id}/resolve/main/${pathPart}?download=true`);
295
+ }
296
+
297
+ function repoGoUp() {
298
+ if (!currentRepo) return;
299
+ const parts = normalizeRepoPathClient(currentRepoPath).split('/').filter(Boolean);
300
+ if (parts.length === 0) return;
301
+ parts.pop();
302
+ loadRepoFiles(currentRepo.id, currentRepo.type, parts.join('/'));
303
+ }
304
+
305
+ function repoGoTo(pathValue) {
306
+ if (!currentRepo) return;
307
+ loadRepoFiles(currentRepo.id, currentRepo.type, pathValue || '');
308
+ }
309
+
310
+ function refreshCurrentRepoFiles() {
311
+ if (!currentRepo) return;
312
+ loadRepoFiles(currentRepo.id, currentRepo.type, currentRepoPath, { force: true });
313
+ }
314
+
315
+ async function loadRepoFiles(id, type, repoPath = '', options = {}) {
316
+ currentRepoPath = normalizeRepoPathClient(repoPath);
317
+ const el = document.getElementById('detail-files');
318
+ el.innerHTML = `<div class="loading-box">
319
+ <svg class="spin" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
320
+ <path d="M21 12a9 9 0 11-6.219-8.56"/>
321
+ </svg>Loading files...</div>`;
322
+
323
+ try {
324
+ const files = await hub.fetchRepoTree(id, type, {
325
+ expand: true,
326
+ path: currentRepoPath,
327
+ force: !!options.force
328
+ });
329
+
330
+ const normalized = (Array.isArray(files) ? files : []).map(f => {
331
+ const itemPath = normalizeRepoPathClient(f.path || f.name || '');
332
+ const name = itemPath.split('/').pop() || itemPath || '(unnamed)';
333
+ const isDir = f.type === 'directory' || f.type === 'dir';
334
+ return {
335
+ ...f,
336
+ _path: itemPath,
337
+ _name: name,
338
+ _isDir: ['directory', 'dir', 'folder'].includes(String(f.type || '').toLowerCase()) || isDir,
339
+ };
340
+ });
341
+
342
+ normalized.sort((a, b) => {
343
+ if (a._isDir !== b._isDir) return a._isDir ? -1 : 1;
344
+ return a._name.localeCompare(b._name);
345
+ });
346
+
347
+ currentRepoEntries = normalized;
348
+ const crumbs = makeRepoCrumbs(currentRepoPath);
349
+
350
+ const folderSvg = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"/></svg>`;
351
+ const fileSvg = `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z"/><polyline points="13 2 13 9 20 9"/></svg>`;
352
+ const dlSvg = `<svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>`;
353
+
354
+ const rows = normalized.length
355
+ ? normalized.map(f => {
356
+ const commitTitle = f.lastCommit?.title || f.lastCommit?.message || '-';
357
+ const updated = relTime(f.lastCommit?.date || f.lastModified || '');
358
+ const downloadBtn = f._isDir
359
+ ? '<span></span>'
360
+ : `<button class="file-dl-btn" title="Download on Hugging Face" onclick="openRepoFileOnHF('${esc(f._path)}', event)">${dlSvg}</button>`;
361
+ const openHint = f._isDir ? 'Open folder' : 'File';
362
+ return `<div class="file-item repo-entry" data-path="${esc(f._path)}" data-kind="${f._isDir ? 'dir' : 'file'}" title="${openHint}">
363
+ <span class="file-name-wrap">${f._isDir ? folderSvg : fileSvg}
364
+ <span class="file-name">${esc(f._name)}</span></span>
365
+ <span class="file-commit">${esc(commitTitle)}</span>
366
+ <span class="file-updated">${esc(updated || '')}</span>
367
+ <span class="file-size">${fmtSize(f.size)}</span>
368
+ <span class="file-action">${downloadBtn}</span>
369
+ </div>`;
370
+ }).join('')
371
+ : `<div class="empty-box" style="padding:24px 10px">Folder is empty</div>`;
372
+
373
+ const crumbHtml = crumbs.map((c, idx) => {
374
+ const isCurrent = idx === crumbs.length - 1;
375
+ const cls = isCurrent ? 'repo-crumb current' : 'repo-crumb';
376
+ const click = isCurrent ? '' : `onclick="repoGoTo('${esc(c.path)}')"`;
377
+ return `<button class="${cls}" ${click}>${esc(c.label)}</button>`;
378
+ }).join('');
379
+
380
+ el.innerHTML = `
381
+ <div class="repo-files-shell">
382
+ <div class="repo-files-toolbar">
383
+ <button class="repo-tool-btn" onclick="repoGoUp()" ${currentRepoPath ? '' : 'disabled'}>Up</button>
384
+ <div class="repo-breadcrumb">${crumbHtml}</div>
385
+ <button class="repo-tool-btn" onclick="refreshCurrentRepoFiles()">Refresh</button>
386
+ <span class="repo-cache-pill">Smart Cache</span>
387
+ </div>
388
+ <div class="repo-tree-pane">
389
+ <div class="file-list">
390
+ <div class="file-head">
391
+ <span>Name</span>
392
+ <span>Commit</span>
393
+ <span style="text-align:right">Updated</span>
394
+ <span style="text-align:right">Size</span>
395
+ <span style="text-align:right"></span>
396
+ </div>
397
+ ${rows}
398
+ </div>
399
+ <div class="repo-dblclick-hint">Click folder to enter. Download button opens Hugging Face directly.</div>
400
+ </div>
401
+ </div>`;
402
+
403
+ el.querySelectorAll('.repo-entry').forEach((row) => {
404
+ row.addEventListener('click', () => {
405
+ const pathValue = row.getAttribute('data-path') || '';
406
+ const kind = row.getAttribute('data-kind');
407
+ if (kind === 'dir') {
408
+ loadRepoFiles(id, type, pathValue);
409
+ }
410
+ });
411
+ });
412
+ } catch (e) {
413
+ el.innerHTML = `<div class="error-box">Failed to load files: ${esc(e.message)}</div>`;
414
+ }
415
+ }
416
+
417
+ async function loadRepoCommits(id, type) {
418
+ const el = document.getElementById('detail-commits');
419
+ el.innerHTML = `<div class="loading-box">
420
+ <svg class="spin" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
421
+ <path d="M21 12a9 9 0 11-6.219-8.56"/>
422
+ </svg>Loading commits...</div>`;
423
+ try {
424
+ const commits = await hub.fetchRepoCommits(id, type);
425
+ if (!commits || commits.length === 0) {
426
+ el.innerHTML = '<div class="empty-box">No commits found</div>'; return;
427
+ }
428
+ el.innerHTML = '<div class="commit-list">' + commits.map(c => {
429
+ const msg = c.title || c.message || c.subject || '(no message)';
430
+ const hash = (c.id || c.sha || '').slice(0, 7);
431
+ const author = c.authors?.[0]?.name || c.author?.name || c.authorName || '';
432
+ const date = relTime(c.date || c.createdAt);
433
+ return `<div class="commit-item">
434
+ <div class="commit-msg">${esc(msg)}</div>
435
+ <div class="commit-meta">
436
+ ${hash ? `<span class="commit-hash">${esc(hash)}</span>` : ''}
437
+ ${author ? `<span>${esc(author)}</span>` : ''}
438
+ ${date ? `<span>${date}</span>` : ''}
439
+ </div>
440
+ </div>`;
441
+ }).join('') + '</div>';
442
+ } catch (e) {
443
+ el.innerHTML = `<div class="error-box">Failed to load commits: ${esc(e.message)}</div>`;
444
+ }
445
+ }
446
+
447
+ // -- Downloads -----------------------------------------------------------------
448
+ function buildDownloadSlidesFromCatalog(files) {
449
+ if (!Array.isArray(files) || files.length === 0) return DOWNLOAD_AD_SLIDES;
450
+
451
+ const appMap = new Map();
452
+ for (const f of files) {
453
+ const id = String(f.id || '').trim();
454
+ if (!id || appMap.has(id)) continue;
455
+ appMap.set(id, f);
456
+ }
457
+
458
+ const slides = [];
459
+ for (const [id, app] of appMap.entries()) {
460
+ const image = DOWNLOAD_SLIDE_IMAGE_BY_ID[id];
461
+ if (!image) continue;
462
+ const filesByApp = files.filter(f => String(f.id || '').trim() === id);
463
+ const hasWindows = filesByApp.some(_isWindowsFile);
464
+ const hasLinux = filesByApp.some(_isLinuxFile);
465
+ const hasMac = filesByApp.some(_isMacFile);
466
+ const hasApk = filesByApp.some(_isApkFile);
467
+
468
+ const preferredOs = hasWindows ? 'Windows' : hasLinux ? 'Linux' : hasMac ? 'macOS' : hasApk ? 'Apk' : 'Windows';
469
+ slides.push({
470
+ appId: id,
471
+ kicker: 'Featured App',
472
+ title: app.name || id,
473
+ description: app.tagline || app.description || 'Official release from the catalog.',
474
+ image,
475
+ cta: `Open ${(app.name || id).split(' ')[0]}`,
476
+ os: preferredOs
477
+ });
478
+ }
479
+
480
+ return slides.length ? slides : DOWNLOAD_AD_SLIDES;
481
+ }
482
+
483
+ function renderDownloadSlideDots() {
484
+ const dotsWrap = document.getElementById('dl-ad-dots');
485
+ if (!dotsWrap) return;
486
+ dotsWrap.innerHTML = DOWNLOAD_AD_SLIDES.map((_, i) =>
487
+ `<button class="dl-ad-dot${i === dlSlideIndex ? ' active' : ''}" onclick="dlSlideIndex=${i};renderDownloadSlide();" aria-label="Go to slide ${i + 1}"></button>`
488
+ ).join('');
489
+ }
490
+
491
+ function renderDownloadSlide() {
492
+ if (!DOWNLOAD_AD_SLIDES.length) return;
493
+ if (dlSlideIndex >= DOWNLOAD_AD_SLIDES.length) dlSlideIndex = 0;
494
+ const slide = DOWNLOAD_AD_SLIDES[dlSlideIndex] || DOWNLOAD_AD_SLIDES[0];
495
+ const bg = document.getElementById('dl-ad-bg');
496
+ const kicker = document.getElementById('dl-ad-kicker');
497
+ const title = document.getElementById('dl-ad-title');
498
+ const desc = document.getElementById('dl-ad-desc');
499
+ const dots = document.querySelectorAll('.dl-ad-dot');
500
+ const osWin = document.getElementById('dl-ad-os-win');
501
+ const osLin = document.getElementById('dl-ad-os-lin');
502
+ const osMac = document.getElementById('dl-ad-os-mac');
503
+ const osApk = document.getElementById('dl-ad-os-apk');
504
+
505
+ if (bg) {
506
+ const url = String(slide.image || '').replace(/'/g, "\\'");
507
+ bg.style.backgroundImage = `linear-gradient(90deg, rgba(9,14,34,0.15), rgba(9,14,34,0.1)), url('${url}')`;
508
+ }
509
+ if (kicker) kicker.textContent = slide.kicker || '';
510
+ if (title) title.textContent = slide.title || '';
511
+ if (desc) desc.textContent = slide.description || '';
512
+ if (osWin) osWin.classList.toggle('active', slide.os === 'Windows');
513
+ if (osLin) osLin.classList.toggle('active', slide.os === 'Linux');
514
+ if (osMac) osMac.classList.toggle('active', slide.os === 'macOS');
515
+ if (osApk) osApk.classList.toggle('active', slide.os === 'Apk');
516
+ dots.forEach((dot, i) => dot.classList.toggle('active', i === dlSlideIndex));
517
+ }
518
+
519
+ function stopDownloadSliderAuto() {
520
+ if (dlSlideTimer) {
521
+ clearInterval(dlSlideTimer);
522
+ dlSlideTimer = null;
523
+ }
524
+ }
525
+
526
+ function startDownloadSliderAuto() {
527
+ if (!DOWNLOAD_AD_SLIDES.length || dlSlideTimer) return;
528
+ dlSlideTimer = setInterval(() => {
529
+ stepDownloadSlide(1);
530
+ }, 5200);
531
+ }
532
+
533
+ function restartDownloadSliderAuto() {
534
+ stopDownloadSliderAuto();
535
+ startDownloadSliderAuto();
536
+ }
537
+
538
+ function stepDownloadSlide(step) {
539
+ if (!DOWNLOAD_AD_SLIDES.length) return;
540
+ const total = DOWNLOAD_AD_SLIDES.length;
541
+ dlSlideIndex = (dlSlideIndex + step + total) % total;
542
+ renderDownloadSlide();
543
+ }
544
+
545
+ function openDownloadSlideTarget() {
546
+ const slide = DOWNLOAD_AD_SLIDES[dlSlideIndex];
547
+ if (!slide) return;
548
+
549
+ const appId = String(slide.appId || '').trim();
550
+ const appCard = appId ? document.querySelector(`.dl-card[data-app-id="${appId}"]`) : null;
551
+ if (appCard) {
552
+ appCard.scrollIntoView({ behavior: 'smooth', block: 'center' });
553
+ return;
554
+ }
555
+
556
+ if (slide.os) {
557
+ const btn = document.getElementById('os-' + slide.os);
558
+ if (btn) {
559
+ setOsFilter(slide.os, btn);
560
+ document.getElementById('dl-grid').scrollIntoView({ behavior: 'smooth', block: 'start' });
561
+ return;
562
+ }
563
+ }
564
+
565
+ document.getElementById('dl-grid').scrollIntoView({ behavior: 'smooth', block: 'start' });
566
+ }
567
+
568
+ function quickFilterDownloadsByOs(os) {
569
+ const btn = document.getElementById('os-' + os);
570
+ if (!btn) return;
571
+ setOsFilter(os, btn);
572
+ const firstCard = document.querySelector('.dl-card');
573
+ if (firstCard) firstCard.scrollIntoView({ behavior: 'smooth', block: 'center' });
574
+ else document.getElementById('dl-grid').scrollIntoView({ behavior: 'smooth', block: 'start' });
575
+ }
576
+
577
+ function initDownloadSlider() {
578
+ const wrap = document.getElementById('dl-ad-wrap');
579
+ const dotsWrap = document.getElementById('dl-ad-dots');
580
+ if (!wrap || !dotsWrap || !DOWNLOAD_AD_SLIDES.length) return;
581
+
582
+ renderDownloadSlideDots();
583
+
584
+ renderDownloadSlide();
585
+ if (document.getElementById('page-downloads')?.classList.contains('active')) {
586
+ restartDownloadSliderAuto();
587
+ }
588
+ }
589
+
590
+ async function loadDownloads() {
591
+ setStatus('Loading catalog...', 'loading');
592
+ document.getElementById('dl-grid').innerHTML =
593
+ `<div class="loading-box">
594
+ <svg class="spin" width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
595
+ <path d="M21 12a9 9 0 11-6.219-8.56"/>
596
+ </svg>Loading catalog...</div>`;
597
+ try {
598
+ const _catalog = await hub.fetchFiles();
599
+ dlFiles = (_catalog && Array.isArray(_catalog.files)) ? _catalog.files
600
+ : (Array.isArray(_catalog) ? _catalog : []);
601
+ // Build unique app list by deduping on npmPackage
602
+ dlApps = [];
603
+ const _seen = new Set();
604
+ for (const f of dlFiles) {
605
+ const key = f.npmPackage || f.id || '';
606
+ if (key && !_seen.has(key)) { _seen.add(key); dlApps.push(f); }
607
+ }
608
+
609
+ DOWNLOAD_AD_SLIDES = buildDownloadSlidesFromCatalog(dlFiles);
610
+ dlSlideIndex = 0;
611
+ renderDownloadSlideDots();
612
+ renderDownloadSlide();
613
+ if (document.getElementById('page-downloads')?.classList.contains('active')) {
614
+ restartDownloadSliderAuto();
615
+ }
616
+
617
+ // Populate counts on OS filter buttons
618
+ const _win = dlFiles.filter(_isWindowsFile).length;
619
+ const _lin = dlFiles.filter(_isLinuxFile).length;
620
+ const _mac = dlFiles.filter(_isMacFile).length;
621
+ const _apk = dlFiles.filter(_isApkFile).length;
622
+ const _setChipCount = (id, value) => {
623
+ const n = document.getElementById(id);
624
+ if (n) n.textContent = String(value);
625
+ };
626
+ _setChipCount('os-count-Windows', _win);
627
+ _setChipCount('os-count-Linux', _lin);
628
+ _setChipCount('os-count-macOS', _mac);
629
+ _setChipCount('os-count-Apk', _apk);
630
+ await renderDownloads();
631
+ setStatus(`${dlFiles.length} files in catalog`, 'ok');
632
+ } catch (e) {
633
+ document.getElementById('dl-grid').innerHTML =
634
+ `<div class="error-box">
635
+ <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
636
+ <circle cx="12" cy="12" r="10"/>
637
+ <line x1="15" y1="9" x2="9" y2="15"/><line x1="9" y1="9" x2="15" y2="15"/>
638
+ </svg>
639
+ Failed to load catalog: ${esc(e.message)}
640
+ </div>`;
641
+ setStatus('Catalog error', 'error');
642
+ }
643
+ }
644
+
645
+ function setOsFilter(os, btn) {
646
+ osFilter = os;
647
+ document.querySelectorAll('.os-chip, .dl-channel').forEach(c => c.classList.remove('active'));
648
+ btn.classList.add('active');
649
+ renderDownloads();
650
+ }
651
+
652
+ function _osMatch(f) {
653
+ const p = (f.path || '').toLowerCase();
654
+ const o = (f.os || '').toLowerCase();
655
+ if (osFilter === 'All') return true;
656
+ if (osFilter === 'Windows') return _isWindowsFile(f);
657
+ if (osFilter === 'Linux') return _isLinuxFile(f);
658
+ if (osFilter === 'macOS') return _isMacFile(f);
659
+ if (osFilter === 'Apk') return _isApkFile(f);
660
+ return true;
661
+ }
662
+
663
+ function makeFileCard(f, globalIdx) {
664
+ const fname = (f.path || '').split('/').pop();
665
+ const p = (f.path || '').toLowerCase();
666
+ const isWin = _isWindowsFile(f);
667
+ const isLin = _isLinuxFile(f);
668
+ const isMac = _isMacFile(f);
669
+ const isApk = _isApkFile(f);
670
+ const winSvg = `<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="8" height="8"/><rect x="13" y="3" width="8" height="8"/><rect x="3" y="13" width="8" height="8"/><rect x="13" y="13" width="8" height="8"/></svg>`;
671
+ const linSvg = `<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="8" r="3"/><path d="M8 16c0-2.2 1.8-4 4-4s4 1.8 4 4"/><path d="M4 20c0-2.2 1.8-4 4-4h8c2.2 0 4 1.8 4 4"/></svg>`;
672
+ const apkSvg = `<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="7" y="3" width="10" height="18" rx="2"/><line x1="11" y1="6" x2="13" y2="6"/></svg>`;
673
+ const fileSvg = `<svg width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z"/><polyline points="13 2 13 9 20 9"/></svg>`;
674
+ const dlSvg = `<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>`;
675
+ const chkSvg = `<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>`;
676
+ const folderSvg=`<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M22 19a2 2 0 01-2 2H4a2 2 0 01-2-2V5a2 2 0 012-2h5l2 3h9a2 2 0 012 2z"/></svg>`;
677
+ const updSvg = `<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><polyline points="23 4 23 10 17 10"/><path d="M20.49 15a9 9 0 11-2.12-9.36L23 10"/></svg>`;
678
+ const iconSvg = isWin ? winSvg : isLin ? linSvg : isApk ? apkSvg : fileSvg;
679
+ const iconCls = isWin ? '' : isLin ? ' linux' : isApk ? ' apk' : isMac ? ' mac' : '';
680
+ const i = globalIdx;
681
+ const npmPkg = f.npmPackage || '';
682
+ // exists/meta are resolved lazily - use _cardMeta global cache
683
+ const fileExist = _cardExist[i];
684
+ const meta = _cardMeta[i];
685
+ const hasUpdate = fileExist && (
686
+ !meta ||
687
+ (f.releaseDate && meta.releaseDate && f.releaseDate > meta.releaseDate) ||
688
+ (f.version && meta.version && f.version !== meta.version)
689
+ );
690
+ const openBtn = npmPkg
691
+ ? `<button class="dl-btn open-btn" title="Open install folder" onclick="openNpmFolder('${esc(npmPkg)}')">${folderSvg}</button>`
692
+ : `<button class="dl-btn open-btn" title="Open containing folder" onclick="openDownloadedFileFolder('${esc(f.path)}')">${folderSvg}</button>`;
693
+ const primaryBtn = npmPkg
694
+ ? `<button class="dl-btn primary" id="dlbtn-${i}" onclick="startNpmInstall('${esc(npmPkg)}','${esc(f.path)}',${i})">${dlSvg} Install</button>`
695
+ : `<button class="dl-btn primary" id="dlbtn-${i}" onclick="startDownload('${esc(f.path)}',${i})">${dlSvg} Download</button>`;
696
+ const updateBtn = npmPkg
697
+ ? `<button class="dl-btn update" id="dlbtn-${i}" onclick="startNpmInstall('${esc(npmPkg)}','${esc(f.path)}',${i})">${updSvg} Update</button>`
698
+ : `<button class="dl-btn update" id="dlbtn-${i}" onclick="startDownload('${esc(f.path)}',${i})">${updSvg} Update</button>`;
699
+ const installedLabel = npmPkg ? 'Installed' : 'Downloaded';
700
+ const footerBtns = hasUpdate
701
+ ? `${updateBtn}${openBtn}`
702
+ : fileExist
703
+ ? `<button class="dl-btn installed" disabled>${chkSvg} ${installedLabel}</button>${openBtn}`
704
+ : `${primaryBtn}${openBtn}`;
705
+
706
+ return `<div class="dl-card" data-app-id="${esc(f.id || '')}">
707
+ <div class="dl-card-header">
708
+ <div class="dl-card-icon${iconCls}">${iconSvg}</div>
709
+ <div>
710
+ <div class="dl-card-name">${esc(fname)}</div>
711
+ <div class="dl-card-meta">
712
+ ${f.version ? `<span class="dl-tag version">v${esc(f.version)}</span>` : ''}
713
+ ${f.sizeLabel ? `<span class="dl-tag size">${esc(f.sizeLabel)}</span>` : ''}
714
+ ${hasUpdate ? `<span class="dl-tag update-badge">UPDATE</span>` : ''}
715
+ ${f.releaseDate? `<span class="dl-tag date">${esc(f.releaseDate)}</span>` : ''}
716
+ </div>
717
+ </div>
718
+ </div>
719
+ ${f.notes ? `<div class="dl-card-notes">${esc(f.notes)}</div>` : ''}
720
+ <div class="prog-wrap" id="prog-wrap-${i}" style="display:none">
721
+ <div class="prog-bar" id="prog-${i}"></div>
722
+ <div class="npm-log-line" id="npm-log-${i}"></div>
723
+ </div>
724
+ <div class="dl-card-footer">${footerBtns}</div>
725
+ </div>`;
726
+ }
727
+
728
+ let _cardExist = [];
729
+ let _cardMeta = [];
730
+
731
+ async function renderDownloads() {
732
+ const grid = document.getElementById('dl-grid');
733
+
734
+ const filtered = osFilter === 'All' ? dlFiles : dlFiles.filter(_osMatch);
735
+ if (filtered.length === 0) {
736
+ grid.innerHTML = '<div class="empty-box" style="grid-column:1 / -1">No files for this platform</div>';
737
+ return;
738
+ }
739
+
740
+ // Pre-fetch exists/meta for ALL files so card indices remain stable.
741
+ _cardExist = await Promise.all(dlFiles.map(f => hub.checkFileExists(f.path).catch(() => false)));
742
+ _cardMeta = await Promise.all(dlFiles.map(f => hub.getFileMeta(f.path).catch(() => null)));
743
+ grid.innerHTML = filtered.map(f => makeFileCard(f, dlFiles.indexOf(f))).join('');
744
+ }
745
+
746
+ async function startDownload(filePath, idx) {
747
+ if (isDownloading[idx]) return;
748
+ isDownloading[idx] = true;
749
+ const btn = document.getElementById('dlbtn-' + idx);
750
+ const progWrap = document.getElementById('prog-wrap-' + idx);
751
+ const progBar = document.getElementById('prog-' + idx);
752
+ const spinSvg = `<svg class="spin" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
753
+ <path d="M21 12a9 9 0 11-6.219-8.56"/>
754
+ </svg>`;
755
+
756
+ if (btn) { btn.disabled = true; btn.innerHTML = spinSvg + ' Downloading...'; }
757
+ if (progWrap) progWrap.style.display = 'block';
758
+ setStatus('Downloading ' + filePath.split('/').pop() + '...', 'loading');
759
+
760
+ hub.removeDownloadProgressListeners();
761
+ hub.onDownloadProgress(({ percent }) => {
762
+ if (progBar) progBar.style.width = Math.round(percent) + '%';
763
+ setStatus(`Downloading - ${Math.round(percent)}%`, 'loading');
764
+ });
765
+
766
+ try {
767
+ await hub.downloadFile(filePath, 0);
768
+ hub.removeDownloadProgressListeners();
769
+ // Save meta so update detection works next time catalog changes
770
+ const catalog = dlFiles.find(f => f.path === filePath);
771
+ if (catalog) await hub.saveFileMeta(filePath, { version: catalog.version, releaseDate: catalog.releaseDate });
772
+ setStatus(filePath.split('/').pop() + ' downloaded', 'ok');
773
+ await renderDownloads();
774
+ } catch (e) {
775
+ hub.removeDownloadProgressListeners();
776
+ if (progWrap) progWrap.style.display = 'none';
777
+ if (btn) {
778
+ btn.disabled = false;
779
+ btn.innerHTML = `<svg width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
780
+ <path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/>
781
+ <polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/>
782
+ </svg> Retry`;
783
+ }
784
+ setStatus('Download failed: ' + e.message, 'error');
785
+ }
786
+ isDownloading[idx] = false;
787
+ }
788
+
789
+ async function openDownloadedFile(filePath, expectedHash) {
790
+ const result = await hub.openFile(filePath, expectedHash);
791
+ if (result === 'not-found') {
792
+ setStatus('File not found. Try re-downloading.', 'error');
793
+ } else if (result === 'integrity-failed') {
794
+ setStatus('Integrity check failed. File may be corrupted or tampered. Re-download recommended.', 'error');
795
+ }
796
+ }
797
+
798
+ async function openDownloadedFileFolder(filePath) {
799
+ await hub.openFileFolder(filePath);
800
+ }
801
+
802
+ async function openNpmFolder(npmPkg) {
803
+ try {
804
+ const result = await hub.openNpmPkgFolder(npmPkg);
805
+ if (result === 'not-found') setStatus('Install folder not found', 'error');
806
+ } catch (_) { setStatus('Could not open install folder', 'error'); }
807
+ }
808
+
809
+ async function startNpmInstall(npmPkg, filePath, idx) {
810
+ if (isDownloading[idx]) return;
811
+ isDownloading[idx] = true;
812
+ const btn = document.getElementById('dlbtn-' + idx);
813
+ const logWrap = document.getElementById('prog-wrap-' + idx);
814
+ const logLine = document.getElementById('npm-log-' + idx);
815
+ const spinSvg = `<svg class="spin" width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
816
+ <path d="M21 12a9 9 0 11-6.219-8.56"/>
817
+ </svg>`;
818
+
819
+ if (btn) { btn.disabled = true; btn.innerHTML = spinSvg + ' Installing...'; }
820
+ if (logWrap) { logWrap.style.display = 'block'; }
821
+ if (logLine) { logLine.textContent = 'Starting npm install...'; }
822
+ setStatus('Installing ' + npmPkg + '...', 'loading');
823
+
824
+ hub.removeNpmInstallLogListeners();
825
+ hub.onNpmInstallLog((line) => {
826
+ if (logLine) logLine.textContent = line;
827
+ setStatus(line, 'loading');
828
+ });
829
+
830
+ try {
831
+ const result = await hub.npmInstallPackage(npmPkg);
832
+ hub.removeNpmInstallLogListeners();
833
+ if (logWrap) logWrap.style.display = 'none';
834
+
835
+ if (result.success) {
836
+ const catalog = dlFiles.find(f => f.path === filePath);
837
+ if (catalog) await hub.saveFileMeta(filePath, {
838
+ version: catalog.version, releaseDate: catalog.releaseDate, npmInstalled: true
839
+ });
840
+ setStatus(npmPkg + ' installed successfully', 'ok');
841
+ await renderDownloads();
842
+ const installPath = await hub.npmGetInstallPath(npmPkg);
843
+ if (installPath) hub.openFile(installPath);
844
+ } else {
845
+ if (btn) { btn.disabled = false; btn.innerHTML = spinSvg + ' Retry'; }
846
+ setStatus('Install failed - check npm is installed and try again', 'error');
847
+ }
848
+ } catch (e) {
849
+ hub.removeNpmInstallLogListeners();
850
+ if (logWrap) logWrap.style.display = 'none';
851
+ if (btn) { btn.disabled = false; btn.innerHTML = spinSvg + ' Retry'; }
852
+ setStatus('Error: ' + e.message, 'error');
853
+ }
854
+ isDownloading[idx] = false;
855
+ }
856
+
857
+ // -- npm Packages -------------------------------------------------------------
858
+ async function loadNpmPackages() {
859
+ setStatus('Loading npm packages...', 'loading');
860
+ const listEl = document.getElementById('npm-list');
861
+ const detailEl = document.getElementById('npm-detail');
862
+ if (listEl) listEl.innerHTML = '<div class="loading-box">Loading packages...</div>';
863
+ if (detailEl) detailEl.innerHTML = '<div class="loading-box">Loading package details...</div>';
864
+ try {
865
+ npmPackages = (await hub.fetchNpmPackages()) || [];
866
+ const totalDl = npmPackages.reduce((s, p) => s + (p.downloads || 0), 0);
867
+ document.getElementById('npm-stat-count').textContent = npmPackages.length;
868
+ document.getElementById('npm-stat-dl').textContent = totalDl.toLocaleString();
869
+ renderNpmPackages(npmPackages);
870
+ setStatus(`${npmPackages.length} npm packages`, 'ok');
871
+ } catch (e) {
872
+ if (listEl) {
873
+ listEl.innerHTML = `<div class="error-box">Failed to load packages: ${esc(e.message)}</div>`;
874
+ }
875
+ if (detailEl) {
876
+ detailEl.innerHTML = '<div class="empty-box" style="padding:24px 10px">No package data.</div>';
877
+ }
878
+ setStatus('npm load failed', 'error');
879
+ }
880
+ }
881
+
882
+ function filterNpmPackages() {
883
+ const q = (document.getElementById('npm-search')?.value || '').toLowerCase();
884
+ const filtered = q
885
+ ? npmPackages.filter(p =>
886
+ p.name.toLowerCase().includes(q) ||
887
+ (p.description || '').toLowerCase().includes(q) ||
888
+ (p.keywords || []).some(k => k.toLowerCase().includes(q))
889
+ )
890
+ : npmPackages;
891
+ renderNpmPackages(filtered);
892
+ }
893
+
894
+ function fmtNpmDate(dateStr) {
895
+ if (!dateStr) return '-';
896
+ const d = new Date(dateStr);
897
+ if (Number.isNaN(d.getTime())) return '-';
898
+ return d.toLocaleDateString();
899
+ }
900
+
901
+ function cleanRepoUrl(url) {
902
+ const raw = String(url || '').trim();
903
+ if (!raw) return '';
904
+ return raw
905
+ .replace(/^git\+/, '')
906
+ .replace(/^git:\/\//, 'https://')
907
+ .replace(/\.git$/, '');
908
+ }
909
+
910
+ function canOpenHubUrl(url) {
911
+ const u = String(url || '');
912
+ if (!u) return false;
913
+ return u.startsWith('https://www.npmjs.com/package/') ||
914
+ u.startsWith('https://www.npmjs.com/org/chahuadev') ||
915
+ u.startsWith('https://github.com/') ||
916
+ u.startsWith('https://raw.githubusercontent.com/') ||
917
+ u.startsWith('https://huggingface.co/') ||
918
+ u.startsWith('https://chahuadev.com/');
919
+ }
920
+
921
+ function buildReadmeRenderContext(pkg) {
922
+ const repo = cleanRepoUrl(pkg?.repositoryUrl || pkg?.homepage || '');
923
+ const out = {
924
+ imageBase: '',
925
+ docBase: ''
926
+ };
927
+
928
+ const gh = repo.match(/^https:\/\/github\.com\/([^\/]+)\/([^\/?#]+)/i);
929
+ if (gh) {
930
+ const owner = gh[1];
931
+ const repoName = gh[2];
932
+ out.imageBase = `https://raw.githubusercontent.com/${owner}/${repoName}/HEAD/`;
933
+ out.docBase = `https://github.com/${owner}/${repoName}/blob/HEAD/`;
934
+ return out;
935
+ }
936
+
937
+ const hf = repo.match(/^https:\/\/huggingface\.co\/(.+)$/i);
938
+ if (hf) {
939
+ const root = hf[1].replace(/\/$/, '');
940
+ out.imageBase = `https://huggingface.co/${root}/resolve/main/`;
941
+ out.docBase = `https://huggingface.co/${root}/blob/main/`;
942
+ }
943
+
944
+ return out;
945
+ }
946
+
947
+ function resolveReadmeUrl(rawUrl, context, isImage) {
948
+ const raw = String(rawUrl || '').trim();
949
+ if (!raw || raw.startsWith('#')) return '';
950
+ if (/^https?:\/\//i.test(raw)) return raw;
951
+ if (raw.startsWith('//')) return `https:${raw}`;
952
+
953
+ const base = isImage
954
+ ? (context?.imageBase || context?.docBase || '')
955
+ : (context?.docBase || context?.imageBase || '');
956
+ if (!base) return '';
957
+
958
+ try {
959
+ return new URL(raw, base).toString();
960
+ } catch {
961
+ return '';
962
+ }
963
+ }
964
+
965
+ function renderMarkdownPreview(markdown, context = {}) {
966
+ const source = String(markdown || '').replace(/\r\n/g, '\n').trim();
967
+ if (!source) return '<div class="npm-readme-empty">No README available from npm registry metadata.</div>';
968
+
969
+ let text = esc(source);
970
+ const codeBlocks = [];
971
+ text = text.replace(/```([a-zA-Z0-9_-]+)?\n([\s\S]*?)```/g, (_, lang, code) => {
972
+ const block = `<pre><code>${code}</code></pre>`;
973
+ const key = `@@CODEBLOCK_${codeBlocks.length}@@`;
974
+ codeBlocks.push({ key, block, lang: lang || '' });
975
+ return key;
976
+ });
977
+
978
+ const lines = text.split('\n');
979
+ let html = '';
980
+ let inUl = false;
981
+ let inOl = false;
982
+ let inP = false;
983
+ let headingCounter = 0;
984
+
985
+ const isTableSeparator = (line) => /^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)+\|?\s*$/.test(String(line || ''));
986
+ const splitTableRow = (line) => String(line || '')
987
+ .trim()
988
+ .replace(/^\|/, '')
989
+ .replace(/\|$/, '')
990
+ .split('|')
991
+ .map(c => c.trim());
992
+ const parseTableAlign = (line) => splitTableRow(line).map((cell) => {
993
+ const c = String(cell || '').trim();
994
+ if (/^:-+:$/.test(c)) return 'center';
995
+ if (/^-+:$/.test(c)) return 'right';
996
+ if (/^:-+$/.test(c)) return 'left';
997
+ return 'left';
998
+ });
999
+ const slugifyHeading = (textValue) => {
1000
+ const plain = String(textValue || '')
1001
+ .toLowerCase()
1002
+ .replace(/<[^>]+>/g, '')
1003
+ .replace(/&[^;]+;/g, '-')
1004
+ .replace(/[^a-z0-9\s-]/g, '')
1005
+ .trim()
1006
+ .replace(/\s+/g, '-');
1007
+ headingCounter += 1;
1008
+ return `${plain || 'section'}-${headingCounter}`;
1009
+ };
1010
+
1011
+ const closeParagraph = () => {
1012
+ if (inP) {
1013
+ html += '</p>';
1014
+ inP = false;
1015
+ }
1016
+ };
1017
+ const closeLists = () => {
1018
+ if (inUl) { html += '</ul>'; inUl = false; }
1019
+ if (inOl) { html += '</ol>'; inOl = false; }
1020
+ };
1021
+ const inline = (raw) => String(raw || '')
1022
+ .replace(/!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g, (_, alt, url) => {
1023
+ const resolved = resolveReadmeUrl(url, context, true);
1024
+ if (!resolved) return `<span class="npm-md-missing-image">[image: ${alt || 'preview'}]</span>`;
1025
+ return `<img src="${esc(resolved)}" alt="${esc(alt)}" loading="lazy" referrerpolicy="no-referrer">`;
1026
+ })
1027
+ .replace(/\[([^\]]+)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g, (_, label, url) => {
1028
+ const resolved = resolveReadmeUrl(url, context, false);
1029
+ if (!resolved) return label;
1030
+ return `<a href="#" data-readme-link="${encodeURIComponent(resolved)}">${label}</a>`;
1031
+ })
1032
+ .replace(/`([^`]+)`/g, '<code>$1</code>')
1033
+ .replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>')
1034
+ .replace(/\*([^*]+)\*/g, '<em>$1</em>');
1035
+
1036
+ for (let i = 0; i < lines.length; i++) {
1037
+ const line = lines[i];
1038
+ const t = line.trim();
1039
+
1040
+ if (!t) {
1041
+ closeParagraph();
1042
+ closeLists();
1043
+ continue;
1044
+ }
1045
+
1046
+ if (line.includes('|') && i + 1 < lines.length && isTableSeparator(lines[i + 1])) {
1047
+ closeParagraph();
1048
+ closeLists();
1049
+ const headers = splitTableRow(line);
1050
+ const aligns = parseTableAlign(lines[i + 1]);
1051
+ html += '<table><thead><tr>' + headers.map((h, idx) => `<th style="text-align:${aligns[idx] || 'left'}">${inline(h)}</th>`).join('') + '</tr></thead><tbody>';
1052
+ i += 2;
1053
+ while (i < lines.length && lines[i].trim() && lines[i].includes('|')) {
1054
+ const cells = splitTableRow(lines[i]);
1055
+ html += '<tr>' + cells.map((c, idx) => `<td style="text-align:${aligns[idx] || 'left'}">${inline(c)}</td>`).join('') + '</tr>';
1056
+ i += 1;
1057
+ }
1058
+ html += '</tbody></table>';
1059
+ i -= 1;
1060
+ continue;
1061
+ }
1062
+
1063
+ const headingMatch = t.match(/^(#{1,6})\s+(.+)$/);
1064
+ if (headingMatch) {
1065
+ closeParagraph();
1066
+ closeLists();
1067
+ const level = headingMatch[1].length;
1068
+ const headingText = inline(headingMatch[2]);
1069
+ const headingId = slugifyHeading(headingText);
1070
+ html += `<h${level} id="${headingId}">${headingText}<button class="npm-md-anchor" type="button" title="Copy section link" data-heading-anchor="${headingId}">#</button></h${level}>`;
1071
+ continue;
1072
+ }
1073
+
1074
+ if (/^---+$/.test(t) || /^\*\*\*+$/.test(t)) {
1075
+ closeParagraph();
1076
+ closeLists();
1077
+ html += '<hr>';
1078
+ continue;
1079
+ }
1080
+
1081
+ const quoteMatch = t.match(/^>\s+(.+)$/);
1082
+ if (quoteMatch) {
1083
+ closeParagraph();
1084
+ closeLists();
1085
+ html += `<blockquote>${inline(quoteMatch[1])}</blockquote>`;
1086
+ continue;
1087
+ }
1088
+
1089
+ const listMatch = line.match(/^(\s*)([-*]|\d+\.)\s+(.+)$/);
1090
+ const listIndent = listMatch ? Math.floor((String(listMatch[1] || '').replace(/\t/g, ' ').length) / 2) : 0;
1091
+ const listIndentPx = Math.max(0, Math.min(8, listIndent)) * 14;
1092
+
1093
+ const olMatch = listMatch && /\d+\./.test(listMatch[2]) ? [null, listMatch[3]] : null;
1094
+ if (olMatch) {
1095
+ closeParagraph();
1096
+ if (inUl) { html += '</ul>'; inUl = false; }
1097
+ if (!inOl) { html += '<ol>'; inOl = true; }
1098
+ const check = olMatch[1].match(/^\[( |x|X)\]\s+(.+)$/);
1099
+ if (check) {
1100
+ html += `<li class="check-item md-nested" style="margin-left:${listIndentPx}px"><input type="checkbox" disabled ${check[1].toLowerCase() === 'x' ? 'checked' : ''}><span>${inline(check[2])}</span></li>`;
1101
+ } else {
1102
+ html += `<li class="md-nested" style="margin-left:${listIndentPx}px">${inline(olMatch[1])}</li>`;
1103
+ }
1104
+ continue;
1105
+ }
1106
+
1107
+ const ulMatch = listMatch && /[-*]/.test(listMatch[2]) ? [null, listMatch[3]] : null;
1108
+ if (ulMatch) {
1109
+ closeParagraph();
1110
+ if (inOl) { html += '</ol>'; inOl = false; }
1111
+ if (!inUl) { html += '<ul>'; inUl = true; }
1112
+ const check = ulMatch[1].match(/^\[( |x|X)\]\s+(.+)$/);
1113
+ if (check) {
1114
+ html += `<li class="check-item md-nested" style="margin-left:${listIndentPx}px"><input type="checkbox" disabled ${check[1].toLowerCase() === 'x' ? 'checked' : ''}><span>${inline(check[2])}</span></li>`;
1115
+ } else {
1116
+ html += `<li class="md-nested" style="margin-left:${listIndentPx}px">${inline(ulMatch[1])}</li>`;
1117
+ }
1118
+ continue;
1119
+ }
1120
+
1121
+ closeLists();
1122
+ if (!inP) {
1123
+ html += '<p>';
1124
+ inP = true;
1125
+ } else {
1126
+ html += ' ';
1127
+ }
1128
+ html += inline(t);
1129
+ }
1130
+
1131
+ closeParagraph();
1132
+ closeLists();
1133
+
1134
+ for (const block of codeBlocks) {
1135
+ html = html.replace(block.key, block.block);
1136
+ }
1137
+
1138
+ return `<div class="npm-readme-preview">${html}</div>`;
1139
+ }
1140
+
1141
+ function selectNpmPackage(pkgName) {
1142
+ const list = document.getElementById('npm-list');
1143
+ if (list) {
1144
+ list.querySelectorAll('.npm-list-item').forEach((el) => {
1145
+ el.classList.toggle('active', el.getAttribute('data-name') === pkgName);
1146
+ });
1147
+ }
1148
+
1149
+ const pkg = npmPackages.find(p => p.name === pkgName);
1150
+ const detail = document.getElementById('npm-detail');
1151
+ if (!detail || !pkg) return;
1152
+
1153
+ const readme = String(pkg.readmeExcerpt || '').trim();
1154
+ const readmeCtx = buildReadmeRenderContext(pkg);
1155
+ const readmeHtml = readme
1156
+ ? `<div class="npm-section-title">README</div><div class="npm-readme">${renderMarkdownPreview(readme, readmeCtx)}</div>`
1157
+ : '<div class="npm-section-title">README</div><div class="npm-readme"><div class="npm-readme-empty">No README available from npm registry metadata.</div></div>';
1158
+
1159
+ const repoUrl = cleanRepoUrl(pkg.repositoryUrl);
1160
+ const npmUrl = pkg.npmUrl || `https://www.npmjs.com/package/${encodeURIComponent(pkg.name)}`;
1161
+ const homeUrl = String(pkg.homepage || '');
1162
+ const homeBtn = canOpenHubUrl(homeUrl)
1163
+ ? `<button class="npm-open-btn" onclick="hub.openExternalUrl('${esc(homeUrl)}')">Homepage</button>`
1164
+ : '';
1165
+ const repoBtn = canOpenHubUrl(repoUrl)
1166
+ ? `<button class="npm-open-btn" onclick="hub.openExternalUrl('${esc(repoUrl)}')">Repository</button>`
1167
+ : '';
1168
+
1169
+ detail.innerHTML = `
1170
+ <div class="npm-detail-title">${esc(pkg.name)}</div>
1171
+ <div class="npm-badges">
1172
+ ${pkg.version ? `<span class="npm-badge">v${esc(pkg.version)}</span>` : ''}
1173
+ ${pkg.license ? `<span class="npm-badge">License: ${esc(pkg.license)}</span>` : ''}
1174
+ <span class="npm-badge">${(pkg.downloads || 0).toLocaleString()} / month</span>
1175
+ </div>
1176
+ <div class="npm-detail-desc">${esc(pkg.description || 'No description')}</div>
1177
+
1178
+ <div class="npm-actions">
1179
+ <button class="npm-open-btn" onclick="hub.openExternalUrl('${npmUrl}')">Open npm Page</button>
1180
+ ${homeBtn}
1181
+ ${repoBtn}
1182
+ </div>
1183
+
1184
+ <div class="npm-kv-grid">
1185
+ <div class="npm-kv-card"><div class="npm-kv-label">Versions</div><div class="npm-kv-value">${(pkg.versionsCount || 0).toLocaleString()}</div></div>
1186
+ <div class="npm-kv-card"><div class="npm-kv-label">Monthly Downloads</div><div class="npm-kv-value">${(pkg.downloads || 0).toLocaleString()}</div></div>
1187
+ <div class="npm-kv-card"><div class="npm-kv-label">Latest Publish</div><div class="npm-kv-value">${esc(fmtNpmDate(pkg.updatedAt))}</div></div>
1188
+ <div class="npm-kv-card"><div class="npm-kv-label">Keywords</div><div class="npm-kv-value">${(pkg.keywords || []).length}</div></div>
1189
+ </div>
1190
+
1191
+ ${readmeHtml}
1192
+ `;
1193
+
1194
+ detail.querySelectorAll('[data-readme-link]').forEach((el) => {
1195
+ el.addEventListener('click', (ev) => {
1196
+ ev.preventDefault();
1197
+ const encoded = el.getAttribute('data-readme-link') || '';
1198
+ const url = decodeURIComponent(encoded);
1199
+ if (canOpenHubUrl(url)) {
1200
+ hub.openExternalUrl(url);
1201
+ } else {
1202
+ setStatus('Blocked external URL by policy', 'error');
1203
+ }
1204
+ });
1205
+ });
1206
+
1207
+ detail.querySelectorAll('[data-heading-anchor]').forEach((el) => {
1208
+ el.addEventListener('click', async (ev) => {
1209
+ ev.preventDefault();
1210
+ const anchor = el.getAttribute('data-heading-anchor') || '';
1211
+ if (!anchor) return;
1212
+ const text = `${pkg.npmUrl || `https://www.npmjs.com/package/${encodeURIComponent(pkg.name)}`}#${anchor}`;
1213
+ try {
1214
+ await navigator.clipboard.writeText(text);
1215
+ setStatus('Section link copied', 'ok');
1216
+ } catch {
1217
+ setStatus('Copy failed', 'error');
1218
+ }
1219
+ });
1220
+ });
1221
+ }
1222
+
1223
+ function renderNpmPackages(list) {
1224
+ const listEl = document.getElementById('npm-list');
1225
+ const detail = document.getElementById('npm-detail');
1226
+ if (!listEl || !detail) return;
1227
+
1228
+ if (!list.length) {
1229
+ listEl.innerHTML = '<div class="empty-box">No packages found</div>';
1230
+ detail.innerHTML = '<div class="empty-box" style="padding:24px 10px">No package selected</div>';
1231
+ return;
1232
+ }
1233
+
1234
+ listEl.innerHTML = list.map(pkg => {
1235
+ return `<button class="npm-list-item" data-name="${esc(pkg.name)}" onclick="selectNpmPackage('${esc(pkg.name)}')">
1236
+ <span>
1237
+ <span class="npm-list-name">${esc(pkg.name)}</span>
1238
+ <span class="npm-list-meta">${pkg.version ? `v${esc(pkg.version)} ` : ''}${esc(fmtNpmDate(pkg.updatedAt))}</span>
1239
+ </span>
1240
+ <span class="npm-list-dl">${(pkg.downloads || 0).toLocaleString()}</span>
1241
+ </button>`;
1242
+ }).join('');
1243
+
1244
+ const preferred = list[0]?.name;
1245
+ if (preferred) selectNpmPackage(preferred);
1246
+ }
1247
+
1248
+ // -- Repos panel resizer -------------------------------------------------------
1249
+ (function initResizer() {
1250
+ const resizer = document.getElementById('repos-resizer');
1251
+ const leftPane = document.querySelector('.repos-left');
1252
+ if (!resizer || !leftPane) return;
1253
+
1254
+ let startX = 0, startW = 0, dragging = false;
1255
+
1256
+ resizer.addEventListener('mousedown', e => {
1257
+ e.preventDefault();
1258
+ dragging = true;
1259
+ startX = e.clientX;
1260
+ startW = leftPane.getBoundingClientRect().width;
1261
+ resizer.classList.add('dragging');
1262
+ document.body.style.cursor = 'col-resize';
1263
+ });
1264
+
1265
+ document.addEventListener('mousemove', e => {
1266
+ if (!dragging) return;
1267
+ const delta = e.clientX - startX;
1268
+ const newW = Math.max(140, Math.min(startW + delta, window.innerWidth * 0.55));
1269
+ leftPane.style.width = newW + 'px';
1270
+ });
1271
+
1272
+ document.addEventListener('mouseup', () => {
1273
+ if (!dragging) return;
1274
+ dragging = false;
1275
+ resizer.classList.remove('dragging');
1276
+ document.body.style.cursor = '';
1277
+ });
1278
+ })();
1279
+
1280
+ // -- App self-update -----------------------------------------------------------
1281
+ let _pendingUpdate = null;
1282
+
1283
+ async function checkForAppUpdate() {
1284
+ try {
1285
+ const res = await hub.checkAppUpdate();
1286
+ if (!res || !res.hasUpdate) return;
1287
+ _pendingUpdate = res;
1288
+ document.getElementById('toast-ver').textContent =
1289
+ `v${res.current} -> v${res.latest}` + (res.releaseDate ? ` | ${res.releaseDate}` : '');
1290
+ const notesEl = document.getElementById('toast-notes');
1291
+ notesEl.textContent = res.notes || '';
1292
+ notesEl.style.display = res.notes ? '' : 'none';
1293
+ document.getElementById('app-update-toast').classList.remove('hidden');
1294
+ } catch (_) { /* silent - update check should never crash the app */ }
1295
+ }
1296
+
1297
+ function dismissUpdateToast() {
1298
+ document.getElementById('app-update-toast').classList.add('hidden');
1299
+ }
1300
+
1301
+ async function applyAppUpdate() {
1302
+ if (!_pendingUpdate) return;
1303
+ const btn = document.getElementById('toast-update-btn');
1304
+ const notesEl = document.getElementById('toast-notes');
1305
+ btn.disabled = true;
1306
+ btn.textContent = 'Updating...';
1307
+ notesEl.style.display = '';
1308
+ notesEl.textContent = 'Installing via npm, please wait...';
1309
+
1310
+ hub.onNpmUpdateLog((line) => {
1311
+ if (line) notesEl.textContent = line;
1312
+ });
1313
+
1314
+ try {
1315
+ const result = await hub.npmSelfUpdate();
1316
+ hub.removeNpmUpdateLogListeners();
1317
+
1318
+ if (result.success) {
1319
+ // Update complete - get install path then prompt user to restart
1320
+ hub.npmGetInstallPath().then(installPath => {
1321
+ btn.textContent = 'Done';
1322
+ notesEl.innerHTML =
1323
+ '<strong style="color:#fb923c">Update installed!</strong><br>' +
1324
+ 'Please close and reopen the app to use the new version.';
1325
+ // Show Open Folder button
1326
+ const laterBtn = document.querySelector('#app-update-toast .toast-act-btn.secondary');
1327
+ if (laterBtn) {
1328
+ laterBtn.textContent = 'Open Folder';
1329
+ laterBtn.style.display = '';
1330
+ laterBtn.onclick = () => hub.openNpmPkgFolder('@chahuadev/chahuadev-hub-app');
1331
+ }
1332
+ });
1333
+ } else {
1334
+ hub.removeNpmUpdateLogListeners();
1335
+ btn.disabled = false;
1336
+ btn.textContent = 'Retry';
1337
+ notesEl.textContent = 'Update failed. Check your internet connection and try again.';
1338
+ }
1339
+ } catch (err) {
1340
+ hub.removeNpmUpdateLogListeners();
1341
+ btn.disabled = false;
1342
+ btn.textContent = 'Retry';
1343
+ notesEl.textContent = 'Error: ' + (err.message || 'Unknown error');
1344
+ }
1345
+ }
1346
+
1347
+ // -- Init ----------------------------------------------------------------------
1348
+ (async function init() {
1349
+ setStatus('Loading...', 'loading');
1350
+
1351
+ // Show Dev page only while running in dev mode.
1352
+ const devMode = await hub.isDev().catch(() => false);
1353
+ devMenuEnabled = !!devMode;
1354
+ const devTab = document.getElementById('tab-dev');
1355
+ const devPage = document.getElementById('page-dev');
1356
+ if (devTab) devTab.style.display = devMenuEnabled ? '' : 'none';
1357
+ if (devPage) devPage.style.display = devMenuEnabled ? '' : 'none';
1358
+
1359
+ initDownloadSlider();
1360
+ await Promise.allSettled([loadDashboard(), loadDownloads()]);
1361
+ checkForAppUpdate(); // non-blocking - runs silently in background
1362
+ setStatus('Ready', 'ok');
1363
+ })();
1364
+
1365
+ // -- Proxy external-link requests from the Dashboard iframe --------------------
1366
+ window.addEventListener('message', function(e) {
1367
+ if (!e.data) return;
1368
+
1369
+ if (e.data.type === 'openLink') {
1370
+ const url = e.data.url;
1371
+ if (typeof url === 'string') hub.openExternalUrl(url);
1372
+ }
1373
+
1374
+ if (e.data.type === 'goToDownloads') {
1375
+ switchPage('downloads');
1376
+ // Optional: search for the app in downloads if needed
1377
+ }
1378
+
1379
+ if (e.data.type === 'installNpm') {
1380
+ const pkg = e.data.package;
1381
+ if (typeof pkg === 'string') {
1382
+ const idx = dlFiles.findIndex(f => f.npmPackage === pkg);
1383
+ if (idx >= 0) startNpmInstall(pkg, dlFiles[idx].path, idx);
1384
+ else {
1385
+ // If not found in dlFiles, still try to install directly
1386
+ startNpmInstall(pkg, '', dlFiles.length);
1387
+ }
1388
+ }
1389
+ }
1390
+
1391
+ if (e.data.type === 'openNpmFolder') {
1392
+ const pkg = e.data.package;
1393
+ if (typeof pkg === 'string') openNpmFolder(pkg);
1394
+ }
1395
+ });
1396
+
web/index.html CHANGED
@@ -1,964 +1,1148 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>Chahuadev — Building Next-Generation Desktop Tools</title>
7
- <link rel="preconnect" href="https://fonts.googleapis.com">
8
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
10
- <style>
11
- *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
12
- :root {
13
- --bg: #09090f; --surface: #0f172a; --card: #1e293b; --border: #334155;
14
- --muted: #475569; --dim: #64748b; --sub: #94a3b8; --text: #f1f5f9;
15
- --accent: #3b82f6; --success: #10b981; --warn: #f59e0b; --purple: #7c3aed;
16
- --purple-light: #a78bfa; --blue-light: #60a5fa;
17
- }
18
- html, body { overflow-x: hidden; scroll-behavior: smooth; }
19
- body {
20
- font-family: 'Inter', system-ui, sans-serif;
21
- background: var(--bg);
22
- color: var(--text);
23
- font-size: 14px;
24
- line-height: 1.6;
25
- }
26
- [id^="sec-"] { scroll-margin-top: 90px; }
27
- ::-webkit-scrollbar { width: 5px; }
28
- ::-webkit-scrollbar-track { background: transparent; }
29
- ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
30
-
31
- /* ══════════════════════════════════════
32
- LEFT SIDEBAR NAV
33
- ══════════════════════════════════════ */
34
- .left-nav {
35
- position: fixed;
36
- left: 16px;
37
- top: 96px;
38
- width: 190px;
39
- z-index: 25;
40
- display: flex;
41
- flex-direction: column;
42
- gap: 8px;
43
- max-height: calc(100vh - 120px);
44
- overflow-y: auto;
45
- padding-right: 4px;
46
- }
47
- .left-nav-title {
48
- font-size: 10px;
49
- letter-spacing: 0.08em;
50
- text-transform: uppercase;
51
- color: #60a5fa;
52
- margin-bottom: 4px;
53
- padding-left: 2px;
54
- font-family: 'Courier New', monospace;
55
- }
56
- .left-nav-link {
57
- display: block;
58
- text-decoration: none;
59
- color: #9fb0c7;
60
- background: rgba(15, 23, 42, 0.35);
61
- border: 1px solid rgba(148, 163, 184, 0.22);
62
- border-radius: 10px;
63
- padding: 8px 10px;
64
- font-size: 11px;
65
- line-height: 1.35;
66
- transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s;
67
- backdrop-filter: blur(5px);
68
- }
69
- .left-nav-link:hover {
70
- color: #dbeafe;
71
- border-color: rgba(96, 165, 250, 0.5);
72
- background: rgba(30, 41, 59, 0.5);
73
- transform: translateX(2px);
74
- }
75
- .left-nav-link.active {
76
- color: #eff6ff;
77
- border-color: rgba(96, 165, 250, 0.8);
78
- background: rgba(37, 99, 235, 0.22);
79
- box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.22);
80
- }
81
-
82
- @media (max-width: 1260px) {
83
- .left-nav { display: none; }
84
- }
85
-
86
- /* ══════════════════════════════════════
87
- HERO
88
- ══════════════════════════════════════ */
89
- .hero {
90
- position: relative;
91
- min-height: 100vh;
92
- display: flex;
93
- flex-direction: column;
94
- align-items: center;
95
- justify-content: center;
96
- text-align: center;
97
- padding: 100px 40px 80px;
98
- overflow: hidden;
99
- }
100
- /* Sci-fi grid background */
101
- .hero::before {
102
- content: '';
103
- position: absolute;
104
- inset: 0;
105
- background-image:
106
- linear-gradient(rgba(124,58,237,0.07) 1px, transparent 1px),
107
- linear-gradient(90deg, rgba(124,58,237,0.07) 1px, transparent 1px);
108
- background-size: 60px 60px;
109
- mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 20%, transparent 100%);
110
- -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 20%, transparent 100%);
111
- pointer-events: none;
112
- }
113
- /* Ambient glow orbs */
114
- .hero-glow {
115
- position: absolute;
116
- inset: 0;
117
- background:
118
- radial-gradient(ellipse 700px 400px at 25% 15%, rgba(124,58,237,0.16), transparent 70%),
119
- radial-gradient(ellipse 600px 350px at 80% 85%, rgba(59,130,246,0.11), transparent 70%);
120
- pointer-events: none;
121
- }
122
- /* Floating scan-line animation */
123
- .hero-scanline {
124
- position: absolute;
125
- left: 0; right: 0;
126
- height: 2px;
127
- background: linear-gradient(90deg, transparent, rgba(124,58,237,0.35), transparent);
128
- animation: scan 7s linear infinite;
129
- pointer-events: none;
130
- }
131
- @keyframes scan { 0% { transform: translateY(-50px); } 100% { transform: translateY(105vh); } }
132
-
133
- .hero-content { position: relative; z-index: 1; max-width: 800px; }
134
-
135
- .hero-eyebrow {
136
- display: inline-flex; align-items: center; gap: 7px;
137
- padding: 5px 16px;
138
- border-radius: 20px;
139
- border: 1px solid rgba(124,58,237,0.3);
140
- background: rgba(124,58,237,0.08);
141
- color: var(--purple-light);
142
- font-size: 12px; font-weight: 600;
143
- letter-spacing: 0.05em; text-transform: uppercase;
144
- margin-bottom: 32px;
145
- }
146
- .hero-title {
147
- font-size: clamp(52px, 10vw, 96px);
148
- font-weight: 900;
149
- line-height: 0.95;
150
- letter-spacing: -0.04em;
151
- background: linear-gradient(140deg, #f1f5f9 0%, #c4b5fd 50%, #60a5fa 100%);
152
- -webkit-background-clip: text; -webkit-text-fill-color: transparent;
153
- background-clip: text;
154
- margin-bottom: 24px;
155
- }
156
- .hero-tagline {
157
- font-size: clamp(16px, 2.2vw, 21px);
158
- color: var(--sub);
159
- font-weight: 400;
160
- line-height: 1.6;
161
- max-width: 580px;
162
- margin: 0 auto 44px;
163
- }
164
- .hero-tagline strong { color: var(--text); font-weight: 600; }
165
-
166
- .hero-cta {
167
- display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
168
- margin-bottom: 64px;
169
- }
170
- .btn-primary {
171
- display: inline-flex; align-items: center; gap: 9px;
172
- padding: 15px 30px;
173
- border-radius: 10px;
174
- background: linear-gradient(135deg, #7c3aed, #6d28d9);
175
- color: #fff;
176
- font-size: 15px; font-weight: 700; font-family: inherit;
177
- border: none; cursor: pointer;
178
- box-shadow: 0 0 32px rgba(124,58,237,0.35);
179
- transition: all 0.2s;
180
- }
181
- .btn-primary:hover {
182
- transform: translateY(-2px);
183
- box-shadow: 0 0 48px rgba(124,58,237,0.55);
184
- background: linear-gradient(135deg, #8b5cf6, #7c3aed);
185
- }
186
- .btn-secondary {
187
- display: inline-flex; align-items: center; gap: 9px;
188
- padding: 15px 30px;
189
- border-radius: 10px;
190
- background: transparent;
191
- color: var(--sub);
192
- font-size: 15px; font-weight: 600; font-family: inherit;
193
- border: 1px solid var(--border); cursor: pointer;
194
- transition: all 0.2s;
195
- }
196
- .btn-secondary:hover { border-color: var(--muted); color: var(--text); background: var(--card); }
197
-
198
- .hero-stat-strip {
199
- display: flex; gap: 52px; justify-content: center; flex-wrap: wrap;
200
- padding-top: 28px;
201
- border-top: 1px solid rgba(255,255,255,0.07);
202
- }
203
- .hstat-item { text-align: center; }
204
- .hstat-value {
205
- font-size: 30px; font-weight: 800;
206
- background: linear-gradient(135deg, #a78bfa, #60a5fa);
207
- -webkit-background-clip: text; -webkit-text-fill-color: transparent;
208
- background-clip: text;
209
- }
210
- .hstat-label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 3px; }
211
-
212
- /* ══════════════════════════════════════
213
- SHARED SECTION LAYOUT
214
- ══════════════════════════════════════ */
215
- .section-wrap {
216
- padding: 96px 40px;
217
- border-top: 1px solid var(--border);
218
- }
219
- .section-inner { max-width: 1100px; margin: 0 auto; }
220
-
221
- .section-label {
222
- display: flex; align-items: center; gap: 10px;
223
- font-size: 11px; font-weight: 700;
224
- text-transform: uppercase; letter-spacing: 0.1em;
225
- color: var(--purple-light);
226
- margin-bottom: 12px;
227
- }
228
- .section-label::before {
229
- content: '';
230
- width: 3px; height: 16px;
231
- border-radius: 2px;
232
- background: linear-gradient(180deg, #7c3aed, #3b82f6);
233
- flex-shrink: 0;
234
- }
235
- .section-heading {
236
- font-size: clamp(28px, 4vw, 44px);
237
- font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
238
- color: var(--text);
239
- margin-bottom: 16px;
240
- }
241
- .section-sub {
242
- font-size: 16px; color: var(--sub);
243
- max-width: 520px; line-height: 1.75;
244
- }
245
-
246
- /* ══════════════════════════════════════
247
- PRODUCT SHOWCASE
248
- ══════════════════════════════════════ */
249
- .showcase-item {
250
- display: grid;
251
- grid-template-columns: 1fr 1fr;
252
- gap: 72px;
253
- align-items: center;
254
- padding: 80px 0;
255
- }
256
- .showcase-item + .showcase-item { border-top: 1px solid var(--border); }
257
- .showcase-item.reverse .showcase-visual { order: -1; }
258
-
259
- /* App window mockup */
260
- .showcase-visual {
261
- border-radius: 14px;
262
- border: 1px solid var(--border);
263
- overflow: hidden;
264
- aspect-ratio: 16/10;
265
- background: var(--surface);
266
- position: relative;
267
- box-shadow: 0 24px 64px rgba(0,0,0,0.5);
268
- }
269
- .win-bar {
270
- position: absolute; top: 0; left: 0; right: 0;
271
- height: 36px;
272
- background: var(--card);
273
- border-bottom: 1px solid var(--border);
274
- display: flex; align-items: center; padding: 0 14px; gap: 6px;
275
- z-index: 1;
276
- }
277
- .win-dot { width: 10px; height: 10px; border-radius: 50%; }
278
- .mock-body {
279
- position: absolute; inset: 36px 0 0 0;
280
- padding: 16px; display: flex; flex-direction: column; gap: 7px;
281
- overflow: hidden;
282
- }
283
- .mock-row {
284
- display: flex; align-items: center; gap: 10px;
285
- padding: 8px 12px;
286
- border-radius: 7px;
287
- background: var(--card);
288
- border: 1px solid var(--border);
289
- flex-shrink: 0;
290
- }
291
- .mock-row.hi { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.06); }
292
- .mock-row.ok { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.05); }
293
- .mock-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
294
- .mock-bar { height: 7px; border-radius: 4px; flex: 1; background: rgba(255,255,255,0.06); }
295
- .mock-val { font-size: 11px; color: var(--dim); white-space: nowrap; font-family: 'Courier New', monospace; }
296
-
297
- /* Emoji cleaner code mockup */
298
- .mock-code { position: absolute; inset: 36px 0 0 0; padding: 18px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
299
- .code-block {
300
- background: var(--card); border: 1px solid var(--border);
301
- border-radius: 7px; padding: 10px 14px;
302
- font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.7;
303
- }
304
- .code-block.out { border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.05); }
305
- .code-label { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
306
- .code-status { font-family: 'Courier New', monospace; font-size: 11px; }
307
-
308
- /* Showcase text side */
309
- .showcase-badge {
310
- display: inline-flex; align-items: center; gap: 6px;
311
- padding: 4px 12px;
312
- border-radius: 20px; font-size: 11px; font-weight: 600;
313
- border: 1px solid; margin-bottom: 20px;
314
- }
315
- .badge-warn { background: rgba(245,158,11,0.1); color: #f59e0b; border-color: rgba(245,158,11,0.25); }
316
- .badge-blue { background: rgba(59,130,246,0.1); color: #60a5fa; border-color: rgba(59,130,246,0.25); }
317
- .showcase-title {
318
- font-size: clamp(24px, 3.2vw, 38px);
319
- font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
320
- margin-bottom: 16px;
321
- }
322
- .showcase-desc { font-size: 15px; color: var(--sub); line-height: 1.75; margin-bottom: 24px; }
323
-
324
- .feature-list { display: flex; flex-direction: column; gap: 11px; margin-bottom: 32px; }
325
- .feature-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--sub); }
326
- .feature-icon {
327
- width: 20px; height: 20px; border-radius: 6px;
328
- display: flex; align-items: center; justify-content: center;
329
- flex-shrink: 0; margin-top: 2px;
330
- }
331
-
332
- .dl-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
333
- .dl-os {
334
- display: inline-flex; align-items: center; gap: 7px;
335
- padding: 9px 18px; border-radius: 8px;
336
- border: 1px solid var(--border);
337
- background: transparent; color: var(--sub);
338
- font-size: 13px; font-weight: 500; font-family: inherit;
339
- cursor: pointer; transition: all 0.15s;
340
- }
341
- .dl-os:hover { border-color: var(--muted); color: var(--text); background: var(--card); }
342
-
343
- /* ══════════════════════════════════════
344
- WHY CHAHUADEV
345
- ══════════════════════════════════════ */
346
- .why-bg {
347
- background: linear-gradient(180deg, transparent 0%, rgba(124,58,237,0.04) 40%, transparent 100%);
348
- }
349
- .why-grid {
350
- display: grid;
351
- grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
352
- gap: 20px;
353
- margin-top: 56px;
354
- }
355
- .why-card {
356
- background: var(--card);
357
- border: 1px solid var(--border);
358
- border-radius: 14px;
359
- padding: 28px 24px;
360
- transition: border-color 0.2s, transform 0.2s;
361
- }
362
- .why-card:hover { border-color: var(--muted); transform: translateY(-3px); }
363
- .why-icon {
364
- width: 46px; height: 46px; border-radius: 12px;
365
- display: flex; align-items: center; justify-content: center;
366
- margin-bottom: 18px;
367
- }
368
- .why-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
369
- .why-desc { font-size: 13px; color: var(--sub); line-height: 1.65; }
370
-
371
- /* ══════════════════════════════════════
372
- FOOTER
373
- ══════════════════════════════════════ */
374
- .footer {
375
- border-top: 1px solid var(--border);
376
- padding: 64px 40px 36px;
377
- }
378
- .footer-inner { max-width: 1100px; margin: 0 auto; }
379
- .footer-grid {
380
- display: grid;
381
- grid-template-columns: 2fr 1fr 1fr;
382
- gap: 48px;
383
- margin-bottom: 48px;
384
- }
385
- .footer-brand-name {
386
- font-size: 19px; font-weight: 800;
387
- background: linear-gradient(135deg, #f1f5f9 0%, #a78bfa 100%);
388
- -webkit-background-clip: text; -webkit-text-fill-color: transparent;
389
- background-clip: text;
390
- margin-bottom: 10px;
391
- }
392
- .footer-brand-desc { font-size: 13px; color: var(--dim); line-height: 1.7; max-width: 290px; margin-bottom: 20px; }
393
- .footer-socials { display: flex; gap: 8px; }
394
- .footer-social-btn {
395
- width: 34px; height: 34px; border-radius: 8px;
396
- border: 1px solid var(--border);
397
- background: transparent; color: var(--dim);
398
- display: flex; align-items: center; justify-content: center;
399
- cursor: pointer; transition: all 0.15s;
400
- }
401
- .footer-social-btn:hover { border-color: var(--muted); color: var(--text); background: var(--card); }
402
-
403
- .footer-col-title {
404
- font-size: 11px; font-weight: 700;
405
- text-transform: uppercase; letter-spacing: 0.1em;
406
- color: var(--muted); margin-bottom: 16px;
407
- }
408
- .footer-links { display: flex; flex-direction: column; gap: 9px; }
409
- .footer-link {
410
- display: inline-flex; align-items: center; gap: 7px;
411
- font-size: 13px; color: var(--dim);
412
- background: none; border: none; cursor: pointer;
413
- font-family: inherit; padding: 0;
414
- transition: color 0.15s; text-align: left;
415
- }
416
- .footer-link:hover { color: var(--text); }
417
-
418
- .footer-bottom {
419
- display: flex; align-items: center; justify-content: space-between;
420
- padding-top: 24px; border-top: 1px solid var(--border);
421
- }
422
- .footer-copy { font-size: 12px; color: var(--dim); }
423
- .footer-dot {
424
- width: 6px; height: 6px; border-radius: 50%;
425
- background: var(--success); box-shadow: 0 0 6px var(--success);
426
- animation: pulse 2s infinite;
427
- }
428
- @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
429
- </style>
430
- </head>
431
- <body>
432
-
433
- <nav class="left-nav" aria-label="Section navigation">
434
- <div class="left-nav-title">On this page</div>
435
- <a class="left-nav-link" data-target="sec-hero" href="#sec-hero">Overview</a>
436
- <a class="left-nav-link" data-target="sec-apps" href="#sec-apps">Apps</a>
437
- <a class="left-nav-link" data-target="sec-why" href="#sec-why">Philosophy</a>
438
- </nav>
439
-
440
- <!-- ══════════════════════════════════════
441
- HERO — Full-height, sci-fi grid
442
- ══════════════════════════════════════ -->
443
- <section class="hero" id="sec-hero">
444
- <div class="hero-glow"></div>
445
- <div class="hero-scanline"></div>
446
- <div class="hero-content">
447
-
448
- <div class="hero-eyebrow">
449
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
450
- Open Source &nbsp;·&nbsp; Free Forever
451
- </div>
452
-
453
- <h1 class="hero-title">Chahuadev</h1>
454
-
455
- <p class="hero-tagline">
456
- Building the <strong>next-generation desktop tools</strong>
457
- for developers and creators — fast, secure, and <strong>community-first</strong>.
458
- </p>
459
-
460
- <div class="hero-cta">
461
- <button class="btn-secondary" onclick="openLink('https://www.npmjs.com/~chahuadev')">
462
- <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M0 0h24v24H0V0zm6.154 19.2V8.727h3.693v8.146h1.846V8.727h1.846v10.473H6.154zm9.232-10.473v8.146h1.846v-6.4h1.846v6.4h1.846V8.727H15.386z"/></svg>
463
- View on npm
464
- </button>
465
- <button class="btn-secondary" onclick="openLink('https://huggingface.co/chahuadev')">
466
- <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><line x1="9" y1="9" x2="9.01" y2="9"/><line x1="15" y1="9" x2="15.01" y2="9"/></svg>
467
- View on Hugging Face
468
- </button>
469
- </div>
470
-
471
- <div class="hero-stat-strip">
472
- <div class="hstat-item">
473
- <div class="hstat-value" id="ws-downloads">—</div>
474
- <div class="hstat-label">Total Downloads</div>
475
- </div>
476
- <div class="hstat-item">
477
- <div class="hstat-value">4</div>
478
- <div class="hstat-label">Open Source Apps</div>
479
- </div>
480
- <div class="hstat-item">
481
- <div class="hstat-value">2+</div>
482
- <div class="hstat-label">Platforms</div>
483
- </div>
484
- </div>
485
-
486
- </div>
487
- </section>
488
-
489
- <!-- ══════════════════════════════════════
490
- PRODUCT SHOWCASE
491
- ══════════════════════════════════════ -->
492
- <div class="section-wrap" id="sec-apps">
493
- <div class="section-inner">
494
-
495
- <div class="section-label">Apps</div>
496
- <h2 class="section-heading">Powerful tools, zero bloat.</h2>
497
- <p class="section-sub">Every app is hand-crafted for developers who value speed, privacy, and control.</p>
498
-
499
- <!-- ── Junk Sweeper ── -->
500
- <div class="showcase-item">
501
-
502
- <div class="showcase-visual">
503
- <div class="win-bar">
504
- <div class="win-dot" style="background:#ef4444"></div>
505
- <div class="win-dot" style="background:#f59e0b"></div>
506
- <div class="win-dot" style="background:#22c55e"></div>
507
- </div>
508
- <div class="mock-body">
509
- <div class="mock-row hi">
510
- <div class="mock-dot" style="background:#f59e0b"></div>
511
- <div class="mock-bar" style="background:rgba(245,158,11,0.22);width:62%"></div>
512
- <div class="mock-val">Temp Files — 1.2 GB</div>
513
- </div>
514
- <div class="mock-row">
515
- <div class="mock-dot" style="background:#475569"></div>
516
- <div class="mock-bar" style="width:38%"></div>
517
- <div class="mock-val">npm cache — 340 MB</div>
518
- </div>
519
- <div class="mock-row hi">
520
- <div class="mock-dot" style="background:#f59e0b"></div>
521
- <div class="mock-bar" style="background:rgba(245,158,11,0.22);width:75%"></div>
522
- <div class="mock-val">Logs — 890 MB</div>
523
- </div>
524
- <div class="mock-row">
525
- <div class="mock-dot" style="background:#475569"></div>
526
- <div class="mock-bar" style="width:24%"></div>
527
- <div class="mock-val">Recycle Bin — 48 MB</div>
528
- </div>
529
- <div class="mock-row ok">
530
- <div class="mock-dot" style="background:#10b981"></div>
531
- <div class="mock-bar" style="background:rgba(16,185,129,0.2);width:90%"></div>
532
- <div class="mock-val">✓ Scanned 14,293 files</div>
533
- </div>
534
- </div>
535
- </div>
536
-
537
- <div>
538
- <span class="showcase-badge badge-warn">
539
- <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14H6L5 6"/><path d="M10 11v6M14 11v6"/><path d="M9 6V4h6v2"/></svg>
540
- Junk Sweeper
541
- </span>
542
- <h3 class="showcase-title">Clean your system.<br>Reclaim your drive.</h3>
543
- <p class="showcase-desc">
544
- A powerful desktop cleaner that intelligently scans for junk files, unused packages, temp data, and system debris — then sweeps them away in seconds.
545
- </p>
546
- <div class="feature-list">
547
- <div class="feature-row">
548
- <div class="feature-icon" style="background:rgba(245,158,11,0.12);color:#f59e0b">
549
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
550
- </div>
551
- <span>Smart multi-category scanner (temp, cache, logs, npm)</span>
552
- </div>
553
- <div class="feature-row">
554
- <div class="feature-icon" style="background:rgba(245,158,11,0.12);color:#f59e0b">
555
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
556
- </div>
557
- <span>Cross-platform: Windows EXE & Linux AppImage</span>
558
- </div>
559
- <div class="feature-row">
560
- <div class="feature-icon" style="background:rgba(245,158,11,0.12);color:#f59e0b">
561
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
562
- </div>
563
- <span>Safe-delete preview before any removal</span>
564
- </div>
565
- </div>
566
- <div class="dl-row">
567
- <button class="dl-os" onclick="goToDownloads('junk-sweeper')">
568
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
569
- Download windows linux
570
- </button>
571
- </div>
572
- </div>
573
- </div>
574
-
575
- <!-- ── Emoji Cleaner ── -->
576
- <div class="showcase-item reverse">
577
-
578
- <div>
579
- <span class="showcase-badge badge-blue">
580
- <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><circle cx="12" cy="12" r="10"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><line x1="9" y1="9" x2="9.01" y2="9"/><line x1="15" y1="9" x2="15.01" y2="9"/></svg>
581
- Emoji Cleaner
582
- </span>
583
- <h3 class="showcase-title">Strip emojis from<br>any file, instantly.</h3>
584
- <p class="showcase-desc">
585
- Batch-remove all emoji characters from text files, source code, and documents. Perfect for cleaning codebases, config files, and CI pipelines.
586
- </p>
587
- <div class="feature-list">
588
- <div class="feature-row">
589
- <div class="feature-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
590
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
591
- </div>
592
- <span>Supports 30+ programming and document languages</span>
593
- </div>
594
- <div class="feature-row">
595
- <div class="feature-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
596
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
597
- </div>
598
- <span>Desktop app (Electron) + npm CLI package</span>
599
- </div>
600
- <div class="feature-row">
601
- <div class="feature-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
602
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
603
- </div>
604
- <span>Drag &amp; drop entire folders with live preview</span>
605
- </div>
606
- </div>
607
- <div class="dl-row">
608
- <button class="dl-os" onclick="goToDownloads('emoji-cleaner')">
609
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
610
- Download windows linux
611
- </button>
612
- </div>
613
- </div>
614
-
615
- <div class="showcase-visual">
616
- <div class="win-bar">
617
- <div class="win-dot" style="background:#ef4444"></div>
618
- <div class="win-dot" style="background:#f59e0b"></div>
619
- <div class="win-dot" style="background:#22c55e"></div>
620
- </div>
621
- <div class="mock-code">
622
- <div>
623
- <div class="code-label">Input</div>
624
- <div class="code-block" style="color:var(--sub)">
625
- Hello 👋 world 🌍<br>
626
- Bug fixed 🐛 ✅<br>
627
- Deploy 🚀 done!
628
- </div>
629
- </div>
630
- <div class="code-status" style="color:var(--success)">▶ Cleaning 3 lines...</div>
631
- <div>
632
- <div class="code-label">Output</div>
633
- <div class="code-block out" style="color:var(--text)">
634
- Hello &nbsp;world<br>
635
- Bug fixed<br>
636
- Deploy &nbsp;done!
637
- </div>
638
- </div>
639
- <div class="code-status" style="color:var(--success)">✓ Removed 5 emoji characters</div>
640
- </div>
641
- </div>
642
-
643
- </div>
644
-
645
- <!-- ── Emoji Cleaner Tool CLI ── -->
646
- <div class="showcase-item">
647
-
648
- <div class="showcase-visual">
649
- <div class="win-bar">
650
- <div class="win-dot" style="background:#ef4444"></div>
651
- <div class="win-dot" style="background:#f59e0b"></div>
652
- <div class="win-dot" style="background:#22c55e"></div>
653
- </div>
654
- <div class="mock-code">
655
- <div class="code-label">Terminal</div>
656
- <div class="code-block" style="color:var(--success);font-size:10px;line-height:1.5">
657
- $ emoji-cleaner --help<br>
658
- <span style="color:var(--sub)">Emoji Cleaner v2.0.0</span><br>
659
- $ emoji-cleaner input.js -o output.js<br>
660
- <span style="color:var(--success)">✓ Processed 1 file</span><br>
661
- <span style="color:var(--success)">✓ Removed 8 emoji</span>
662
- </div>
663
- </div>
664
- </div>
665
-
666
- <div>
667
- <span class="showcase-badge badge-blue">
668
- <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M4 7v10a2 2 0 002 2h12a2 2 0 002-2V7M9 11h6M9 15h6"/></svg>
669
- Emoji Cleaner Tool
670
- </span>
671
- <h3 class="showcase-title">CLI tool for<br>batch emoji removal.</h3>
672
- <p class="showcase-desc">
673
- The command-line version of Emoji Cleaner. Perfect for CI/CD pipelines, build scripts, and automated batch processing of large codebases.
674
- </p>
675
- <div class="feature-list">
676
- <div class="feature-row">
677
- <div class="feature-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
678
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
679
- </div>
680
- <span>Simple CLI command: <code style="color:var(--accent)">emoji-cleaner file.js -o output.js</code></span>
681
- </div>
682
- <div class="feature-row">
683
- <div class="feature-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
684
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
685
- </div>
686
- <span>Batch processing & piping support for automation</span>
687
- </div>
688
- <div class="feature-row">
689
- <div class="feature-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
690
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
691
- </div>
692
- <span>Fast processing with human-readable output</span>
693
- </div>
694
- </div>
695
- <div class="dl-row">
696
- <button class="dl-os" onclick="goToDownloads('emoji-cleaner-tool')">
697
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
698
- Get CLI
699
- </button>
700
- </div>
701
- </div>
702
- </div>
703
-
704
- <!-- ── Chahuadev Framework ── -->
705
- <div class="showcase-item">
706
-
707
- <div class="showcase-visual">
708
- <div class="win-bar">
709
- <div class="win-dot" style="background:#ef4444"></div>
710
- <div class="win-dot" style="background:#f59e0b"></div>
711
- <div class="win-dot" style="background:#22c55e"></div>
712
- </div>
713
- <div class="mock-code">
714
- <div class="code-label">Framework Console</div>
715
- <div class="code-block" style="color:var(--success);font-size:10px;line-height:1.5">
716
- <span style="color:var(--sub)">$ chahuadev-framework --version</span><br>
717
- Chahuadev Framework v2.1.0<br>
718
- <span style="color:var(--sub)">$ chahuadev-framework init my-project</span><br>
719
- <span style="color:var(--success)">✓ Project initialized</span><br>
720
- <span style="color:var(--sub)">$ npm start</span><br>
721
- <span style="color:var(--success)">▶ Dev server running on port 3000</span>
722
- </div>
723
- </div>
724
- </div>
725
-
726
- <div>
727
- <span class="showcase-badge badge-blue">
728
- <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="M3 9h18"/><path d="M9 3v18"/></svg>
729
- Chahuadev Framework
730
- </span>
731
- <h3 class="showcase-title">Modular framework<br>for fast development.</h3>
732
- <p class="showcase-desc">
733
- A complete development framework with built-in utilities, debugging tools, and plugin architecture. Perfect for teams building scalable, maintainable applications with confidence.
734
- </p>
735
- <div class="feature-list">
736
- <div class="feature-row">
737
- <div class="feature-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
738
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
739
- </div>
740
- <span>Modular plugin architecture with 20+ built-in modules</span>
741
- </div>
742
- <div class="feature-row">
743
- <div class="feature-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
744
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
745
- </div>
746
- <span>Real-time debugging, API tracing, and performance monitoring</span>
747
- </div>
748
- <div class="feature-row">
749
- <div class="feature-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
750
- <svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><polyline points="20 6 9 17 4 12"/></svg>
751
- </div>
752
- <span>Multi-language support (English, Thai, Chinese, etc.)</span>
753
- </div>
754
- </div>
755
- <div class="dl-row">
756
- <button class="dl-os" onclick="goToDownloads('chahuadev-framework')">
757
- <svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M0 0h24v24H0V0zm6.154 19.2V8.727h3.693v8.146h1.846V8.727h1.846v10.473H6.154zm9.232-10.473v8.146h1.846v-6.4h1.846v6.4h1.846V8.727H15.386z"/></svg>
758
- Download windows linux
759
- </button>
760
- </div>
761
- </div>
762
- </div>
763
-
764
- </div>
765
- </div>
766
-
767
- <!-- ══════════════════════════════════════
768
- WHY CHAHUADEV
769
- ══════════════════════════════════════ -->
770
- <div class="section-wrap why-bg" id="sec-why">
771
- <div class="section-inner">
772
-
773
- <div class="section-label">Philosophy</div>
774
- <h2 class="section-heading">Why choose Chahuadev?</h2>
775
- <p class="section-sub">Every tool is built with a clear mission: developer experience first, no exceptions.</p>
776
-
777
- <div class="why-grid">
778
-
779
- <div class="why-card">
780
- <div class="why-icon" style="background:rgba(124,58,237,0.12);color:#a78bfa">
781
- <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
782
- </div>
783
- <div class="why-title">Secure by Design</div>
784
- <div class="why-desc">Built on Electron with Context Isolation, Content Security Policy, and sandboxed renderers. Your data stays on your machine — always.</div>
785
- </div>
786
-
787
- <div class="why-card">
788
- <div class="why-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
789
- <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg>
790
- </div>
791
- <div class="why-title">Blazing Fast</div>
792
- <div class="why-desc">Low resource footprint, instant startup, and optimized I/O. Built for developers who can't afford to wait on their own tools.</div>
793
- </div>
794
-
795
- <div class="why-card">
796
- <div class="why-icon" style="background:rgba(16,185,129,0.12);color:#34d399">
797
- <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
798
- </div>
799
- <div class="why-title">Open &amp; Free</div>
800
- <div class="why-desc">No subscriptions, no paywalls, no telemetry. Every app is free software built with love for the open source community.</div>
801
- </div>
802
-
803
- <div class="why-card">
804
- <div class="why-icon" style="background:rgba(245,158,11,0.12);color:#f59e0b">
805
- <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/></svg>
806
- </div>
807
- <div class="why-title">Cross-Platform</div>
808
- <div class="why-desc">Windows and Linux support across all apps. Same experience, same performance — any operating system you choose.</div>
809
- </div>
810
-
811
- </div>
812
- </div>
813
- </div>
814
-
815
- <!-- ══════════════════════════════════════
816
- FOOTER — Multi-column, official
817
- ══════════════════════════════════════ -->
818
- <footer class="footer">
819
- <div class="footer-inner">
820
- <div class="footer-grid">
821
-
822
- <!-- Col 1: Brand -->
823
- <div>
824
- <div class="footer-brand-name">Chahuadev</div>
825
- <p class="footer-brand-desc">Open-source desktop tools for developers and creators. From Chaos to Code.</p>
826
- <div class="footer-socials">
827
- <button class="footer-social-btn" title="TikTok" onclick="openLink('https://www.tiktok.com/@chahuadev?is_from_webapp=1&sender_device=pc')">
828
- <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5"/></svg>
829
- </button>
830
- <button class="footer-social-btn" title="Hugging Face" onclick="openLink('https://huggingface.co/chahuadev')">
831
- <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><line x1="9" y1="9" x2="9.01" y2="9"/><line x1="15" y1="9" x2="15.01" y2="9"/></svg>
832
- </button>
833
- <button class="footer-social-btn" title="npm" onclick="openLink('https://www.npmjs.com/org/chahuadev')">
834
- <svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M0 0h24v24H0V0zm6.154 19.2V8.727h3.693v8.146h1.846V8.727h1.846v10.473H6.154zm9.232-10.473v8.146h1.846v-6.4h1.846v6.4h1.846V8.727H15.386z"/></svg>
835
- </button>
836
- </div>
837
- </div>
838
-
839
- <!-- Col 2: Products -->
840
- <div>
841
- <div class="footer-col-title">Products</div>
842
- <div class="footer-links">
843
- <button class="footer-link" onclick="openLink('https://pub-419d22521da042dfb27d1f404b3eb8a6.r2.dev/Junk%20Sweeper%201.0.0.exe')">
844
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14H6L5 6"/></svg>
845
- Junk Sweeper
846
- </button>
847
- <button class="footer-link" onclick="openLink('https://pub-419d22521da042dfb27d1f404b3eb8a6.r2.dev/Emoji%20Cleaner.exe')">
848
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/></svg>
849
- Emoji Cleaner
850
- </button>
851
- <button class="footer-link" onclick="openLink('https://pub-419d22521da042dfb27d1f404b3eb8a6.r2.dev/Chahuadev-Framework.exe')">
852
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/></svg>
853
- Framework
854
- </button>
855
- <button class="footer-link" onclick="openLink('https://huggingface.co/chahuadev')">
856
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/></svg>
857
- Hub
858
- </button>
859
- </div>
860
- </div>
861
-
862
- <!-- Col 3: Community -->
863
- <div>
864
- <div class="footer-col-title">Community</div>
865
- <div class="footer-links">
866
- <button class="footer-link" onclick="openLink('https://www.tiktok.com/@chahuadev?is_from_webapp=1&sender_device=pc')">
867
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5"/></svg>
868
- TikTok
869
- </button>
870
- <button class="footer-link" onclick="openLink('https://huggingface.co/chahuadev')">
871
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><line x1="9" y1="9" x2="9.01" y2="9"/><line x1="15" y1="9" x2="15.01" y2="9"/></svg>
872
- Hugging Face
873
- </button>
874
- <button class="footer-link" onclick="openLink('https://www.npmjs.com/org/chahuadev')">
875
- <svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M0 0h24v24H0V0zm6.154 19.2V8.727h3.693v8.146h1.846V8.727h1.846v10.473H6.154zm9.232-10.473v8.146h1.846v-6.4h1.846v6.4h1.846V8.727H15.386z"/></svg>
876
- npm
877
- </button>
878
- </div>
879
- </div>
880
-
881
- </div>
882
-
883
- <div class="footer-bottom">
884
- <div class="footer-copy">Chahuadev &copy; 2026 &nbsp;·&nbsp; From Chaos to Code</div>
885
- <div class="footer-dot" title="Online"></div>
886
- </div>
887
- </div>
888
- </footer>
889
-
890
- <script>
891
- function openLink(url) {
892
- window.parent.postMessage({ type: 'openLink', url: url }, '*');
893
- }
894
-
895
- function goToDownloads(appName) {
896
- window.parent.postMessage({ type: 'goToDownloads', app: appName }, '*');
897
- }
898
-
899
- function installNpmPackage(packageName) {
900
- window.parent.postMessage({ type: 'goToDownloads', app: packageName }, '*');
901
- }
902
-
903
- function openInstallerFolder(packageName) {
904
- window.parent.postMessage({ type: 'openNpmFolder', package: packageName }, '*');
905
- }
906
-
907
- // Left sidebar jump links + active section sync
908
- (function initLeftNavScrollSpy() {
909
- const navLinks = Array.from(document.querySelectorAll('.left-nav-link[data-target]'));
910
- const sections = navLinks
911
- .map(link => document.getElementById(link.dataset.target))
912
- .filter(Boolean);
913
-
914
- if (!navLinks.length || !sections.length) return;
915
-
916
- function setActive(targetId) {
917
- navLinks.forEach(link => {
918
- const isActive = link.dataset.target === targetId;
919
- link.classList.toggle('active', isActive);
920
- });
921
- }
922
-
923
- navLinks.forEach(link => {
924
- link.addEventListener('click', (e) => {
925
- e.preventDefault();
926
- const target = document.getElementById(link.dataset.target);
927
- if (!target) return;
928
- target.scrollIntoView({ behavior: 'smooth', block: 'start' });
929
- setActive(link.dataset.target);
930
- });
931
- });
932
-
933
- const observer = new IntersectionObserver((entries) => {
934
- const visible = entries
935
- .filter(en => en.isIntersecting)
936
- .sort((a, b) => b.intersectionRatio - a.intersectionRatio);
937
- if (visible.length > 0) {
938
- setActive(visible[0].target.id);
939
- }
940
- }, {
941
- root: null,
942
- rootMargin: '-28% 0px -58% 0px',
943
- threshold: [0.15, 0.3, 0.55]
944
- });
945
-
946
- sections.forEach(sec => observer.observe(sec));
947
-
948
- const hashTarget = window.location.hash ? window.location.hash.slice(1) : null;
949
- if (hashTarget && sections.some(sec => sec.id === hashTarget)) {
950
- setActive(hashTarget);
951
- } else {
952
- setActive(sections[0].id);
953
- }
954
- })();
955
-
956
- window.addEventListener('message', function(e) {
957
- if (!e.data || e.data.type !== 'stats') return;
958
- const s = e.data.stats || {};
959
- const el = document.getElementById('ws-downloads');
960
- if (el) el.textContent = (s.totalDownloads ?? 0).toLocaleString();
961
- });
962
- </script>
963
- </body>
964
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Chahuadev — Building Next-Generation Desktop Tools</title>
7
+ <link rel="preconnect" href="https://fonts.googleapis.com">
8
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
9
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap" rel="stylesheet">
10
+ <style>
11
+ *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
12
+ :root {
13
+ --bg: #09090f; --surface: #0f172a; --card: #1e293b; --border: #334155;
14
+ --muted: #475569; --dim: #64748b; --sub: #94a3b8; --text: #f1f5f9;
15
+ --accent: #3b82f6; --success: #10b981; --warn: #f59e0b; --purple: #7c3aed;
16
+ --purple-light: #a78bfa; --blue-light: #60a5fa;
17
+ }
18
+ html, body { overflow-x: hidden; scroll-behavior: smooth; }
19
+ body {
20
+ font-family: 'Inter', system-ui, sans-serif;
21
+ background: var(--bg);
22
+ color: var(--text);
23
+ font-size: 14px;
24
+ line-height: 1.6;
25
+ }
26
+ [id^="sec-"] { scroll-margin-top: 90px; }
27
+ ::-webkit-scrollbar { width: 5px; }
28
+ ::-webkit-scrollbar-track { background: transparent; }
29
+ ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
30
+
31
+ /* ══════════════════════════════════════
32
+ LEFT SIDEBAR NAV
33
+ ══════════════════════════════════════ */
34
+ .left-nav {
35
+ position: fixed;
36
+ left: 16px;
37
+ top: 96px;
38
+ width: 190px;
39
+ z-index: 25;
40
+ display: flex;
41
+ flex-direction: column;
42
+ gap: 8px;
43
+ max-height: calc(100vh - 120px);
44
+ overflow-y: auto;
45
+ padding-right: 4px;
46
+ }
47
+ .left-nav-title {
48
+ font-size: 10px;
49
+ letter-spacing: 0.08em;
50
+ text-transform: uppercase;
51
+ color: #60a5fa;
52
+ margin-bottom: 4px;
53
+ padding-left: 2px;
54
+ font-family: 'Courier New', monospace;
55
+ }
56
+ .left-nav-link {
57
+ display: block;
58
+ text-decoration: none;
59
+ color: #9fb0c7;
60
+ background: rgba(15, 23, 42, 0.35);
61
+ border: 1px solid rgba(148, 163, 184, 0.22);
62
+ border-radius: 10px;
63
+ padding: 8px 10px;
64
+ font-size: 11px;
65
+ line-height: 1.35;
66
+ transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.18s;
67
+ backdrop-filter: blur(5px);
68
+ }
69
+ .left-nav-link:hover {
70
+ color: #dbeafe;
71
+ border-color: rgba(96, 165, 250, 0.5);
72
+ background: rgba(30, 41, 59, 0.5);
73
+ transform: translateX(2px);
74
+ }
75
+ .left-nav-link.active {
76
+ color: #eff6ff;
77
+ border-color: rgba(96, 165, 250, 0.8);
78
+ background: rgba(37, 99, 235, 0.22);
79
+ box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.22);
80
+ }
81
+
82
+ @media (max-width: 1260px) {
83
+ .left-nav { display: none; }
84
+ }
85
+
86
+ /* ══════════════════════════════════════
87
+ HERO
88
+ ══════════════════════════════════════ */
89
+ .hero {
90
+ position: relative;
91
+ min-height: 100vh;
92
+ display: flex;
93
+ flex-direction: column;
94
+ align-items: center;
95
+ justify-content: center;
96
+ text-align: center;
97
+ padding: 100px 40px 80px;
98
+ overflow: hidden;
99
+ }
100
+ /* Sci-fi grid background */
101
+ .hero::before {
102
+ content: '';
103
+ position: absolute;
104
+ inset: 0;
105
+ background-image:
106
+ linear-gradient(rgba(124,58,237,0.07) 1px, transparent 1px),
107
+ linear-gradient(90deg, rgba(124,58,237,0.07) 1px, transparent 1px);
108
+ background-size: 60px 60px;
109
+ mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 20%, transparent 100%);
110
+ -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 20%, transparent 100%);
111
+ pointer-events: none;
112
+ }
113
+ /* Ambient glow orbs */
114
+ .hero-glow {
115
+ position: absolute;
116
+ inset: 0;
117
+ background:
118
+ radial-gradient(ellipse 700px 400px at 25% 15%, rgba(124,58,237,0.16), transparent 70%),
119
+ radial-gradient(ellipse 600px 350px at 80% 85%, rgba(59,130,246,0.11), transparent 70%);
120
+ pointer-events: none;
121
+ }
122
+ /* Floating scan-line animation */
123
+ .hero-scanline {
124
+ position: absolute;
125
+ left: 0; right: 0;
126
+ height: 2px;
127
+ background: linear-gradient(90deg, transparent, rgba(124,58,237,0.35), transparent);
128
+ animation: scan 7s linear infinite;
129
+ pointer-events: none;
130
+ }
131
+ @keyframes scan { 0% { transform: translateY(-50px); } 100% { transform: translateY(105vh); } }
132
+
133
+ .hero-content { position: relative; z-index: 1; max-width: 800px; }
134
+
135
+ .hero-eyebrow {
136
+ display: inline-flex; align-items: center; gap: 7px;
137
+ padding: 5px 16px;
138
+ border-radius: 20px;
139
+ border: 1px solid rgba(124,58,237,0.3);
140
+ background: rgba(124,58,237,0.08);
141
+ color: var(--purple-light);
142
+ font-size: 12px; font-weight: 600;
143
+ letter-spacing: 0.05em; text-transform: uppercase;
144
+ margin-bottom: 32px;
145
+ }
146
+ .hero-title {
147
+ font-size: clamp(52px, 10vw, 96px);
148
+ font-weight: 900;
149
+ line-height: 0.95;
150
+ letter-spacing: -0.04em;
151
+ background: linear-gradient(140deg, #f1f5f9 0%, #c4b5fd 50%, #60a5fa 100%);
152
+ -webkit-background-clip: text; -webkit-text-fill-color: transparent;
153
+ background-clip: text;
154
+ margin-bottom: 24px;
155
+ }
156
+ .hero-tagline {
157
+ font-size: clamp(16px, 2.2vw, 21px);
158
+ color: var(--sub);
159
+ font-weight: 400;
160
+ line-height: 1.6;
161
+ max-width: 580px;
162
+ margin: 0 auto 44px;
163
+ }
164
+ .hero-tagline strong { color: var(--text); font-weight: 600; }
165
+
166
+ .hero-cta {
167
+ display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
168
+ margin-bottom: 64px;
169
+ }
170
+ .btn-primary {
171
+ display: inline-flex; align-items: center; gap: 9px;
172
+ padding: 15px 30px;
173
+ border-radius: 10px;
174
+ background: linear-gradient(135deg, #7c3aed, #6d28d9);
175
+ color: #fff;
176
+ font-size: 15px; font-weight: 700; font-family: inherit;
177
+ border: none; cursor: pointer;
178
+ box-shadow: 0 0 32px rgba(124,58,237,0.35);
179
+ transition: all 0.2s;
180
+ }
181
+ .btn-primary:hover {
182
+ transform: translateY(-2px);
183
+ box-shadow: 0 0 48px rgba(124,58,237,0.55);
184
+ background: linear-gradient(135deg, #8b5cf6, #7c3aed);
185
+ }
186
+ .btn-secondary {
187
+ display: inline-flex; align-items: center; gap: 9px;
188
+ padding: 15px 30px;
189
+ border-radius: 10px;
190
+ background: transparent;
191
+ color: var(--sub);
192
+ font-size: 15px; font-weight: 600; font-family: inherit;
193
+ border: 1px solid var(--border); cursor: pointer;
194
+ transition: all 0.2s;
195
+ }
196
+ .btn-secondary:hover { border-color: var(--muted); color: var(--text); background: var(--card); }
197
+
198
+ .hero-stat-strip {
199
+ display: flex; gap: 52px; justify-content: center; flex-wrap: wrap;
200
+ padding-top: 28px;
201
+ border-top: 1px solid rgba(255,255,255,0.07);
202
+ }
203
+ .hstat-item { text-align: center; }
204
+ .hstat-value {
205
+ font-size: 30px; font-weight: 800;
206
+ background: linear-gradient(135deg, #a78bfa, #60a5fa);
207
+ -webkit-background-clip: text; -webkit-text-fill-color: transparent;
208
+ background-clip: text;
209
+ }
210
+ .hstat-label { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 3px; }
211
+
212
+ /* ══════════════════════════════════════
213
+ SHARED SECTION LAYOUT
214
+ ══════════════════════════════════════ */
215
+ .section-wrap {
216
+ padding: 96px 40px;
217
+ border-top: 1px solid var(--border);
218
+ }
219
+ .section-inner { max-width: 1100px; margin: 0 auto; }
220
+
221
+ .section-label {
222
+ display: flex; align-items: center; gap: 10px;
223
+ font-size: 11px; font-weight: 700;
224
+ text-transform: uppercase; letter-spacing: 0.1em;
225
+ color: var(--purple-light);
226
+ margin-bottom: 12px;
227
+ }
228
+ .section-label::before {
229
+ content: '';
230
+ width: 3px; height: 16px;
231
+ border-radius: 2px;
232
+ background: linear-gradient(180deg, #7c3aed, #3b82f6);
233
+ flex-shrink: 0;
234
+ }
235
+ .section-heading {
236
+ font-size: clamp(28px, 4vw, 44px);
237
+ font-weight: 800; letter-spacing: -0.03em; line-height: 1.1;
238
+ color: var(--text);
239
+ margin-bottom: 16px;
240
+ }
241
+ .section-sub {
242
+ font-size: 16px; color: var(--sub);
243
+ max-width: 520px; line-height: 1.75;
244
+ }
245
+
246
+ /* ══════════════════════════════════════
247
+ APPS DATA SECTION
248
+ ══════════════════════════════════════ */
249
+ .apps-stack {
250
+ display: flex;
251
+ flex-direction: column;
252
+ gap: 18px;
253
+ margin-top: 38px;
254
+ }
255
+ .app-dossier {
256
+ border: 1px solid rgba(96,165,250,0.3);
257
+ background: linear-gradient(180deg, rgba(30,41,59,0.6) 0%, rgba(15,23,42,0.72) 100%);
258
+ border-radius: 16px;
259
+ padding: 16px;
260
+ box-shadow: 0 12px 34px rgba(2, 12, 28, 0.35);
261
+ }
262
+ .app-top {
263
+ display: grid;
264
+ grid-template-columns: 320px 1fr;
265
+ gap: 16px;
266
+ margin-bottom: 14px;
267
+ }
268
+ .app-shot-wrap {
269
+ border: 1px solid rgba(148,163,184,0.25);
270
+ background: rgba(2, 6, 23, 0.55);
271
+ border-radius: 12px;
272
+ overflow: hidden;
273
+ }
274
+ .app-shot {
275
+ width: 100%;
276
+ display: block;
277
+ aspect-ratio: 16/10;
278
+ object-fit: cover;
279
+ }
280
+ .app-header {
281
+ display: flex;
282
+ align-items: center;
283
+ justify-content: space-between;
284
+ gap: 10px;
285
+ margin-bottom: 8px;
286
+ flex-wrap: wrap;
287
+ }
288
+ .app-name {
289
+ font-size: 22px;
290
+ line-height: 1.15;
291
+ font-weight: 800;
292
+ color: #dbeafe;
293
+ letter-spacing: -0.02em;
294
+ }
295
+ .app-tag {
296
+ display: inline-flex;
297
+ align-items: center;
298
+ border: 1px solid rgba(96,165,250,0.45);
299
+ border-radius: 999px;
300
+ padding: 4px 10px;
301
+ font-size: 10px;
302
+ letter-spacing: 0.08em;
303
+ text-transform: uppercase;
304
+ color: #93c5fd;
305
+ background: rgba(30,58,138,0.2);
306
+ font-family: 'Courier New', monospace;
307
+ }
308
+ .app-desc {
309
+ color: #b8c7dc;
310
+ font-size: 14px;
311
+ line-height: 1.75;
312
+ margin-bottom: 10px;
313
+ }
314
+ .app-meta-row {
315
+ display: grid;
316
+ grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
317
+ gap: 9px;
318
+ margin-bottom: 10px;
319
+ }
320
+ .meta-chip {
321
+ border: 1px solid rgba(148,163,184,0.2);
322
+ background: rgba(15,23,42,0.7);
323
+ border-radius: 10px;
324
+ padding: 8px 10px;
325
+ }
326
+ .meta-k {
327
+ font-size: 10px;
328
+ color: #94a3b8;
329
+ text-transform: uppercase;
330
+ letter-spacing: 0.08em;
331
+ margin-bottom: 2px;
332
+ font-family: 'Courier New', monospace;
333
+ }
334
+ .meta-v {
335
+ font-size: 12px;
336
+ color: #e2e8f0;
337
+ word-break: break-word;
338
+ }
339
+ .app-columns {
340
+ display: grid;
341
+ grid-template-columns: 1.1fr 1fr;
342
+ gap: 12px;
343
+ }
344
+ .app-block {
345
+ border: 1px solid rgba(148,163,184,0.17);
346
+ background: rgba(2,6,23,0.45);
347
+ border-radius: 11px;
348
+ padding: 10px 11px;
349
+ overflow-x: auto;
350
+ }
351
+ .app-block-title {
352
+ font-size: 11px;
353
+ letter-spacing: 0.08em;
354
+ text-transform: uppercase;
355
+ color: #93c5fd;
356
+ margin-bottom: 7px;
357
+ font-family: 'Courier New', monospace;
358
+ font-weight: 700;
359
+ }
360
+ .app-list {
361
+ margin: 0;
362
+ padding-left: 16px;
363
+ color: #b7c7dd;
364
+ font-size: 13px;
365
+ line-height: 1.62;
366
+ }
367
+ .bin-table {
368
+ width: 100%;
369
+ border-collapse: collapse;
370
+ min-width: 430px;
371
+ font-size: 12px;
372
+ color: #c8d5e7;
373
+ }
374
+ .bin-table th,
375
+ .bin-table td {
376
+ border: 1px solid rgba(148,163,184,0.16);
377
+ padding: 6px 7px;
378
+ text-align: left;
379
+ }
380
+ .bin-table th {
381
+ color: #dbeafe;
382
+ background: rgba(30,58,138,0.2);
383
+ font-weight: 700;
384
+ font-size: 11px;
385
+ text-transform: uppercase;
386
+ letter-spacing: 0.06em;
387
+ }
388
+ .app-links {
389
+ margin-top: 10px;
390
+ display: flex;
391
+ gap: 8px;
392
+ flex-wrap: wrap;
393
+ }
394
+ .app-link {
395
+ border: 1px solid rgba(96,165,250,0.34);
396
+ border-radius: 8px;
397
+ padding: 7px 10px;
398
+ font-size: 12px;
399
+ color: #dbeafe;
400
+ background: rgba(30,58,138,0.18);
401
+ text-decoration: none;
402
+ transition: all 0.15s;
403
+ }
404
+ .app-link:hover {
405
+ background: rgba(37,99,235,0.28);
406
+ border-color: rgba(147,197,253,0.75);
407
+ }
408
+ @media (max-width: 980px) {
409
+ .app-top,
410
+ .app-columns {
411
+ grid-template-columns: 1fr;
412
+ }
413
+ .section-wrap,
414
+ .hero,
415
+ .footer {
416
+ padding-left: 20px;
417
+ padding-right: 20px;
418
+ }
419
+ .footer-grid {
420
+ grid-template-columns: 1fr;
421
+ gap: 26px;
422
+ }
423
+ .footer-bottom {
424
+ flex-direction: column;
425
+ align-items: flex-start;
426
+ gap: 10px;
427
+ }
428
+ }
429
+
430
+ @media (max-width: 640px) {
431
+ .app-name {
432
+ font-size: 19px;
433
+ }
434
+ .app-desc,
435
+ .app-list,
436
+ .meta-v {
437
+ font-size: 13px;
438
+ }
439
+ .section-heading {
440
+ font-size: clamp(26px, 8vw, 36px);
441
+ }
442
+ }
443
+
444
+ /* ══════════════════════════════════════
445
+ WHY CHAHUADEV
446
+ ══════════════════════════════════════ */
447
+ .why-bg {
448
+ background: linear-gradient(180deg, transparent 0%, rgba(124,58,237,0.04) 40%, transparent 100%);
449
+ }
450
+ .why-grid {
451
+ display: grid;
452
+ grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
453
+ gap: 20px;
454
+ margin-top: 56px;
455
+ }
456
+ .why-card {
457
+ background: var(--card);
458
+ border: 1px solid var(--border);
459
+ border-radius: 14px;
460
+ padding: 28px 24px;
461
+ transition: border-color 0.2s, transform 0.2s;
462
+ }
463
+ .why-card:hover { border-color: var(--muted); transform: translateY(-3px); }
464
+ .why-icon {
465
+ width: 46px; height: 46px; border-radius: 12px;
466
+ display: flex; align-items: center; justify-content: center;
467
+ margin-bottom: 18px;
468
+ }
469
+ .why-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
470
+ .why-desc { font-size: 13px; color: var(--sub); line-height: 1.65; }
471
+
472
+ /* ══════════════════════════════════════
473
+ FOOTER
474
+ ══════════════════════════════════════ */
475
+ .footer {
476
+ border-top: 1px solid var(--border);
477
+ padding: 64px 40px 36px;
478
+ }
479
+ .footer-inner { max-width: 1100px; margin: 0 auto; }
480
+ .footer-grid {
481
+ display: grid;
482
+ grid-template-columns: 2fr 1fr 1fr;
483
+ gap: 48px;
484
+ margin-bottom: 48px;
485
+ }
486
+ .footer-brand-name {
487
+ font-size: 19px; font-weight: 800;
488
+ background: linear-gradient(135deg, #f1f5f9 0%, #a78bfa 100%);
489
+ -webkit-background-clip: text; -webkit-text-fill-color: transparent;
490
+ background-clip: text;
491
+ margin-bottom: 10px;
492
+ }
493
+ .footer-brand-desc { font-size: 13px; color: var(--dim); line-height: 1.7; max-width: 290px; margin-bottom: 20px; }
494
+ .footer-socials { display: flex; gap: 8px; }
495
+ .footer-social-btn {
496
+ width: 34px; height: 34px; border-radius: 8px;
497
+ border: 1px solid var(--border);
498
+ background: transparent; color: var(--dim);
499
+ display: flex; align-items: center; justify-content: center;
500
+ cursor: pointer; transition: all 0.15s;
501
+ }
502
+ .footer-social-btn:hover { border-color: var(--muted); color: var(--text); background: var(--card); }
503
+
504
+ .footer-col-title {
505
+ font-size: 11px; font-weight: 700;
506
+ text-transform: uppercase; letter-spacing: 0.1em;
507
+ color: var(--muted); margin-bottom: 16px;
508
+ }
509
+ .footer-links { display: flex; flex-direction: column; gap: 9px; }
510
+ .footer-link {
511
+ display: inline-flex; align-items: center; gap: 7px;
512
+ font-size: 13px; color: var(--dim);
513
+ background: none; border: none; cursor: pointer;
514
+ font-family: inherit; padding: 0;
515
+ transition: color 0.15s; text-align: left;
516
+ }
517
+ .footer-link:hover { color: var(--text); }
518
+
519
+ .footer-bottom {
520
+ display: flex; align-items: center; justify-content: space-between;
521
+ padding-top: 24px; border-top: 1px solid var(--border);
522
+ }
523
+ .footer-copy { font-size: 12px; color: var(--dim); }
524
+ .footer-dot {
525
+ width: 6px; height: 6px; border-radius: 50%;
526
+ background: var(--success); box-shadow: 0 0 6px var(--success);
527
+ animation: pulse 2s infinite;
528
+ }
529
+ @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }
530
+ </style>
531
+ </head>
532
+ <body>
533
+
534
+ <nav class="left-nav" aria-label="Section navigation">
535
+ <div class="left-nav-title">On this page</div>
536
+ <a class="left-nav-link" data-target="sec-hero" href="#sec-hero">Overview</a>
537
+ <a class="left-nav-link" data-target="sec-apps" href="#sec-apps">Apps</a>
538
+ <a class="left-nav-link" data-target="sec-why" href="#sec-why">Philosophy</a>
539
+ </nav>
540
+
541
+ <!-- ══════════════════════════════════════
542
+ HERO — Full-height, sci-fi grid
543
+ ══════════════════════════════════════ -->
544
+ <section class="hero" id="sec-hero">
545
+ <div class="hero-glow"></div>
546
+ <div class="hero-scanline"></div>
547
+ <div class="hero-content">
548
+
549
+ <div class="hero-eyebrow">
550
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
551
+ Open Source
552
+ </div>
553
+
554
+ <h1 class="hero-title">Chahuadev</h1>
555
+
556
+ <p class="hero-tagline">
557
+ Building the <strong>next-generation desktop tools</strong>
558
+ for developers and creators — fast, secure, and <strong>community-first</strong>.
559
+ </p>
560
+
561
+ <div class="hero-cta">
562
+ <button class="btn-secondary" onclick="openLink('https://www.npmjs.com/org/chahuadev')">
563
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M0 0h24v24H0V0zm6.154 19.2V8.727h3.693v8.146h1.846V8.727h1.846v10.473H6.154zm9.232-10.473v8.146h1.846v-6.4h1.846v6.4h1.846V8.727H15.386z"/></svg>
564
+ View on npm
565
+ </button>
566
+ <button class="btn-secondary" onclick="openLink('https://huggingface.co/chahuadev')">
567
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><line x1="9" y1="9" x2="9.01" y2="9"/><line x1="15" y1="9" x2="15.01" y2="9"/></svg>
568
+ View on Hugging Face
569
+ </button>
570
+ </div>
571
+
572
+ <div class="hero-stat-strip">
573
+ <div class="hstat-item">
574
+ <div class="hstat-value" id="ws-downloads">—</div>
575
+ <div class="hstat-label">Total Downloads</div>
576
+ </div>
577
+ <div class="hstat-item">
578
+ <div class="hstat-value">5</div>
579
+ <div class="hstat-label">Open Source Apps</div>
580
+ </div>
581
+ <div class="hstat-item">
582
+ <div class="hstat-value">2+</div>
583
+ <div class="hstat-label">Platforms</div>
584
+ </div>
585
+ </div>
586
+
587
+ </div>
588
+ </section>
589
+
590
+ <!-- ══════════════════════════════════════
591
+ APPS DATA (DETAILED)
592
+ ══════════════════════════════════════ -->
593
+ <div class="section-wrap" id="sec-apps">
594
+ <div class="section-inner">
595
+
596
+ <div class="section-label">Apps</div>
597
+ <h2 class="section-heading">Project Data Section</h2>
598
+ <p class="section-sub">Complete project dossiers for the 5 core apps in a clean black/blue transparent layout, focused on technical information and release coverage.</p>
599
+
600
+ <div class="apps-stack">
601
+
602
+ <article class="app-dossier">
603
+ <div class="app-top">
604
+ <div class="app-shot-wrap">
605
+ <img class="app-shot" src="../assets/download-slides/chahuadev-dev-launcher.png" alt="Chahuadev Dev Launcher screenshot" loading="lazy">
606
+ </div>
607
+ <div>
608
+ <div class="app-header">
609
+ <div class="app-name">Chahuadev Dev Launcher</div>
610
+ <span class="app-tag">Launcher</span>
611
+ </div>
612
+ <p class="app-desc">Portable desktop command runner for development projects. Runs grouped commands from detected project context, supports project-root switching, and keeps terminal output live and complete.</p>
613
+ <div class="app-meta-row">
614
+ <div class="meta-chip"><div class="meta-k">npm package</div><div class="meta-v">@chahuadev/dev-launcher</div></div>
615
+ <div class="meta-chip"><div class="meta-k">Latest catalog version</div><div class="meta-v">2.0.0</div></div>
616
+ <div class="meta-chip"><div class="meta-k">Release window</div><div class="meta-v">2026-03-22 to 2026-03-23</div></div>
617
+ <div class="meta-chip"><div class="meta-k">Primary focus</div><div class="meta-v">Project-aware run orchestration</div></div>
618
+ </div>
619
+ <div class="app-links">
620
+ <a class="app-link" href="https://www.npmjs.com/package/@chahuadev/dev-launcher" target="_blank" rel="noreferrer">npm</a>
621
+ <a class="app-link" href="https://huggingface.co/chahuadev" target="_blank" rel="noreferrer">Hugging Face</a>
622
+ </div>
623
+ </div>
624
+ </div>
625
+ <div class="app-columns">
626
+ <div class="app-block">
627
+ <div class="app-block-title">Core Capabilities</div>
628
+ <ul class="app-list">
629
+ <li>Auto-detects project profile from package dependencies and scripts.</li>
630
+ <li>Groups commands for Expo/React Native, Android Gradle, Electron build, Next.js, Vite, and npm scripts.</li>
631
+ <li>Supports secure external project selection and return-to-launcher-root workflow.</li>
632
+ <li>Includes constrained command execution with allowlist policy and audit logging.</li>
633
+ </ul>
634
+ </div>
635
+ <div class="app-block">
636
+ <div class="app-block-title">Binary Matrix</div>
637
+ <table class="bin-table">
638
+ <thead><tr><th>OS</th><th>Artifact</th><th>Version</th><th>Size</th></tr></thead>
639
+ <tbody>
640
+ <tr><td>Windows</td><td>dev-launcher.exe</td><td>1.0.0</td><td>95.26 MB</td></tr>
641
+ <tr><td>Linux</td><td>dev-launcher.AppImage</td><td>2.0.0</td><td>124.2 MB</td></tr>
642
+ <tr><td>macOS x64</td><td>dev-launcher-x64.dmg</td><td>2.0.0</td><td>121.2 MB</td></tr>
643
+ <tr><td>macOS arm64</td><td>dev-launcher-arm64.dmg</td><td>1.0.0</td><td>121.2 MB</td></tr>
644
+ </tbody>
645
+ </table>
646
+ </div>
647
+ </div>
648
+ </article>
649
+
650
+ <article class="app-dossier">
651
+ <div class="app-top">
652
+ <div class="app-shot-wrap">
653
+ <img class="app-shot" src="../assets/download-slides/chahuadev-emoji-cleaner-app.png" alt="Chahuadev Emoji Cleaner screenshot" loading="lazy">
654
+ </div>
655
+ <div>
656
+ <div class="app-header">
657
+ <div class="app-name">Chahuadev Emoji Cleaner</div>
658
+ <span class="app-tag">Text Processing</span>
659
+ </div>
660
+ <p class="app-desc">Fast emoji removal utility for source files, documents, and content datasets. Supports desktop workflow and package-based distribution for repeatable cleanup operations.</p>
661
+ <div class="app-meta-row">
662
+ <div class="meta-chip"><div class="meta-k">npm package</div><div class="meta-v">@chahuadev/emoji-cleaner-app</div></div>
663
+ <div class="meta-chip"><div class="meta-k">Latest catalog version</div><div class="meta-v">7.0.0</div></div>
664
+ <div class="meta-chip"><div class="meta-k">Release date</div><div class="meta-v">2026-03-21</div></div>
665
+ <div class="meta-chip"><div class="meta-k">Primary focus</div><div class="meta-v">Batch emoji sanitization</div></div>
666
+ </div>
667
+ <div class="app-links">
668
+ <a class="app-link" href="https://www.npmjs.com/package/@chahuadev/emoji-cleaner-app" target="_blank" rel="noreferrer">npm</a>
669
+ <a class="app-link" href="https://huggingface.co/chahuadev" target="_blank" rel="noreferrer">Hugging Face</a>
670
+ </div>
671
+ </div>
672
+ </div>
673
+ <div class="app-columns">
674
+ <div class="app-block">
675
+ <div class="app-block-title">Core Capabilities</div>
676
+ <ul class="app-list">
677
+ <li>Strips or replaces emoji sequences across text and code files.</li>
678
+ <li>Supports folder-wide processing with configurable cleanup rules.</li>
679
+ <li>Designed for repository hygiene before packaging, CI, and publication.</li>
680
+ <li>Distributed as desktop binaries and npm package entrypoint.</li>
681
+ </ul>
682
+ </div>
683
+ <div class="app-block">
684
+ <div class="app-block-title">Binary Matrix</div>
685
+ <table class="bin-table">
686
+ <thead><tr><th>OS</th><th>Artifact</th><th>Version</th><th>Size</th></tr></thead>
687
+ <tbody>
688
+ <tr><td>Windows</td><td>Emoji Cleaner.exe</td><td>7.0.0</td><td>88.01 MB</td></tr>
689
+ <tr><td>Linux</td><td>Emoji Cleaner.AppImage</td><td>7.0.0</td><td>118.06 MB</td></tr>
690
+ <tr><td>macOS x64</td><td>Emoji Cleaner-x64.dmg</td><td>7.0.0</td><td>125.00 MB</td></tr>
691
+ <tr><td>macOS arm64</td><td>Emoji Cleaner-arm64.dmg</td><td>7.0.0</td><td>125.00 MB</td></tr>
692
+ </tbody>
693
+ </table>
694
+ </div>
695
+ </div>
696
+ </article>
697
+
698
+ <article class="app-dossier">
699
+ <div class="app-top">
700
+ <div class="app-shot-wrap">
701
+ <img class="app-shot" src="../assets/download-slides/chahuadev-framework.png" alt="Chahuadev Framework screenshot" loading="lazy">
702
+ </div>
703
+ <div>
704
+ <div class="app-header">
705
+ <div class="app-name">Chahuadev Framework</div>
706
+ <span class="app-tag">Framework</span>
707
+ </div>
708
+ <p class="app-desc">Production-ready Electron app framework with security-first architecture. Includes plugin model, authentication patterns, validation gateway flow, and operational tooling.</p>
709
+ <div class="app-meta-row">
710
+ <div class="meta-chip"><div class="meta-k">npm package</div><div class="meta-v">@chahuadev/framework</div></div>
711
+ <div class="meta-chip"><div class="meta-k">Latest catalog version</div><div class="meta-v">7.0.0</div></div>
712
+ <div class="meta-chip"><div class="meta-k">Release date</div><div class="meta-v">2026-03-21</div></div>
713
+ <div class="meta-chip"><div class="meta-k">Primary focus</div><div class="meta-v">Secure plugin architecture</div></div>
714
+ </div>
715
+ <div class="app-links">
716
+ <a class="app-link" href="https://www.npmjs.com/package/@chahuadev/framework" target="_blank" rel="noreferrer">npm</a>
717
+ <a class="app-link" href="https://huggingface.co/chahuadev" target="_blank" rel="noreferrer">Hugging Face</a>
718
+ </div>
719
+ </div>
720
+ </div>
721
+ <div class="app-columns">
722
+ <div class="app-block">
723
+ <div class="app-block-title">Core Capabilities</div>
724
+ <ul class="app-list">
725
+ <li>Gateway-based command handling and centralized validation entry points.</li>
726
+ <li>Offline-capable auth patterns and role-aware operational flows.</li>
727
+ <li>Plugin lifecycle support for project execution and module extension.</li>
728
+ <li>Security controls around runtime integrity, command surfaces, and build flows.</li>
729
+ </ul>
730
+ </div>
731
+ <div class="app-block">
732
+ <div class="app-block-title">Binary Matrix</div>
733
+ <table class="bin-table">
734
+ <thead><tr><th>OS</th><th>Artifact</th><th>Version</th><th>Size</th></tr></thead>
735
+ <tbody>
736
+ <tr><td>Windows</td><td>Chahuadev-Framework.exe</td><td>7.0.0</td><td>263.93 MB</td></tr>
737
+ <tr><td>Linux</td><td>Chahuadev-Framework.AppImage</td><td>7.0.0</td><td>350.45 MB</td></tr>
738
+ <tr><td>macOS x64</td><td>Chahuadev-Framework-x64.dmg</td><td>7.0.0</td><td>350.45 MB</td></tr>
739
+ <tr><td>macOS arm64</td><td>Chahuadev-Framework-arm64.dmg</td><td>7.0.0</td><td>350.45 MB</td></tr>
740
+ </tbody>
741
+ </table>
742
+ </div>
743
+ </div>
744
+ </article>
745
+
746
+ <article class="app-dossier">
747
+ <div class="app-top">
748
+ <div class="app-shot-wrap">
749
+ <img class="app-shot" src="../assets/download-slides/chahuadev-hub.png" alt="Chahuadev Hub screenshot" loading="lazy">
750
+ </div>
751
+ <div>
752
+ <div class="app-header">
753
+ <div class="app-name">Chahuadev Hub</div>
754
+ <span class="app-tag">Ecosystem Hub</span>
755
+ </div>
756
+ <p class="app-desc">Central launcher for the Chahuadev ecosystem. Aggregates package visibility, release browsing, and desktop distribution access in one unified app shell.</p>
757
+ <div class="app-meta-row">
758
+ <div class="meta-chip"><div class="meta-k">npm package</div><div class="meta-v">@chahuadev/chahuadev-hub-app</div></div>
759
+ <div class="meta-chip"><div class="meta-k">Latest catalog version</div><div class="meta-v">7.0.0</div></div>
760
+ <div class="meta-chip"><div class="meta-k">Release window</div><div class="meta-v">2026-03-21 to 2026-03-22</div></div>
761
+ <div class="meta-chip"><div class="meta-k">Primary focus</div><div class="meta-v">Unified ecosystem entrypoint</div></div>
762
+ </div>
763
+ <div class="app-links">
764
+ <a class="app-link" href="https://www.npmjs.com/package/@chahuadev/chahuadev-hub-app" target="_blank" rel="noreferrer">npm</a>
765
+ <a class="app-link" href="https://huggingface.co/chahuadev" target="_blank" rel="noreferrer">Hugging Face</a>
766
+ </div>
767
+ </div>
768
+ </div>
769
+ <div class="app-columns">
770
+ <div class="app-block">
771
+ <div class="app-block-title">Core Capabilities</div>
772
+ <ul class="app-list">
773
+ <li>Single desktop entry point for app discovery and package navigation.</li>
774
+ <li>Release and artifact presentation integrated with ecosystem metadata.</li>
775
+ <li>Designed for operator convenience across multiple Chahuadev tools.</li>
776
+ <li>Supports desktop distribution workflow on major operating systems.</li>
777
+ </ul>
778
+ </div>
779
+ <div class="app-block">
780
+ <div class="app-block-title">Binary Matrix</div>
781
+ <table class="bin-table">
782
+ <thead><tr><th>OS</th><th>Artifact</th><th>Version</th><th>Size</th></tr></thead>
783
+ <tbody>
784
+ <tr><td>Windows</td><td>Chahuadev-Hub.exe</td><td>7.0.0</td><td>84.35 MB</td></tr>
785
+ <tr><td>Linux</td><td>Chahuadev-Hub.AppImage</td><td>7.0.0</td><td>109.36 MB</td></tr>
786
+ <tr><td>macOS</td><td>Chahuadev-Hub.dmg</td><td>7.0.0</td><td>109.36 MB</td></tr>
787
+ </tbody>
788
+ </table>
789
+ </div>
790
+ </div>
791
+ </article>
792
+
793
+ <article class="app-dossier">
794
+ <div class="app-top">
795
+ <div class="app-shot-wrap">
796
+ <img class="app-shot" src="../assets/download-slides/chahuadev-junk-sweeper.png" alt="Chahuadev Junk Sweeper screenshot" loading="lazy">
797
+ </div>
798
+ <div>
799
+ <div class="app-header">
800
+ <div class="app-name">Chahuadev Junk Sweeper</div>
801
+ <span class="app-tag">AST Analysis</span>
802
+ </div>
803
+ <p class="app-desc">Multi-language AST code quality analyzer for JS/TS, Python, and C# with Java path under development. Focuses on unused code, dead paths, vulnerabilities, and silent bug patterns.</p>
804
+ <div class="app-meta-row">
805
+ <div class="meta-chip"><div class="meta-k">npm package</div><div class="meta-v">@chahuadev/junk-sweeper-app</div></div>
806
+ <div class="meta-chip"><div class="meta-k">Latest catalog version</div><div class="meta-v">7.0.0</div></div>
807
+ <div class="meta-chip"><div class="meta-k">Release date</div><div class="meta-v">2026-03-21</div></div>
808
+ <div class="meta-chip"><div class="meta-k">Primary focus</div><div class="meta-v">Read-only diagnostic analysis</div></div>
809
+ </div>
810
+ <div class="app-links">
811
+ <a class="app-link" href="https://www.npmjs.com/package/@chahuadev/junk-sweeper-app" target="_blank" rel="noreferrer">npm</a>
812
+ <a class="app-link" href="https://huggingface.co/chahuadev" target="_blank" rel="noreferrer">Hugging Face</a>
813
+ </div>
814
+ </div>
815
+ </div>
816
+ <div class="app-columns">
817
+ <div class="app-block">
818
+ <div class="app-block-title">Core Capabilities</div>
819
+ <ul class="app-list">
820
+ <li>AST-based detectors for dead code, duplicate logic, unused symbols, and silent defects.</li>
821
+ <li>Security scan paths for injection, traversal, unsafe patterns, and secret exposure.</li>
822
+ <li>Read-only analysis model designed to avoid modifying project source files.</li>
823
+ <li>Interactive architecture map and issue triage workflow for large repositories.</li>
824
+ </ul>
825
+ </div>
826
+ <div class="app-block">
827
+ <div class="app-block-title">Binary Matrix</div>
828
+ <table class="bin-table">
829
+ <thead><tr><th>OS</th><th>Artifact</th><th>Version</th><th>Size</th></tr></thead>
830
+ <tbody>
831
+ <tr><td>Windows</td><td>Junk Sweeper.exe</td><td>7.0.0</td><td>97.01 MB</td></tr>
832
+ <tr><td>Linux</td><td>Junk Sweeper.AppImage</td><td>7.0.0</td><td>150.08 MB</td></tr>
833
+ <tr><td>macOS x64</td><td>Junk Sweeper-x64.dmg</td><td>7.0.0</td><td>125.47 MB</td></tr>
834
+ <tr><td>macOS arm64</td><td>Junk Sweeper-arm64.dmg</td><td>7.0.0</td><td>125.47 MB</td></tr>
835
+ </tbody>
836
+ </table>
837
+ </div>
838
+ </div>
839
+ </article>
840
+
841
+ </div>
842
+
843
+ </div>
844
+ </div>
845
+
846
+ <!-- ══════════════════════════════════════
847
+ WHY CHAHUADEV
848
+ ══════════════════════════════════════ -->
849
+ <div class="section-wrap why-bg" id="sec-why">
850
+ <div class="section-inner">
851
+
852
+ <div class="section-label">Philosophy</div>
853
+ <h2 class="section-heading">Why choose Chahuadev?</h2>
854
+ <p class="section-sub">Independent developer studio focused on Node.js, HTML, and JavaScript with security as the first and non-negotiable priority in every product decision.</p>
855
+
856
+ <div class="why-grid">
857
+
858
+ <div class="why-card">
859
+ <div class="why-icon" style="background:rgba(124,58,237,0.12);color:#a78bfa">
860
+ <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/></svg>
861
+ </div>
862
+ <div class="why-title">Security-First by Default</div>
863
+ <div class="why-desc">Each app is designed with hard boundaries: isolated runtime contexts, constrained IPC surfaces, strict policy controls, and auditable security behavior from day one.</div>
864
+ </div>
865
+
866
+ <div class="why-card">
867
+ <div class="why-icon" style="background:rgba(59,130,246,0.12);color:#60a5fa">
868
+ <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 2v20"/><path d="M5 7h14"/><path d="M5 17h14"/></svg>
869
+ </div>
870
+ <div class="why-title">Independent Developer Practice</div>
871
+ <div class="why-desc">Chahuadev is built as an independent dev initiative: direct execution, fast iteration, and clear ownership of architecture, quality, and security outcomes.</div>
872
+ </div>
873
+
874
+ <div class="why-card">
875
+ <div class="why-icon" style="background:rgba(16,185,129,0.12);color:#34d399">
876
+ <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>
877
+ </div>
878
+ <div class="why-title">Node.js + HTML + JavaScript Expertise</div>
879
+ <div class="why-desc">Core strengths are modern Node.js pipelines, robust JavaScript application logic, and production-grade HTML interfaces optimized for maintainability.</div>
880
+ </div>
881
+
882
+ <div class="why-card">
883
+ <div class="why-icon" style="background:rgba(245,158,11,0.12);color:#f59e0b">
884
+ <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><path d="M9 12l2 2 4-4"/></svg>
885
+ </div>
886
+ <div class="why-title">Maximum Practical Security in Every App</div>
887
+ <div class="why-desc">The target is highest practical protection for each tool: strict validation, minimized attack surface, controlled execution paths, and defense-in-depth implementation.</div>
888
+ </div>
889
+
890
+ </div>
891
+ </div>
892
+ </div>
893
+
894
+ <!-- ══════════════════════════════════════
895
+ FOOTER — Multi-column, official
896
+ ══════════════════════════════════════ -->
897
+ <footer class="footer">
898
+ <div class="footer-inner">
899
+ <div class="footer-grid">
900
+
901
+ <!-- Col 1: Brand -->
902
+ <div>
903
+ <div class="footer-brand-name">Chahuadev</div>
904
+ <p class="footer-brand-desc">Open-source desktop tools for developers and creators. From Chaos to Code.</p>
905
+ <div class="footer-socials">
906
+ <button class="footer-social-btn" title="TikTok" onclick="openLink('https://www.tiktok.com/@chahuadev?is_from_webapp=1&sender_device=pc')">
907
+ <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5"/></svg>
908
+ </button>
909
+ <button class="footer-social-btn" title="Hugging Face" onclick="openLink('https://huggingface.co/chahuadev')">
910
+ <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><line x1="9" y1="9" x2="9.01" y2="9"/><line x1="15" y1="9" x2="15.01" y2="9"/></svg>
911
+ </button>
912
+ <button class="footer-social-btn" title="npm" onclick="openLink('https://www.npmjs.com/org/chahuadev')">
913
+ <svg width="15" height="15" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M0 0h24v24H0V0zm6.154 19.2V8.727h3.693v8.146h1.846V8.727h1.846v10.473H6.154zm9.232-10.473v8.146h1.846v-6.4h1.846v6.4h1.846V8.727H15.386z"/></svg>
914
+ </button>
915
+ </div>
916
+ </div>
917
+
918
+ <!-- Col 2: Pages -->
919
+ <div>
920
+ <div class="footer-col-title">Pages</div>
921
+ <div class="footer-links">
922
+ <button class="footer-link" onclick="scrollToSection('sec-apps')">
923
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="3 6 5 6 21 6"/><path d="M19 6l-1 14H6L5 6"/></svg>
924
+ App Dossiers
925
+ </button>
926
+ <button class="footer-link" onclick="scrollToSection('sec-why')">
927
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/></svg>
928
+ Security Principles
929
+ </button>
930
+ <button class="footer-link" onclick="scrollToSection('sec-hero')">
931
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/></svg>
932
+ Brand Overview
933
+ </button>
934
+ <button class="footer-link" onclick="scrollToSection('sec-why')">
935
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="3" width="20" height="14" rx="2"/><path d="M8 21h8M12 17v4"/></svg>
936
+ Independent Dev Profile
937
+ </button>
938
+ </div>
939
+ </div>
940
+
941
+ <!-- Col 3: Community -->
942
+ <div>
943
+ <div class="footer-col-title">Community</div>
944
+ <div class="footer-links">
945
+ <button class="footer-link" onclick="openLink('https://www.tiktok.com/@chahuadev?is_from_webapp=1&sender_device=pc')">
946
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 12a4 4 0 1 0 4 4V4a5 5 0 0 0 5 5"/></svg>
947
+ TikTok
948
+ </button>
949
+ <button class="footer-link" onclick="openLink('https://huggingface.co/chahuadev')">
950
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><line x1="9" y1="9" x2="9.01" y2="9"/><line x1="15" y1="9" x2="15.01" y2="9"/></svg>
951
+ Hugging Face
952
+ </button>
953
+ <button class="footer-link" onclick="openLink('https://www.npmjs.com/org/chahuadev')">
954
+ <svg width="12" height="12" viewBox="0 0 24 24" fill="currentColor" stroke="none"><path d="M0 0h24v24H0V0zm6.154 19.2V8.727h3.693v8.146h1.846V8.727h1.846v10.473H6.154zm9.232-10.473v8.146h1.846v-6.4h1.846v6.4h1.846V8.727H15.386z"/></svg>
955
+ npm
956
+ </button>
957
+ </div>
958
+ </div>
959
+
960
+ </div>
961
+
962
+ <div class="footer-bottom">
963
+ <div class="footer-copy">Chahuadev &copy; 2026 &nbsp;·&nbsp; From Chaos to Code</div>
964
+ <div class="footer-dot" title="Online"></div>
965
+ </div>
966
+ </div>
967
+ </footer>
968
+
969
+ <script>
970
+ const NPM_DOWNLOAD_PACKAGES = [
971
+ '@chahuadev/dev-launcher',
972
+ '@chahuadev/emoji-cleaner-app',
973
+ '@chahuadev/framework',
974
+ '@chahuadev/chahuadev-hub-app',
975
+ '@chahuadev/junk-sweeper-app'
976
+ ];
977
+ // npm downloads API can return 404 for very new packages for a short period.
978
+ const NPM_DOWNLOAD_API_DELAYED = new Set(['@chahuadev/dev-launcher']);
979
+ const DOWNLOAD_CACHE_KEY = 'chahuadev:npm-downloads:last-month:v1';
980
+ const DOWNLOAD_CACHE_TTL_MS = 6 * 60 * 60 * 1000;
981
+ let statsProvidedByHost = false;
982
+
983
+ function openLink(url) {
984
+ const payload = { type: 'openLink', url: url };
985
+ if (window.parent && window.parent !== window) {
986
+ window.parent.postMessage(payload, '*');
987
+ return;
988
+ }
989
+ // Static-host fallback: open external links directly.
990
+ window.open(url, '_blank', 'noopener,noreferrer');
991
+ }
992
+
993
+ function scrollToSection(sectionId) {
994
+ const section = document.getElementById(sectionId);
995
+ if (!section) return;
996
+ section.scrollIntoView({ behavior: 'smooth', block: 'start' });
997
+ }
998
+
999
+ function setDownloadsText(value) {
1000
+ const el = document.getElementById('ws-downloads');
1001
+ if (!el) return;
1002
+ el.textContent = value;
1003
+ }
1004
+
1005
+ function readCachedDownloadTotal() {
1006
+ try {
1007
+ const raw = localStorage.getItem(DOWNLOAD_CACHE_KEY);
1008
+ if (!raw) return null;
1009
+ const parsed = JSON.parse(raw);
1010
+ if (!parsed || typeof parsed.total !== 'number' || typeof parsed.updatedAt !== 'number') return null;
1011
+ if (Date.now() - parsed.updatedAt > DOWNLOAD_CACHE_TTL_MS) return null;
1012
+ return parsed.total;
1013
+ } catch (_) {
1014
+ return null;
1015
+ }
1016
+ }
1017
+
1018
+ function writeCachedDownloadTotal(total) {
1019
+ try {
1020
+ localStorage.setItem(DOWNLOAD_CACHE_KEY, JSON.stringify({ total, updatedAt: Date.now() }));
1021
+ } catch (_) {
1022
+ // Ignore storage errors in private mode or blocked storage.
1023
+ }
1024
+ }
1025
+
1026
+ async function fetchJsonWithTimeout(url, timeoutMs) {
1027
+ const controller = new AbortController();
1028
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
1029
+ try {
1030
+ const res = await fetch(url, {
1031
+ method: 'GET',
1032
+ mode: 'cors',
1033
+ cache: 'no-store',
1034
+ signal: controller.signal
1035
+ });
1036
+ if (!res.ok) throw new Error(`HTTP ${res.status}`);
1037
+ return await res.json();
1038
+ } finally {
1039
+ clearTimeout(timer);
1040
+ }
1041
+ }
1042
+
1043
+ async function fetchNpmDownloadTotalLastMonth() {
1044
+ const jobs = NPM_DOWNLOAD_PACKAGES.map((pkg) => {
1045
+ if (NPM_DOWNLOAD_API_DELAYED.has(pkg)) {
1046
+ return Promise.resolve({ downloads: 0 });
1047
+ }
1048
+ const scopedPath = encodeURIComponent(pkg).replace(/%2F/g, '/');
1049
+ const endpoint = `https://api.npmjs.org/downloads/point/last-month/${scopedPath}`;
1050
+ return fetchJsonWithTimeout(endpoint, 7000);
1051
+ });
1052
+ const results = await Promise.allSettled(jobs);
1053
+ let total = 0;
1054
+ let successCount = 0;
1055
+
1056
+ for (const result of results) {
1057
+ if (result.status !== 'fulfilled') continue;
1058
+ const downloads = Number(result.value && result.value.downloads);
1059
+ if (!Number.isFinite(downloads) || downloads < 0) continue;
1060
+ total += downloads;
1061
+ successCount += 1;
1062
+ }
1063
+
1064
+ if (successCount === 0) {
1065
+ throw new Error('All npm stats requests failed');
1066
+ }
1067
+ return total;
1068
+ }
1069
+
1070
+ async function hydrateDownloadsFromPublicApi() {
1071
+ const cached = readCachedDownloadTotal();
1072
+ if (cached !== null && !statsProvidedByHost) {
1073
+ setDownloadsText(cached.toLocaleString());
1074
+ }
1075
+
1076
+ try {
1077
+ const total = await fetchNpmDownloadTotalLastMonth();
1078
+ writeCachedDownloadTotal(total);
1079
+ if (!statsProvidedByHost) {
1080
+ setDownloadsText(total.toLocaleString());
1081
+ }
1082
+ } catch (_) {
1083
+ if (cached === null && !statsProvidedByHost) {
1084
+ setDownloadsText('—');
1085
+ }
1086
+ }
1087
+ }
1088
+
1089
+ // Left sidebar jump links + active section sync
1090
+ (function initLeftNavScrollSpy() {
1091
+ const navLinks = Array.from(document.querySelectorAll('.left-nav-link[data-target]'));
1092
+ const sections = navLinks
1093
+ .map(link => document.getElementById(link.dataset.target))
1094
+ .filter(Boolean);
1095
+
1096
+ if (!navLinks.length || !sections.length) return;
1097
+
1098
+ function setActive(targetId) {
1099
+ navLinks.forEach(link => {
1100
+ const isActive = link.dataset.target === targetId;
1101
+ link.classList.toggle('active', isActive);
1102
+ });
1103
+ }
1104
+
1105
+ navLinks.forEach(link => {
1106
+ link.addEventListener('click', (e) => {
1107
+ e.preventDefault();
1108
+ const target = document.getElementById(link.dataset.target);
1109
+ if (!target) return;
1110
+ target.scrollIntoView({ behavior: 'smooth', block: 'start' });
1111
+ setActive(link.dataset.target);
1112
+ });
1113
+ });
1114
+
1115
+ const observer = new IntersectionObserver((entries) => {
1116
+ const visible = entries
1117
+ .filter(en => en.isIntersecting)
1118
+ .sort((a, b) => b.intersectionRatio - a.intersectionRatio);
1119
+ if (visible.length > 0) {
1120
+ setActive(visible[0].target.id);
1121
+ }
1122
+ }, {
1123
+ root: null,
1124
+ rootMargin: '-28% 0px -58% 0px',
1125
+ threshold: [0.15, 0.3, 0.55]
1126
+ });
1127
+
1128
+ sections.forEach(sec => observer.observe(sec));
1129
+
1130
+ const hashTarget = window.location.hash ? window.location.hash.slice(1) : null;
1131
+ if (hashTarget && sections.some(sec => sec.id === hashTarget)) {
1132
+ setActive(hashTarget);
1133
+ } else {
1134
+ setActive(sections[0].id);
1135
+ }
1136
+ })();
1137
+
1138
+ window.addEventListener('message', function(e) {
1139
+ if (!e.data || e.data.type !== 'stats') return;
1140
+ statsProvidedByHost = true;
1141
+ const s = e.data.stats || {};
1142
+ setDownloadsText((s.totalDownloads ?? 0).toLocaleString());
1143
+ });
1144
+
1145
+ hydrateDownloadsFromPublicApi();
1146
+ </script>
1147
+ </body>
1148
+ </html>
web/support-the-project.html ADDED
@@ -0,0 +1,365 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Support the Project</title>
7
+ <style>
8
+ :root {
9
+ --bg: #060b16;
10
+ --bg-2: #091225;
11
+ --glass: rgba(11, 21, 41, 0.62);
12
+ --glass-2: rgba(18, 35, 66, 0.45);
13
+ --line: rgba(123, 170, 255, 0.3);
14
+ --line-strong: rgba(123, 170, 255, 0.55);
15
+ --text: #ecf4ff;
16
+ --muted: #a9bfdd;
17
+ --accent: #7bb1ff;
18
+ --accent-2: #3f89ff;
19
+ --gold: #f4b43f;
20
+ --gold-2: #dc8f12;
21
+ }
22
+
23
+ * { box-sizing: border-box; }
24
+ html, body { margin: 0; padding: 0; }
25
+
26
+ body {
27
+ min-height: 100vh;
28
+ color: var(--text);
29
+ font-family: "Segoe UI", "Noto Sans", "Tahoma", sans-serif;
30
+ background:
31
+ radial-gradient(900px 500px at 15% 5%, rgba(63, 137, 255, 0.16), transparent 65%),
32
+ radial-gradient(900px 500px at 85% 95%, rgba(123, 177, 255, 0.12), transparent 70%),
33
+ linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
34
+ line-height: 1.7;
35
+ }
36
+
37
+ .page {
38
+ max-width: 1100px;
39
+ margin: 0 auto;
40
+ padding: 28px 20px 36px;
41
+ position: relative;
42
+ }
43
+
44
+ .topbar {
45
+ display: flex;
46
+ justify-content: space-between;
47
+ align-items: center;
48
+ gap: 12px;
49
+ margin-bottom: 18px;
50
+ }
51
+
52
+ .top-title {
53
+ display: inline-flex;
54
+ align-items: center;
55
+ gap: 10px;
56
+ font-size: 13px;
57
+ letter-spacing: 0.09em;
58
+ text-transform: uppercase;
59
+ color: var(--accent);
60
+ }
61
+
62
+ .top-title-dot {
63
+ width: 8px;
64
+ height: 8px;
65
+ border-radius: 999px;
66
+ background: var(--accent);
67
+ box-shadow: 0 0 14px rgba(123, 177, 255, 0.8);
68
+ }
69
+
70
+ .support-btn {
71
+ display: inline-flex;
72
+ align-items: center;
73
+ justify-content: center;
74
+ gap: 9px;
75
+ border: 1px solid rgba(244, 180, 63, 0.7);
76
+ background: linear-gradient(135deg, var(--gold), var(--gold-2));
77
+ color: #101624;
78
+ text-decoration: none;
79
+ border-radius: 12px;
80
+ padding: 12px 18px;
81
+ min-width: 220px;
82
+ font-size: 15px;
83
+ font-weight: 800;
84
+ box-shadow: 0 10px 24px rgba(244, 180, 63, 0.22);
85
+ transition: transform .2s ease, box-shadow .2s ease;
86
+ }
87
+
88
+ .support-btn:hover {
89
+ transform: translateY(-2px);
90
+ box-shadow: 0 14px 30px rgba(244, 180, 63, 0.3);
91
+ }
92
+
93
+ .hero {
94
+ border: 1px solid var(--line-strong);
95
+ border-radius: 18px;
96
+ padding: 24px;
97
+ background: linear-gradient(180deg, var(--glass) 0%, var(--glass-2) 100%);
98
+ backdrop-filter: blur(8px);
99
+ margin-bottom: 18px;
100
+ }
101
+
102
+ .hero h1 {
103
+ margin: 0 0 10px;
104
+ font-size: clamp(30px, 5vw, 48px);
105
+ line-height: 1.1;
106
+ letter-spacing: -0.02em;
107
+ }
108
+
109
+ .hero p {
110
+ margin: 0;
111
+ color: var(--muted);
112
+ font-size: 15px;
113
+ max-width: 900px;
114
+ }
115
+
116
+ .grid {
117
+ display: grid;
118
+ grid-template-columns: repeat(2, minmax(0, 1fr));
119
+ gap: 12px;
120
+ }
121
+
122
+ .lang-card {
123
+ border: 1px solid var(--line);
124
+ border-radius: 14px;
125
+ background: rgba(7, 17, 33, 0.62);
126
+ padding: 15px 15px 13px;
127
+ }
128
+
129
+ .lang-head {
130
+ display: flex;
131
+ align-items: baseline;
132
+ justify-content: space-between;
133
+ gap: 8px;
134
+ margin-bottom: 8px;
135
+ }
136
+
137
+ .lang-code {
138
+ font-size: 12px;
139
+ letter-spacing: 0.08em;
140
+ text-transform: uppercase;
141
+ color: var(--accent);
142
+ font-weight: 700;
143
+ }
144
+
145
+ .lang-name {
146
+ font-size: 12px;
147
+ color: #c9dcfa;
148
+ opacity: 0.9;
149
+ }
150
+
151
+ .lang-card p {
152
+ margin: 0;
153
+ color: #d9e7fb;
154
+ font-size: 14px;
155
+ white-space: pre-line;
156
+ }
157
+
158
+ .footer {
159
+ margin-top: 16px;
160
+ color: #99b4d8;
161
+ font-size: 12px;
162
+ text-align: center;
163
+ }
164
+
165
+ .footer-links {
166
+ margin-top: 6px;
167
+ display: inline-flex;
168
+ gap: 12px;
169
+ flex-wrap: wrap;
170
+ justify-content: center;
171
+ }
172
+
173
+ .footer-link {
174
+ color: #bcd5f8;
175
+ text-decoration: none;
176
+ border-bottom: 1px solid rgba(123, 170, 255, 0.4);
177
+ transition: color .2s ease, border-color .2s ease;
178
+ }
179
+
180
+ .footer-link:hover {
181
+ color: #e6f0ff;
182
+ border-color: rgba(123, 170, 255, 0.8);
183
+ }
184
+
185
+ @media (max-width: 860px) {
186
+ .grid { grid-template-columns: 1fr; }
187
+ .topbar {
188
+ flex-direction: column;
189
+ align-items: flex-start;
190
+ }
191
+ .support-btn {
192
+ width: 100%;
193
+ }
194
+ }
195
+ </style>
196
+ </head>
197
+ <body>
198
+ <main class="page">
199
+ <div class="topbar">
200
+ <div class="top-title"><span class="top-title-dot"></span>Support the Project</div>
201
+ <a class="support-btn" href="https://www.buymeacoffee.com/chahuadevm" target="_blank" rel="noopener noreferrer">Buy me a coffee</a>
202
+ </div>
203
+
204
+ <section class="hero">
205
+ <h1>Support the Project</h1>
206
+ <p>This page is available for everyone in the Chahuadev ecosystem. If these tools save your time, your support helps keep the project stable, maintained, and growing.</p>
207
+ </section>
208
+
209
+ <section class="grid">
210
+ <article class="lang-card">
211
+ <div class="lang-head"><div class="lang-code">EN</div><div class="lang-name">English</div></div>
212
+ <p>Building open-source tools to make developers' lives easier!
213
+ I'm the creator of Junk Sweeper and Dev Launcher. I believe in providing high-quality diagnostic tools completely for free.
214
+
215
+ If you find my projects helpful, you can support me here. Your contributions help cover the hidden costs of development (VPS, AI services, servers, and caffeine) and keep the chahuadev ecosystem growing. Cheers!</p>
216
+ </article>
217
+
218
+ <article class="lang-card">
219
+ <div class="lang-head"><div class="lang-code">TH</div><div class="lang-name">Thai</div></div>
220
+ <p>เครื่องมือของ Chahuadev เปิดให้ใช้งานฟรี 100% ถ้าซอฟต์แวร์ตัวนี้ช่วยประหยัดเวลาการทำงานของคุณได้ คุณสามารถช่วยสมทบทุนค่าเซิร์ฟเวอร์และค่าไฟได้ ด้วยการ "เลี้ยงกาแฟผมสักแก้ว" เพื่อให้โปรเจกต์นี้พัฒนาต่อไปได้ครับ!</p>
221
+ </article>
222
+
223
+ <article class="lang-card">
224
+ <div class="lang-head"><div class="lang-code">ES</div><div class="lang-name">Spanish</div></div>
225
+ <p>Estoy creando herramientas open-source para facilitar la vida de los desarrolladores.
226
+ Si mis proyectos te ayudan, puedes apoyarme aquí. Tu aporte cubre costos reales de desarrollo (VPS, servicios de IA, servidores y café) y ayuda a que el ecosistema de chahuadev siga creciendo.</p>
227
+ </article>
228
+
229
+ <article class="lang-card">
230
+ <div class="lang-head"><div class="lang-code">FR</div><div class="lang-name">French</div></div>
231
+ <p>Je construis des outils open-source pour simplifier la vie des développeurs.
232
+ Si mes projets vous sont utiles, vous pouvez me soutenir ici. Vos contributions couvrent les coûts cachés du développement (VPS, services IA, serveurs et café) et permettent à l'écosystème chahuadev de continuer à grandir.</p>
233
+ </article>
234
+
235
+ <article class="lang-card">
236
+ <div class="lang-head"><div class="lang-code">DE</div><div class="lang-name">German</div></div>
237
+ <p>Ich entwickle Open-Source-Tools, um den Alltag von Entwicklerinnen und Entwicklern zu erleichtern.
238
+ Wenn dir meine Projekte helfen, kannst du mich hier unterstützen. Dein Beitrag deckt versteckte Entwicklungskosten (VPS, KI-Dienste, Server und Kaffee) und hält das chahuadev-Ökosystem am Wachsen.</p>
239
+ </article>
240
+
241
+ <article class="lang-card">
242
+ <div class="lang-head"><div class="lang-code">PT</div><div class="lang-name">Portuguese</div></div>
243
+ <p>Estou criando ferramentas open-source para facilitar a vida de desenvolvedores.
244
+ Se meus projetos ajudam você, pode me apoiar aqui. Sua contribuição cobre custos reais de desenvolvimento (VPS, serviços de IA, servidores e café) e mantém o ecossistema chahuadev em crescimento.</p>
245
+ </article>
246
+
247
+ <article class="lang-card">
248
+ <div class="lang-head"><div class="lang-code">JA</div><div class="lang-name">Japanese</div></div>
249
+ <p>開発者の作業をもっと楽にするために、オープンソースツールを作っています。
250
+ プロジェクトが役に立ったら、ここから応援していただけるとうれしいです。ご支援は VPS、AI サービス、サーバー運用、そしてコーヒー代などの継続コストに使われ、chahuadev エコシステムの成長につながります。</p>
251
+ </article>
252
+
253
+ <article class="lang-card">
254
+ <div class="lang-head"><div class="lang-code">ZH</div><div class="lang-name">Chinese</div></div>
255
+ <p>我正在构建开源工具,让开发者的工作更轻松。
256
+ 如果这些项目对你有帮助,欢迎在这里支持我。你的支持将用于支付开发中的隐藏成本(VPS、AI 服务、服务器和咖啡),并帮助 chahuadev 生态持续成长。</p>
257
+ </article>
258
+
259
+ <article class="lang-card">
260
+ <div class="lang-head"><div class="lang-code">KO</div><div class="lang-name">Korean</div></div>
261
+ <p>개발자의 일을 더 쉽게 만들기 위해 오픈소스 도구를 만들고 있습니다.
262
+ 프로젝트가 도움이 되었다면 여기에서 후원해 주세요. 여러분의 후원은 VPS, AI 서비스, 서버 운영, 그리고 커피 같은 개발 비용을 충당하고 chahuadev 생��계의 성장을 돕습니다.</p>
263
+ </article>
264
+
265
+ <article class="lang-card">
266
+ <div class="lang-head"><div class="lang-code">BN</div><div class="lang-name">Bengali</div></div>
267
+ <p>ডেভেলপারদের কাজ সহজ করতে আমি ওপেন-সোর্স টুল তৈরি করি।
268
+ আমার প্রজেক্টগুলো আপনার কাজে লাগলে এখানে সাপোর্ট করতে পারেন। আপনার সহায়তা VPS, AI সার্ভিস, সার্ভার এবং ডেভেলপমেন্টের লুকানো খরচ সামলাতে সাহায্য করে, আর chahuadev ইকোসিস্টেমকে এগিয়ে নেয়।</p>
269
+ </article>
270
+
271
+ <article class="lang-card">
272
+ <div class="lang-head"><div class="lang-code">UR</div><div class="lang-name">Urdu</div></div>
273
+ <p>میں ڈویلپرز کی زندگی آسان بنانے کے لیے اوپن سورس ٹولز بناتا ہوں۔
274
+ اگر میرے پروجیکٹس آپ کے کام آئیں تو یہاں سپورٹ کریں۔ آپ کی مدد VPS، AI سروسز، سرورز اور دیگر اخراجات پورے کرنے میں مدد دیتی ہے، اور chahuadev ایکو سسٹم کو آگے بڑھاتی ہے۔</p>
275
+ </article>
276
+
277
+ <article class="lang-card">
278
+ <div class="lang-head"><div class="lang-code">HI</div><div class="lang-name">Hindi</div></div>
279
+ <p>मैं डेवलपर्स की ज़िंदगी आसान बनाने के लिए ओपन-सोर्स टूल्स बनाता हूँ।
280
+ अगर मेरे प्रोजेक्ट आपके काम आते हैं, तो आप यहाँ सपोर्ट कर सकते हैं। आपका सहयोग VPS, AI सेवाओं, सर्वर और डेवलपमेंट की छिपी लागत को पूरा करने में मदद करता है और chahuadev इकोसिस्टम को आगे बढ़ाता है।</p>
281
+ </article>
282
+
283
+ <article class="lang-card">
284
+ <div class="lang-head"><div class="lang-code">AR</div><div class="lang-name">Arabic</div></div>
285
+ <p>أبني أدوات مفتوحة المصدر لتسهيل حياة المطورين.
286
+ إذا كانت مشاريعي مفيدة لك، يمكنك دعمي من هنا. مساهمتك تساعد في تغطية التكاليف الخفية للتطوير مثل VPS وخدمات الذكاء الاصطناعي والخوادم والقهوة، وتدعم نمو منظومة chahuadev.</p>
287
+ </article>
288
+ </section>
289
+
290
+ <div class="footer">
291
+ Chahuadev Support the Project
292
+ <div class="footer-links">
293
+ <a class="footer-link" href="https://www.chahuadev.com" target="_blank" rel="noopener noreferrer">Main Website</a>
294
+ <a class="footer-link" href="https://huggingface.co/chahuadev" target="_blank" rel="noopener noreferrer">Hugging Face</a>
295
+ </div>
296
+ </div>
297
+ </main>
298
+ <script>
299
+ (function () {
300
+ const ALLOWED_HOSTS = new Set([
301
+ 'www.buymeacoffee.com',
302
+ 'buymeacoffee.com',
303
+ 'www.chahuadev.com',
304
+ 'chahuadev.com',
305
+ 'huggingface.co'
306
+ ]);
307
+
308
+ function isAllowedExternalUrl(url) {
309
+ try {
310
+ const parsed = new URL(url);
311
+ return parsed.protocol === 'https:' && ALLOWED_HOSTS.has(parsed.hostname);
312
+ } catch (_) {
313
+ return false;
314
+ }
315
+ }
316
+
317
+ async function openViaBridge(url) {
318
+ const root = window.parent && window.parent !== window ? window.parent : window;
319
+
320
+ if (root.api && typeof root.api.openExternal === 'function') {
321
+ return root.api.openExternal(url);
322
+ }
323
+ if (root.electronAPI && typeof root.electronAPI.openExternal === 'function') {
324
+ return root.electronAPI.openExternal(url);
325
+ }
326
+ if (root.chahuadevHub && typeof root.chahuadevHub.openExternalUrl === 'function') {
327
+ return root.chahuadevHub.openExternalUrl(url);
328
+ }
329
+ if (root.chahuadev && typeof root.chahuadev.openExternalUrl === 'function') {
330
+ return root.chahuadev.openExternalUrl(url);
331
+ }
332
+ if (root.emojiCleanerAPI && typeof root.emojiCleanerAPI.openExternal === 'function') {
333
+ return root.emojiCleanerAPI.openExternal(url);
334
+ }
335
+
336
+ return false;
337
+ }
338
+
339
+ async function openExternalSafely(url) {
340
+ if (!isAllowedExternalUrl(url)) return;
341
+
342
+ try {
343
+ const result = await openViaBridge(url);
344
+ if (result === false) {
345
+ window.open(url, '_blank', 'noopener,noreferrer');
346
+ }
347
+ } catch (_) {
348
+ window.open(url, '_blank', 'noopener,noreferrer');
349
+ }
350
+ }
351
+
352
+ document.addEventListener('click', function (event) {
353
+ const anchor = event.target.closest('a[href]');
354
+ if (!anchor) return;
355
+
356
+ const href = anchor.getAttribute('href');
357
+ if (!href || !/^https?:\/\//i.test(href)) return;
358
+
359
+ event.preventDefault();
360
+ openExternalSafely(anchor.href);
361
+ });
362
+ })();
363
+ </script>
364
+ </body>
365
+ </html>