Add version history, screenshots, embed generator, collections, npm search, format-on-save, and custom fonts

This commit is contained in:
root
2026-02-27 01:47:16 -06:00
parent 6ca8519250
commit 0d84c56008
14 changed files with 1046 additions and 25 deletions

View File

@@ -204,9 +204,16 @@ function renderTabBar(tabs) {
tabs.forEach((tab) => {
const btn = document.createElement('button');
btn.className = 'tab-btn';
btn.className = `tab-btn tab-lang-${tab.lang}`;
btn.dataset.tab = tab.id;
btn.textContent = tab.label;
const dot = document.createElement('span');
dot.className = 'tab-color-dot';
btn.appendChild(dot);
const label = document.createElement('span');
label.textContent = tab.label;
btn.appendChild(label);
// Add CSS type selector inside the CSS tab
if (tab.id === 'css') {
@@ -360,3 +367,13 @@ export function setEditorTheme(themeId) {
editorOpts.theme = themeId;
monaco.editor.setTheme(themeId);
}
export function setEditorFont(fontFamily) {
const family = fontFamily === 'default' ? "'Cascadia Code', 'Fira Code', monospace" : `'${fontFamily}', monospace`;
editorOpts.fontFamily = family;
const tabs = MODE_TABS[currentMode];
if (!tabs) return;
tabs.forEach((tab) => {
if (editors[tab.id]) editors[tab.id].updateOptions({ fontFamily: family });
});
}