Files
hobbypj-contents/assets/css/admin.css
T
Bkk1234 c00bc62272 feat: hobby project landing page (PWA + SPA) with admin backoffice
- landing page: welcome hero, live search, project card grid (10 projects from owner list)
- warm brown/white theme (fastwork-inspired layout), embedded K2D Thai font
- PWA: manifest, PIL-generated icons, versioned service worker with auto-update
- backoffice at #/admin: edit name/description/url, reorder, delete, publish
- server/publish.mjs: zero-dependency static server + PUT api/projects with
  validation, JSON write, git commit and push; loopback-only unless ADMIN_TOKEN
- docs: README, DESIGN.md (color/type contract), AGENTS.md
2026-11-19 01:03:13 +07:00

313 lines
6.5 KiB
CSS

/* ==========================================================================
admin.css — หน้าจัดการข้อมูล (หลังบ้าน)
========================================================================== */
.admin-head {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
justify-content: space-between;
gap: var(--space-4);
padding-bottom: var(--space-5);
border-bottom: 1px solid var(--border);
}
.admin-head__title {
font-size: clamp(1.35rem, 1.15rem + 0.9vw, 1.75rem);
}
.admin-head__sub {
margin-top: 6px;
color: var(--muted-foreground);
font-size: 14.5px;
max-width: 52ch;
}
.admin-head__actions {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
}
.panel {
margin-top: var(--space-6);
border: 1px solid var(--border);
border-radius: var(--radius-lg);
background: var(--surface);
overflow: hidden;
}
.panel__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
padding: var(--space-4) var(--space-5);
background: var(--surface-2);
border-bottom: 1px solid var(--border);
}
.panel__title {
font-size: 1rem;
font-weight: 700;
color: var(--brand-900);
}
.panel__body {
padding: var(--space-5);
}
/* ------------------------------------------------------------- fields */
.field {
display: flex;
flex-direction: column;
gap: 6px;
}
.field + .field {
margin-top: var(--space-4);
}
.field__label {
font-size: 14px;
font-weight: 500;
color: var(--brand-800);
}
.field__hint {
font-size: 12.5px;
color: var(--muted-foreground);
}
.field input[type="text"],
.field input[type="url"],
.field input[type="email"],
.field textarea,
.field select {
width: 100%;
min-height: 44px;
padding: 10px 14px;
border: 1px solid var(--border-strong);
border-radius: var(--radius-md);
background: #fff;
font-size: 15px;
transition:
border-color 150ms var(--ease),
box-shadow 150ms var(--ease);
}
.field textarea {
min-height: 84px;
resize: vertical;
line-height: 1.55;
}
.field input:hover,
.field textarea:hover {
border-color: var(--brand-300);
}
.field input:focus,
.field textarea:focus {
outline: none;
border-color: var(--brand-500);
box-shadow: 0 0 0 4px rgba(196, 112, 60, 0.15);
}
.field--error input,
.field--error textarea {
border-color: #b3391f;
box-shadow: 0 0 0 4px rgba(179, 57, 31, 0.12);
}
.field__error {
font-size: 12.5px;
color: #8f2c19;
font-weight: 500;
}
.field__error:empty {
display: none;
}
/* ------------------------------------------------------------- rows */
.admin-list {
display: flex;
flex-direction: column;
gap: var(--space-4);
}
.admin-item {
border: 1px solid var(--border);
border-radius: var(--radius-md);
background: var(--surface);
padding: var(--space-4);
}
.admin-item__head {
display: flex;
align-items: center;
gap: var(--space-3);
padding-bottom: var(--space-3);
border-bottom: 1px solid var(--brand-50);
margin-bottom: var(--space-4);
}
.admin-item__index {
flex: none;
display: grid;
place-items: center;
width: 30px;
height: 30px;
border-radius: 9px;
background: var(--brand-100);
color: var(--brand-800);
font-size: 13px;
font-weight: 700;
}
.admin-item__label {
flex: 1 1 auto;
min-width: 0;
font-weight: 500;
color: var(--brand-900);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.admin-item__tools {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.admin-item__tools .btn {
min-height: 36px;
padding: 6px 10px;
font-size: 13px;
border-radius: var(--radius-sm);
}
.admin-item__tools .btn svg {
width: 16px;
height: 16px;
}
.admin-grid-2 {
display: grid;
gap: var(--space-4);
margin-top: var(--space-4);
}
.admin-item .admin-grid-2:first-of-type {
margin-top: 0;
}
.admin-item .field + .field {
margin-top: var(--space-4);
}
/* ------------------------------------------------------------- publish */
.publish-status {
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 14px;
padding: 12px 16px;
border-radius: var(--radius-md);
background: var(--brand-50);
border: 1px solid var(--brand-200);
color: var(--brand-800);
font-size: 14px;
}
.publish-status__dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--brand-500);
}
.publish-status[data-state="ok"] .publish-status__dot {
background: #2f7a44;
}
.publish-status[data-state="warn"] {
background: #fdf3e7;
border-color: #f0cfa8;
color: #7c4a13;
}
.publish-status[data-state="error"] {
background: #fdf1ee;
border-color: #e7c4bb;
color: #8f2c19;
}
.admin-hint {
margin-top: var(--space-3);
font-size: 13px;
color: var(--muted-foreground);
}
.admin-hint code {
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 12.5px;
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: 6px;
padding: 1px 6px;
}
.dirty-bar {
position: sticky;
bottom: 12px;
margin-top: var(--space-5);
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
padding: 12px 16px;
border-radius: var(--radius-lg);
background: rgba(61, 36, 26, 0.96);
color: #fff;
box-shadow: var(--shadow-lg);
}
.dirty-bar[hidden] {
display: none;
}
.dirty-bar__text {
font-size: 14px;
}
.dirty-bar__actions {
display: flex;
gap: 8px;
}
.dirty-bar .btn--ghost {
background: transparent;
border-color: rgba(255, 255, 255, 0.35);
color: #fff;
}
.dirty-bar .btn--ghost:hover {
background: rgba(255, 255, 255, 0.12);
}
.dirty-bar .btn--primary {
background: #fff;
color: var(--brand-800);
}
.dirty-bar .btn--primary:hover {
background: var(--brand-100);
}
/* ------------------------------------------------------------- dialog */
.dialog {
width: min(560px, calc(100vw - 32px));
border: 1px solid var(--border);
border-radius: var(--radius-lg);
padding: 0;
color: var(--foreground);
box-shadow: var(--shadow-lg);
}
.dialog::backdrop {
background: rgba(36, 26, 21, 0.45);
backdrop-filter: blur(2px);
}
.dialog__head {
padding: var(--space-5);
border-bottom: 1px solid var(--border);
}
.dialog__title {
font-size: 1.05rem;
}
.dialog__body {
padding: var(--space-5);
}
.dialog__foot {
display: flex;
flex-wrap: wrap;
justify-content: flex-end;
gap: var(--space-2);
padding: var(--space-4) var(--space-5);
border-top: 1px solid var(--border);
background: var(--surface-2);
}
@media (min-width: 760px) {
.admin-grid-2 {
grid-template-columns: 1fr 1fr;
gap: var(--space-4) var(--space-5);
}
}