refactor: extract shared partials from HTML pages (nav, footer, styles, modals)
Some checks failed
Deploy to Production / Deploy to Server (push) Has been cancelled

- Created build-time templating system using existing build-html.cjs
- Extracted index.html into source template with partials:
  _styles_index.html, _nav_index.html, _modals.html
- All 4 templated pages (index, impressum, privacy, terms) use partials
- docs.html excluded (Swagger UI, completely different structure)
- Added HTML build step to Dockerfile
- Built output is byte-identical to original files
This commit is contained in:
OpenClaw 2026-02-16 18:52:31 +00:00
parent aab6bf3bee
commit e51e65524a
6 changed files with 554 additions and 2 deletions

View file

@ -0,0 +1,243 @@
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #0b0d11; --bg2: #12151c; --fg: #e4e7ed; --muted: #7a8194;
--accent: #34d399; --accent-hover: #5eead4; --accent-glow: rgba(52,211,153,0.12);
--accent2: #60a5fa; --card: #151922; --border: #1e2433;
--radius: 12px; --radius-lg: 16px;
}
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--fg); line-height: 1.65; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }
.container { max-width: 1020px; margin: 0 auto; padding: 0 24px; }
/* Nav */
nav { padding: 20px 0; border-bottom: 1px solid var(--border); }
nav .container { display: flex; align-items: center; justify-content: space-between; }
.logo { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.5px; color: var(--fg); display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--muted); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover { color: var(--fg); }
/* Hero */
.hero { padding: 100px 0 80px; text-align: center; position: relative; }
.hero::before { content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 600px; height: 400px; background: radial-gradient(ellipse, var(--accent-glow) 0%, transparent 70%); pointer-events: none; }
.badge { display: inline-block; padding: 6px 16px; border-radius: 50px; font-size: 0.8rem; font-weight: 600; color: var(--accent); background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.15); margin-bottom: 24px; letter-spacing: 0.3px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; margin-bottom: 20px; letter-spacing: -1.5px; line-height: 1.15; }
.hero h1 .gradient { background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 560px; margin: 0 auto 40px; line-height: 1.7; }
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: 10px; font-size: 0.95rem; font-weight: 600; transition: all 0.2s; border: none; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: #0b0d11; }
.btn-primary:hover { background: var(--accent-hover); text-decoration: none; transform: translateY(-1px); box-shadow: 0 8px 24px rgba(52,211,153,0.2); }
.btn-secondary { border: 1px solid var(--border); color: var(--fg); background: transparent; }
.btn-secondary:hover { border-color: var(--muted); text-decoration: none; background: rgba(255,255,255,0.03); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
/* Code block */
.code-section { margin: 56px auto 0; max-width: 660px; text-align: left; display: flex; flex-direction: column; }
.code-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: #1a1f2b; border: 1px solid var(--border); border-bottom: none; border-radius: var(--radius) var(--radius) 0 0; }
.code-dots { display: flex; gap: 6px; }
.code-dots span { width: 10px; height: 10px; border-radius: 50%; }
.code-dots span:nth-child(1) { background: #f87171; }
.code-dots span:nth-child(2) { background: #fbbf24; }
.code-dots span:nth-child(3) { background: #34d399; }
.code-label { font-size: 0.75rem; color: var(--muted); font-family: monospace; }
.code-block { background: var(--card); border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius); padding: 24px 28px; font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace; font-size: 0.85rem; line-height: 1.85; overflow-x: auto; }
.code-block .c { color: #4a5568; }
.code-block .s { color: var(--accent); }
.code-block .k { color: var(--accent2); }
.code-block .f { color: #c084fc; }
/* Sections */
section { position: relative; }
.section-title { text-align: center; font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; letter-spacing: -0.5px; margin-bottom: 12px; }
.section-sub { text-align: center; color: var(--muted); margin-bottom: 48px; font-size: 1.05rem; }
/* Features */
.features { padding: 80px 0; }
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 768px) { .features-grid { grid-template-columns: 1fr; } }
.feature-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; transition: border-color 0.2s, transform 0.2s; }
.feature-card:hover { border-color: rgba(52,211,153,0.3); transform: translateY(-2px); }
.feature-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; margin-bottom: 16px; background: rgba(52,211,153,0.08); }
.feature-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
/* Pricing */
.pricing { padding: 80px 0; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; max-width: 700px; margin: 0 auto; }
@media (max-width: 640px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px; position: relative; }
.price-card.featured { border-color: var(--accent); }
.price-card.featured::before { content: 'POPULAR'; position: absolute; top: -10px; right: 20px; background: var(--accent); color: #0b0d11; font-size: 0.65rem; font-weight: 700; padding: 3px 10px; border-radius: 50px; letter-spacing: 0.5px; }
.price-name { font-size: 0.9rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.price-amount { font-size: 3rem; font-weight: 800; letter-spacing: -2px; margin-bottom: 4px; }
.price-amount span { font-size: 1rem; color: var(--muted); font-weight: 400; letter-spacing: 0; }
.price-desc { color: var(--muted); font-size: 0.85rem; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.price-features { list-style: none; margin-bottom: 28px; }
.price-features li { padding: 5px 0; color: var(--muted); font-size: 0.9rem; display: flex; align-items: center; gap: 10px; }
.price-features li::before { content: "✓"; color: var(--accent); font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }
/* Trust */
.trust { padding: 60px 0 40px; }
.trust-grid { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; }
.trust-item { text-align: center; flex: 1; min-width: 160px; max-width: 220px; }
.trust-num { font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: -1px; }
.trust-label { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
/* EU Hosting */
.eu-hosting { padding: 40px 0 80px; }
.eu-badge { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; max-width: 600px; margin: 0 auto; display: flex; align-items: center; gap: 20px; transition: border-color 0.2s, transform 0.2s; }
.eu-badge:hover { border-color: rgba(52,211,153,0.3); transform: translateY(-2px); }
.eu-icon { font-size: 3rem; flex-shrink: 0; }
.eu-content h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 8px; color: var(--fg); }
.eu-content p { color: var(--muted); font-size: 0.95rem; line-height: 1.6; margin: 0; }
@media (max-width: 640px) {
.eu-badge { flex-direction: column; text-align: center; gap: 16px; padding: 24px; }
.eu-icon { font-size: 2.5rem; }
}
/* Footer */
footer { padding: 40px 0; border-top: 1px solid var(--border); }
footer .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer-left { color: var(--muted); font-size: 0.85rem; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); font-size: 0.85rem; }
.footer-links a:hover { color: var(--fg); }
/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(4px); z-index: 100; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; max-width: 460px; width: 90%; position: relative; }
.modal h2 { margin-bottom: 8px; font-size: 1.4rem; font-weight: 700; }
.modal p { color: var(--muted); margin-bottom: 24px; font-size: 0.95rem; }
.modal .close { position: absolute; top: 16px; right: 20px; color: var(--muted); font-size: 1.4rem; cursor: pointer; background: none; border: none; transition: color 0.2s; }
.modal .close:hover { color: var(--fg); }
/* Signup states */
#signupInitial, #signupLoading, #signupVerify, #signupResult { display: none; }
#signupInitial.active { display: block; }
#signupLoading.active { display: flex; flex-direction: column; align-items: center; padding: 40px 0; text-align: center; }
#signupResult.active { display: block; }
#signupVerify.active { display: block; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.key-box { background: var(--bg); border: 1px solid var(--accent); border-radius: 8px; padding: 16px; font-family: monospace; font-size: 0.82rem; word-break: break-all; margin: 16px 0 12px; position: relative; cursor: pointer; transition: background 0.2s; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.key-box:hover { background: #151922; }
.key-text { flex: 1; }
.copy-btn { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.2); color: var(--accent); border-radius: 6px; padding: 6px 14px; font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all 0.2s; }
.copy-btn:hover { background: rgba(52,211,153,0.2); }
.warning-box { background: rgba(251,191,36,0.06); border: 1px solid rgba(251,191,36,0.15); border-radius: 8px; padding: 12px 16px; font-size: 0.85rem; color: #fbbf24; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.warning-box .icon { font-size: 1.1rem; flex-shrink: 0; }
.signup-error { color: #f87171; font-size: 0.85rem; margin-bottom: 16px; display: none; padding: 10px 14px; background: rgba(248,113,113,0.06); border: 1px solid rgba(248,113,113,0.15); border-radius: 8px; }
/* Responsive */
@media (max-width: 640px) {
.hero { padding: 72px 0 56px; }
.nav-links { gap: 16px; }
.code-block {
font-size: 0.75rem;
padding: 18px 16px;
overflow-x: hidden;
word-wrap: break-word;
white-space: pre-wrap;
}
.trust-grid { gap: 24px; }
.footer-links { gap: 16px; }
footer .container { flex-direction: column; text-align: center; }
}
/* Fix mobile terminal gaps at 375px and smaller */
@media (max-width: 375px) {
.container {
padding: 0 12px !important;
}
.code-section {
margin: 32px auto 0;
max-width: calc(100vw - 24px) !important;
}
.code-header {
padding: 8px 12px;
}
.code-block {
padding: 12px !important;
font-size: 0.7rem;
}
.hero {
padding: 56px 0 40px;
}
}
/* Additional mobile overflow fixes */
html, body {
overflow-x: hidden !important;
max-width: 100vw !important;
}
@media (max-width: 768px) {
* {
max-width: 100% !important;
}
body {
overflow-x: hidden !important;
}
.container {
overflow-x: hidden !important;
max-width: 100vw !important;
padding: 0 16px !important;
}
.code-section {
max-width: calc(100vw - 32px) !important;
overflow: hidden !important;
display: flex !important;
flex-direction: column !important;
white-space: normal !important;
}
.code-block {
overflow-x: hidden !important;
white-space: pre-wrap !important;
word-break: break-all !important;
max-width: 100% !important;
box-sizing: border-box !important;
}
.trust-grid {
justify-content: center !important;
overflow-x: hidden !important;
max-width: 100% !important;
}
/* Force any wide elements to fit */
pre, code, .code-block {
max-width: calc(100vw - 32px) !important;
overflow-wrap: break-word !important;
word-break: break-all !important;
white-space: pre-wrap !important;
overflow-x: hidden !important;
}
.code-section {
max-width: calc(100vw - 32px) !important;
overflow-x: hidden !important;
white-space: normal !important;
}
}
/* Recovery modal states */
#recoverInitial, #recoverLoading, #recoverVerify, #recoverResult { display: none; }
#recoverInitial.active { display: block; }
#recoverLoading.active { display: flex; flex-direction: column; align-items: center; padding: 40px 0; text-align: center; }
#recoverResult.active { display: block; }
#recoverVerify.active { display: block; }
/* Email change modal states */
#emailChangeInitial, #emailChangeLoading, #emailChangeVerify, #emailChangeResult { display: none; }
#emailChangeInitial.active { display: block; }
#emailChangeLoading.active { display: flex; flex-direction: column; align-items: center; padding: 40px 0; text-align: center; }
#emailChangeResult.active { display: block; }
#emailChangeVerify.active { display: block; }
/* Focus-visible for accessibility */
.btn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
</style>