Add calculator UX enhancements and submission tracking
- Button loading spinner + disable on submit to prevent duplicate AI calls - Email field and opt-in consent checkbox on calculator form (checked by default) - Privacy assurance blurb below opt-in - Refinement blurb on results screen explaining live cash-flow optimization - calc_submissions SQLite table stores form inputs, computed results, AI text, email, opt-in - GET /api/calc-submissions endpoint (x-admin-key protected) to retrieve submissions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
44
styles.css
44
styles.css
@@ -840,6 +840,50 @@ body {
|
||||
.calc-recalc { font-size: 14px; color: var(--gray-500); }
|
||||
.calc-recalc:hover { color: var(--gray-200); }
|
||||
|
||||
/* ── Calc email + opt-in ── */
|
||||
.calc-email-row { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
|
||||
.calc-field--full { grid-column: 1 / -1; }
|
||||
.calc-optional { font-weight: 400; color: var(--gray-600); font-size: 11px; }
|
||||
.calc-optin-label {
|
||||
display: flex; align-items: flex-start; gap: 10px;
|
||||
font-size: 13px; color: var(--gray-300); cursor: pointer; line-height: 1.5;
|
||||
}
|
||||
.calc-optin-label input[type="checkbox"] {
|
||||
margin-top: 2px; accent-color: var(--blue); flex-shrink: 0;
|
||||
width: 15px; height: 15px; cursor: pointer;
|
||||
}
|
||||
.calc-privacy {
|
||||
font-size: 11px; color: var(--gray-600); line-height: 1.5;
|
||||
border-left: 2px solid rgba(255,255,255,0.06); padding-left: 10px; margin: 0;
|
||||
}
|
||||
|
||||
/* ── Calc button spinner ── */
|
||||
.calc-btn-loading { display: flex; align-items: center; gap: 8px; }
|
||||
.calc-spinner {
|
||||
display: inline-block; width: 14px; height: 14px;
|
||||
border: 2px solid rgba(255,255,255,0.3);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 0.7s linear infinite;
|
||||
}
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
|
||||
/* ── Results refinement blurb ── */
|
||||
.calc-refine-blurb {
|
||||
display: flex; gap: 12px; align-items: flex-start;
|
||||
background: rgba(14,165,233,0.07);
|
||||
border: 1px solid rgba(14,165,233,0.18);
|
||||
border-radius: 10px;
|
||||
padding: 14px 16px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.calc-refine-icon {
|
||||
font-size: 18px; color: var(--sky); flex-shrink: 0; margin-top: 1px;
|
||||
}
|
||||
.calc-refine-blurb p {
|
||||
font-size: 12.5px; color: var(--gray-400); line-height: 1.6; margin: 0;
|
||||
}
|
||||
|
||||
/* ---- Screenshot Carousel ---- */
|
||||
.screenshot-carousel {
|
||||
width: 100%;
|
||||
|
||||
Reference in New Issue
Block a user