Light & Dark Theme Alterations

This commit is contained in:
John OReilly
2026-03-12 00:47:18 -04:00
parent 901b3bb116
commit 1663c69c63
4 changed files with 92 additions and 44 deletions

View File

@@ -179,7 +179,7 @@ function calcQuote() {
return {
users, endpoints, servers, ztSeats, ztRouters, voipSeats, voipTier, addVoipPhone, addVoipFax,
byol, addPWM, addINKY, addExtHours, addZT, addUSB, addBMB, ztActive, clientName,
byol, addPWM, addINKY, addExtHours, addZT, addUSB, addBMB, ztActive, adminWaived, clientName,
contractTerm, hstEnabled, oneTimeFee,
baseUserRate, totalUserRate,
userBase, userPWM, userINKY, userExt, userZT, userTotal,
@@ -238,7 +238,7 @@ function update() {
q.oneTimeFee = oneTimeFee;
const { users, endpoints, servers, voipSeats, voipTier,
byol, addPWM, addINKY, addExtHours, addZT, addUSB, addBMB, ztActive, clientName,
byol, addPWM, addINKY, addExtHours, addZT, addUSB, addBMB, ztActive, adminWaived, clientName,
contractTerm, hstEnabled,
baseUserRate,
userPWM, userINKY, userExt, userZT, userTotal,
@@ -513,7 +513,9 @@ function toggleAllSections() {
function updateToggleAllBtn() {
const anyOpen = _allSecIds.some(id => document.getElementById(id)?.classList.contains('sec-open'));
const btn = document.getElementById('toggleAllBtn');
if (btn) btn.textContent = anyOpen ? 'Collapse All' : 'Expand All';
const collapseIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;margin-right:5px;"><polyline points="6 9 12 15 18 9"/><polyline points="6 15 12 9 18 15"/></svg>';
const expandIcon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="vertical-align:middle;margin-right:5px;"><polyline points="6 15 12 9 18 15"/><polyline points="6 9 12 15 18 9"/></svg>';
if (btn) btn.innerHTML = anyOpen ? collapseIcon + 'Collapse All' : expandIcon + 'Expand All';
}
// ── stepCount(inputId, delta, event) ─────────────────────────────
@@ -642,7 +644,10 @@ function updateVsComparison(q) {
applyVsRow('vs-1man-save-row', 'vs-1man-save', 'vs-1man-save-lbl', save1);
applyVsRow('vs-5man-save-row', 'vs-5man-save', 'vs-5man-save-lbl', save5);
getEl('vs-footnote').textContent = `Based on ~$85K Ottawa IT salary (2024) + min $650/mo tool licensing (M365, EDR, RMM, backup, SAT & more). No benefits, hiring, or turnover costs factored.`;
const toolsLabel = toolsMonthly <= TOOL_COST_MIN
? `min $${TOOL_COST_MIN}/mo`
: `~$${toolsMonthly}/mo`;
getEl('vs-footnote').textContent = `Based on ~$85K Ottawa IT salary (2024) + ${toolsLabel} tool licensing (M365, EDR, RMM, backup, SAT & more). No benefits, hiring, or turnover costs factored.`;
}
// ── renderNudge() ─────────────────────────────────────────────────
@@ -1062,9 +1067,9 @@ function exportQuoteJSON() {
navigator.clipboard?.writeText(json).then(() => {
const btn = document.getElementById('btnExportJSON');
if (btn) {
const orig = btn.textContent;
btn.textContent = '✓ Copied to clipboard';
setTimeout(() => { btn.textContent = orig; }, 2000);
const orig = btn.innerHTML;
btn.innerHTML = '✓ Copied to clipboard';
setTimeout(() => { btn.innerHTML = orig; }, 2000);
}
}).catch(() => {});
}
@@ -1128,8 +1133,22 @@ async function initQuote() {
const month = months[now.getMonth()];
const dateStr = `${year}${String(now.getMonth()+1).padStart(2,'0')}${String(now.getDate()).padStart(2,'0')}`;
const savedRef = localStorage.getItem('svs-msp-quote-ref');
const quoteRef = savedRef || `SVS-${dateStr}-${String(Math.floor(Math.random()*9000)+1000)}`;
if (!savedRef) localStorage.setItem('svs-msp-quote-ref', quoteRef);
let quoteRef;
if (savedRef) {
// Regenerate if the baked-in date is older than 30 days
const m = savedRef.match(/^SVS-(\d{4})(\d{2})(\d{2})-/);
const refDate = m ? new Date(+m[1], +m[2] - 1, +m[3]) : null;
const ageMs = refDate ? now - refDate : Infinity;
if (ageMs > 30 * 24 * 60 * 60 * 1000) {
quoteRef = `SVS-${dateStr}-${String(Math.floor(Math.random()*9000)+1000)}`;
localStorage.setItem('svs-msp-quote-ref', quoteRef);
} else {
quoteRef = savedRef;
}
} else {
quoteRef = `SVS-${dateStr}-${String(Math.floor(Math.random()*9000)+1000)}`;
localStorage.setItem('svs-msp-quote-ref', quoteRef);
}
document.getElementById('quoteRef').textContent = quoteRef;
document.getElementById('headerDate').textContent = `${month} ${year}`;
restoreState();