Separating css and js - getting way too long to manage
This commit is contained in:
parent
e7b82006e0
commit
38cf394916
4 changed files with 727 additions and 733 deletions
470
style.css
Normal file
470
style.css
Normal file
|
|
@ -0,0 +1,470 @@
|
|||
/* ── Design tokens ─────────────────────────────────────────────────────── */
|
||||
:root {
|
||||
--bg: #ffffff;
|
||||
--surface: #f4f4f7;
|
||||
--border: #e2e2ea;
|
||||
--text: #18181b;
|
||||
--muted: #71717a;
|
||||
--accent: #7c3aed;
|
||||
--accent-dim: #ede9fe;
|
||||
--accent-fg: #ffffff;
|
||||
--danger: #dc2626;
|
||||
--success: #16a34a;
|
||||
--r: 14px;
|
||||
--r-sm: 8px;
|
||||
--safe-t: env(safe-area-inset-top, 0px);
|
||||
--safe-b: env(safe-area-inset-bottom, 0px);
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root {
|
||||
--bg: #0f0f13;
|
||||
--surface: #17171f;
|
||||
--border: #2a2a38;
|
||||
--text: #f0f0f8;
|
||||
--muted: #8b8ba0;
|
||||
--accent: #a78bfa;
|
||||
--accent-dim: #2d1f5e;
|
||||
--accent-fg: #0f0f13;
|
||||
--danger: #f87171;
|
||||
--success: #4ade80;
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Reset & base ──────────────────────────────────────────────────────── */
|
||||
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
html { height: 100%; }
|
||||
|
||||
body {
|
||||
min-height: 100%;
|
||||
background: var(--bg);
|
||||
color: var(--text);
|
||||
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
||||
font-size: 16px;
|
||||
line-height: 1.5;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
|
||||
/* ── Layout ────────────────────────────────────────────────────────────── */
|
||||
.app {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* ── Header ────────────────────────────────────────────────────────────── */
|
||||
header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: calc(14px + var(--safe-t)) 20px 14px;
|
||||
background: var(--bg);
|
||||
border-bottom: 1px solid var(--border);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 9px;
|
||||
font-size: 1.05rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.logo-mark {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
background: var(--accent);
|
||||
color: var(--accent-fg);
|
||||
border-radius: 8px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 0.9rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.settings-btn {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
background: var(--surface);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--r-sm);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
font-size: 1.05rem;
|
||||
color: var(--muted);
|
||||
transition: background 0.15s, color 0.15s;
|
||||
position: relative;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
.settings-btn:active { background: var(--border); }
|
||||
|
||||
/* Red dot when credentials missing */
|
||||
.settings-btn.needs-setup::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: -3px;
|
||||
right: -3px;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: var(--danger);
|
||||
border-radius: 50%;
|
||||
border: 2px solid var(--bg);
|
||||
}
|
||||
|
||||
/* ── Main content ──────────────────────────────────────────────────────── */
|
||||
main {
|
||||
flex: 1;
|
||||
padding: 28px 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 22px;
|
||||
}
|
||||
|
||||
/* ── Emoji picker ──────────────────────────────────────────────────────── */
|
||||
.emoji-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.emoji-display {
|
||||
width: 92px;
|
||||
height: 92px;
|
||||
border-radius: 26px;
|
||||
background: var(--surface);
|
||||
border: 2px solid var(--border);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 3.25rem;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
transition: transform 0.12s, border-color 0.15s, background 0.15s;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.emoji-display:active { transform: scale(0.94); }
|
||||
.emoji-display:hover { border-color: var(--accent); background: var(--accent-dim); }
|
||||
|
||||
/* Visible emoji text input — slides in when picking */
|
||||
.emoji-picker-input {
|
||||
width: 200px;
|
||||
text-align: center;
|
||||
font-size: 1.5rem;
|
||||
/* collapse when hidden */
|
||||
max-height: 0;
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
overflow: hidden;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
border-color: transparent;
|
||||
transition: max-height 0.2s ease, padding 0.18s ease,
|
||||
opacity 0.15s ease, border-color 0.15s ease;
|
||||
}
|
||||
|
||||
.emoji-section.picking .emoji-picker-input {
|
||||
max-height: 60px;
|
||||
padding-top: 9px;
|
||||
padding-bottom: 9px;
|
||||
opacity: 1;
|
||||
pointer-events: all;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.emoji-hint {
|
||||
font-size: 0.8rem;
|
||||
color: var(--muted);
|
||||
transition: opacity 0.15s;
|
||||
}
|
||||
|
||||
/* ── Form fields ───────────────────────────────────────────────────────── */
|
||||
.field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 7px;
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 0.78rem;
|
||||
font-weight: 600;
|
||||
color: var(--muted);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.06em;
|
||||
}
|
||||
|
||||
textarea,
|
||||
input[type="url"],
|
||||
input[type="text"],
|
||||
input[type="password"] {
|
||||
background: var(--surface);
|
||||
border: 1.5px solid var(--border);
|
||||
border-radius: var(--r);
|
||||
color: var(--text);
|
||||
font-family: inherit;
|
||||
font-size: 1rem;
|
||||
padding: 13px 15px;
|
||||
width: 100%;
|
||||
outline: none;
|
||||
transition: border-color 0.15s, background 0.15s;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
textarea:focus,
|
||||
input[type="url"]:focus,
|
||||
input[type="text"]:focus,
|
||||
input[type="password"]:focus {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
textarea {
|
||||
resize: none;
|
||||
min-height: 116px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
textarea::placeholder,
|
||||
input::placeholder { color: var(--muted); }
|
||||
|
||||
.char-count {
|
||||
font-size: 0.78rem;
|
||||
color: var(--muted);
|
||||
text-align: right;
|
||||
transition: color 0.15s;
|
||||
}
|
||||
|
||||
.char-count.warn { color: var(--danger); }
|
||||
|
||||
/* ── Post button ───────────────────────────────────────────────────────── */
|
||||
.post-btn {
|
||||
background: var(--accent);
|
||||
color: var(--accent-fg);
|
||||
border: none;
|
||||
border-radius: var(--r);
|
||||
font-family: inherit;
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
padding: 16px;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
transition: opacity 0.15s, transform 0.1s;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
.post-btn:active:not(:disabled) { transform: scale(0.98); }
|
||||
.post-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
|
||||
.spinner {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border: 2.5px solid rgba(255, 255, 255, 0.35);
|
||||
border-top-color: white;
|
||||
border-radius: 50%;
|
||||
animation: spin 0.65s linear infinite;
|
||||
display: none;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.post-btn.loading .spinner { display: block; }
|
||||
.post-btn.loading .btn-label { display: none; }
|
||||
|
||||
@keyframes spin { to { transform: rotate(360deg); } }
|
||||
|
||||
/* ── Toast ─────────────────────────────────────────────────────────────── */
|
||||
#toast {
|
||||
position: fixed;
|
||||
bottom: calc(24px + var(--safe-b));
|
||||
left: 50%;
|
||||
transform: translateX(-50%) translateY(80px);
|
||||
background: var(--text);
|
||||
color: var(--bg);
|
||||
padding: 11px 22px;
|
||||
border-radius: 40px;
|
||||
font-size: 0.9rem;
|
||||
font-weight: 500;
|
||||
max-width: calc(100% - 40px);
|
||||
text-align: center;
|
||||
box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
|
||||
transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||
z-index: 200;
|
||||
pointer-events: none;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
#toast.show { transform: translateX(-50%) translateY(0); }
|
||||
#toast.success { background: var(--success); color: #fff; }
|
||||
#toast.error { background: var(--danger); color: #fff; }
|
||||
|
||||
/* ── Settings modal ────────────────────────────────────────────────────── */
|
||||
.overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.48);
|
||||
z-index: 50;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.25s;
|
||||
}
|
||||
|
||||
.overlay.open {
|
||||
opacity: 1;
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
.modal {
|
||||
background: var(--bg);
|
||||
border-radius: 22px 22px 0 0;
|
||||
width: 100%;
|
||||
max-width: 480px;
|
||||
margin: 0 auto;
|
||||
padding-bottom: calc(20px + var(--safe-b));
|
||||
transform: translateY(100%);
|
||||
transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1);
|
||||
max-height: 92vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.overlay.open .modal { transform: translateY(0); }
|
||||
|
||||
.modal-grip {
|
||||
width: 40px;
|
||||
height: 4px;
|
||||
background: var(--border);
|
||||
border-radius: 2px;
|
||||
margin: 10px auto 0;
|
||||
}
|
||||
|
||||
.modal-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 18px 20px 0;
|
||||
}
|
||||
|
||||
.modal-title {
|
||||
font-size: 1.1rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: var(--surface);
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
font-size: 0.85rem;
|
||||
color: var(--muted);
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
.close-btn:active { background: var(--border); }
|
||||
|
||||
.modal-body {
|
||||
padding: 20px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
/* Privacy notice */
|
||||
.privacy-notice {
|
||||
background: var(--accent-dim);
|
||||
border: 1.5px solid color-mix(in srgb, var(--accent) 30%, transparent);
|
||||
border-radius: var(--r);
|
||||
padding: 14px 16px;
|
||||
display: flex;
|
||||
gap: 11px;
|
||||
align-items: flex-start;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text);
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.privacy-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
|
||||
|
||||
/* API key with eye toggle */
|
||||
.input-wrap {
|
||||
position: relative;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.input-wrap input { padding-right: 48px; }
|
||||
|
||||
.eye-btn {
|
||||
position: absolute;
|
||||
right: 13px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: none;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
color: var(--muted);
|
||||
font-size: 1rem;
|
||||
padding: 4px;
|
||||
line-height: 1;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
.save-btn {
|
||||
background: var(--accent);
|
||||
color: var(--accent-fg);
|
||||
border: none;
|
||||
border-radius: var(--r);
|
||||
font-family: inherit;
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
padding: 14px;
|
||||
width: 100%;
|
||||
cursor: pointer;
|
||||
transition: opacity 0.15s;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
}
|
||||
|
||||
.save-btn:active { opacity: 0.8; }
|
||||
|
||||
/* ── Tablet / desktop ──────────────────────────────────────────────────── */
|
||||
@media (min-width: 520px) {
|
||||
.overlay { align-items: center; }
|
||||
|
||||
.modal {
|
||||
border-radius: 22px;
|
||||
margin: 20px;
|
||||
width: calc(100% - 40px);
|
||||
max-height: 80vh;
|
||||
transform: scale(0.96) translateY(10px);
|
||||
opacity: 0;
|
||||
transition: transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1), opacity 0.2s;
|
||||
}
|
||||
|
||||
.overlay.open .modal {
|
||||
transform: scale(1) translateY(0);
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.modal-grip { display: none; }
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue