MCPcopy Create free account
hub / github.com/error311/FileRise / repaintStripIcon

Function repaintStripIcon

public/js/fileListView.js:472–488  ·  view source on GitHub ↗
(folder)

Source from the content-addressed store, hash-verified

470
471// helper to repaint one strip item quickly
472function repaintStripIcon(folder) {
473 const el = document.querySelector(`#folderStripContainer .folder-item[data-folder="${CSS.escape(folder)}"]`);
474 if (!el) return;
475 const iconSpan = el.querySelector('.folder-svg');
476 if (!iconSpan) return;
477
478 const hex = (window.folderColorMap && window.folderColorMap[folder]) || '#f6b84e';
479 const front = hex;
480 const back = _lighten(hex, 14);
481 const stroke = _darken(hex, 22);
482 el.style.setProperty('--filr-folder-front', front);
483 el.style.setProperty('--filr-folder-back', back);
484 el.style.setProperty('--filr-folder-stroke', stroke);
485
486 const kind = iconSpan.dataset.kind || 'empty';
487 iconSpan.innerHTML = folderSVG(kind, { encrypted: isEncryptedForFolderIcon(folder) });
488}
489const TEXT_PREVIEW_MAX_BYTES = 512 * 1024;
490const DEFAULT_HOVER_PREVIEW_MAX_MB = 8;
491const MIN_HOVER_PREVIEW_MAX_MB = 1;

Callers 1

fileListView.jsFile · 0.85

Calls 4

_lightenFunction · 0.85
_darkenFunction · 0.85
folderSVGFunction · 0.85
isEncryptedForFolderIconFunction · 0.85

Tested by

no test coverage detected