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

@@ -137,6 +137,27 @@ body.resizing iframe { pointer-events: none; }
background: rgba(255,255,255,0.06);
}
/* Language color indicators on tabs */
.tab-color-dot {
width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.tab-btn.active .tab-color-dot { box-shadow: 0 0 4px currentColor; }
.tab-lang-html .tab-color-dot { background: #E44D26; }
.tab-lang-css .tab-color-dot { background: #264DE4; }
.tab-lang-javascript .tab-color-dot { background: #F7DF1E; }
.tab-lang-typescript .tab-color-dot { background: #3178C6; }
.tab-lang-markdown .tab-color-dot { background: #83B; }
.tab-lang-html .tab-btn-label, .tab-lang-css .tab-btn-label,
.tab-lang-javascript .tab-btn-label, .tab-lang-typescript .tab-btn-label,
.tab-lang-markdown .tab-btn-label { /* no extra style needed, just grouping */ }
/* Active tab border matches language color */
.tab-lang-html.active { border-bottom-color: #E44D26; }
.tab-lang-css.active { border-bottom-color: #264DE4; }
.tab-lang-javascript.active { border-bottom-color: #F7DF1E; }
.tab-lang-typescript.active { border-bottom-color: #3178C6; }
.tab-lang-markdown.active { border-bottom-color: #83B; }
/* CSS type selector inside tab bar */
.tab-css-type {
background: var(--bg);
@@ -595,3 +616,134 @@ body.resizing iframe { pointer-events: none; }
.templates-modal-content { min-width: unset !important; }
.templates-grid { grid-template-columns: 1fr; }
}
/* ===================== Format Save Toggle ===================== */
.format-save-toggle {
display: flex;
align-items: center;
gap: 4px;
font-size: 12px;
color: var(--text-dim);
cursor: pointer;
user-select: none;
}
.format-save-toggle input { cursor: pointer; }
/* ===================== Editor Font Select ===================== */
#editor-font {
background: var(--bg); color: var(--text); border: 1px solid var(--border);
padding: 4px 6px; border-radius: 4px; font-size: 12px; cursor: pointer;
}
/* ===================== Version History Modal ===================== */
.history-modal-content { min-width: 500px; max-width: 700px; text-align: left; }
.history-list {
max-height: 200px; overflow-y: auto;
border: 1px solid var(--border); border-radius: 4px;
margin-bottom: 12px;
}
.history-item {
display: flex; justify-content: space-between; align-items: center;
padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
transition: background 0.1s;
}
.history-item:last-child { border-bottom: none; }
.history-item:hover { background: rgba(255,255,255,0.04); }
.history-item.active { background: rgba(0,120,212,0.15); }
.history-version {
font-weight: 600; font-size: 13px; color: var(--accent);
font-family: 'Cascadia Code', 'Fira Code', monospace;
}
.history-date { font-size: 11px; color: var(--text-dim); }
.history-preview-header {
display: flex; justify-content: space-between; align-items: center;
margin-bottom: 8px;
}
.history-preview-header span { font-size: 12px; color: var(--text-dim); }
.history-diff-section { margin-bottom: 8px; }
.history-diff-label {
font-size: 11px; font-weight: 600; text-transform: uppercase;
color: var(--accent); margin-bottom: 4px;
}
.history-diff-code {
background: var(--bg); border: 1px solid var(--border);
border-radius: 4px; padding: 8px; font-size: 11px;
font-family: 'Cascadia Code', 'Fira Code', monospace;
max-height: 150px; overflow-y: auto; white-space: pre-wrap;
word-break: break-all; color: var(--text-dim);
}
.history-diff { max-height: 300px; overflow-y: auto; }
/* ===================== Embed Modal ===================== */
.embed-modal-content { min-width: 480px; max-width: 600px; text-align: left; }
.embed-options {
display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px;
}
.embed-options label {
display: flex; align-items: center; gap: 4px;
font-size: 12px; color: var(--text-dim);
}
.embed-options select, .embed-options input {
background: var(--bg); color: var(--text); border: 1px solid var(--border);
padding: 3px 6px; border-radius: 4px; font-size: 12px;
}
.embed-code-wrap {
position: relative; margin-bottom: 12px;
}
.embed-code {
background: var(--bg); border: 1px solid var(--border);
border-radius: 4px; padding: 10px; font-size: 11px;
font-family: 'Cascadia Code', 'Fira Code', monospace;
white-space: pre-wrap; word-break: break-all; color: var(--text);
max-height: 80px; overflow-y: auto;
}
.embed-code-wrap .btn-small {
position: absolute; top: 6px; right: 6px;
background: var(--border); padding: 2px 8px;
}
.embed-live-preview { margin-top: 8px; }
/* ===================== Collection Modal ===================== */
.collection-new-row {
display: flex; gap: 6px; margin-bottom: 12px;
}
.collection-new-row input {
flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text);
padding: 5px 8px; border-radius: 4px; font-size: 12px;
}
.collection-new-row input:focus { border-color: var(--accent); outline: none; }
.collection-list {
max-height: 250px; overflow-y: auto;
border: 1px solid var(--border); border-radius: 4px;
}
.collection-item {
display: flex; align-items: center; gap: 8px;
padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.collection-item:last-child { border-bottom: none; }
.collection-name { flex: 1; font-size: 13px; font-weight: 500; }
.collection-count { font-size: 11px; color: var(--text-dim); }
.collection-add-btn { flex-shrink: 0; }
/* ===================== npm Search ===================== */
.npm-search-row { position: relative; }
#npm-search-input {
flex: 1; background: var(--bg); border: 1px solid var(--border); color: var(--text);
padding: 5px 8px; border-radius: 4px; font-size: 12px; width: 100%;
}
#npm-search-input:focus { border-color: var(--accent); outline: none; }
.npm-search-results {
position: absolute; top: 100%; left: 0; right: 0; z-index: 10;
background: var(--surface); border: 1px solid var(--border); border-radius: 4px;
max-height: 220px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.npm-search-results.hidden { display: none; }
.npm-result {
padding: 8px 10px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.npm-result:last-child { border-bottom: none; }
.npm-result:hover { background: rgba(0,120,212,0.1); }
.npm-result-name { font-size: 12px; font-weight: 600; color: var(--text); }
.npm-result-version { font-size: 10px; color: var(--text-dim); font-weight: 400; }
.npm-result-desc { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.npm-no-results { padding: 12px; text-align: center; color: var(--text-dim); font-size: 12px; }