|
|
import { |
|
|
archiveRestore, |
|
|
arrowDownLeft, |
|
|
arrowDownWideNarrow, |
|
|
arrowRight, |
|
|
arrowRightLeft, |
|
|
arrowUpDown, |
|
|
clipboardList, |
|
|
cornerRightUp, |
|
|
dices, |
|
|
fileArchive, |
|
|
folderClosed, |
|
|
image, |
|
|
laptop2, |
|
|
panelRight, |
|
|
penSquare, |
|
|
pencilRuler, |
|
|
pipette, |
|
|
play, |
|
|
refreshCcw, |
|
|
save, |
|
|
settings, |
|
|
trash, |
|
|
wand2, |
|
|
webcam, |
|
|
} from 'lucide-static'; |
|
|
|
|
|
const replaceIcon = (button: HTMLButtonElement, emoji: string[], svg: string) => { |
|
|
if (!button?.textContent || !svg) return; |
|
|
for (const e of emoji) { |
|
|
if (button?.textContent?.includes(e)) { |
|
|
button.innerHTML = svg |
|
|
.replace(`width="24"`, `width="16"`) |
|
|
.replace(`height="24"`, `height="16"`); |
|
|
} |
|
|
} |
|
|
}; |
|
|
|
|
|
export default () => { |
|
|
console.time('π€― [svgIcon] replace'); |
|
|
for (const button of document.querySelectorAll('button')) { |
|
|
replaceIcon(button, ['ποΈ'], penSquare); |
|
|
replaceIcon(button, ['ποΈ'], fileArchive); |
|
|
replaceIcon(button, ['πΌοΈ'], pipette); |
|
|
replaceIcon(button, ['π¨οΈ'], image); |
|
|
replaceIcon(button, ['π'], folderClosed); |
|
|
replaceIcon(button, ['π', 'π', 'β»οΈ'], refreshCcw); |
|
|
replaceIcon(button, ['βοΈ'], arrowDownLeft); |
|
|
replaceIcon(button, ['‴'], cornerRightUp); |
|
|
replaceIcon(button, ['βοΈ'], arrowDownWideNarrow); |
|
|
replaceIcon(button, ['ποΈ'], trash); |
|
|
replaceIcon(button, ['π'], clipboardList); |
|
|
replaceIcon(button, ['πΎ'], save); |
|
|
replaceIcon(button, ['π²οΈ'], dices); |
|
|
replaceIcon(button, ['πͺ'], wand2); |
|
|
replaceIcon(button, ['βοΈ'], settings); |
|
|
replaceIcon(button, ['β‘οΈ'], arrowRight); |
|
|
replaceIcon(button, ['β
'], arrowUpDown); |
|
|
replaceIcon(button, ['β'], arrowRightLeft); |
|
|
replaceIcon(button, ['π΄'], panelRight); |
|
|
replaceIcon(button, ['π'], archiveRestore); |
|
|
replaceIcon(button, ['π₯'], play); |
|
|
replaceIcon(button, ['π·'], webcam); |
|
|
replaceIcon(button, ['π'], laptop2); |
|
|
replaceIcon(button, ['π'], pencilRuler); |
|
|
} |
|
|
console.timeEnd('π€― [svgIcon] replace'); |
|
|
}; |
|
|
|