From 34da76607ff326856c314db801af2720cc727eb8 Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 1 May 2026 11:23:41 +0300 Subject: [PATCH 01/11] add app.css with reset and design tokens introduce a single shared stylesheet under public/css. this first section covers a minimal reset, warm/readable design tokens (color, typography, spacing, radii, shadows), and base element styling for headings, links, lists, forms, and buttons. layout primitives and component classes follow in subsequent commits. --- public/css/app.css | 218 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 218 insertions(+) create mode 100644 public/css/app.css diff --git a/public/css/app.css b/public/css/app.css new file mode 100644 index 0000000..bc9ec31 --- /dev/null +++ b/public/css/app.css @@ -0,0 +1,218 @@ +/* ========================================================================= + Daily Goals - app.css + Single shared stylesheet. Sectioned for readability. + ========================================================================= */ + +/* ------------------------------------------------------------------------- + 1. Reset + ------------------------------------------------------------------------- */ + +*, +*::before, +*::after { + box-sizing: border-box; +} + +html, +body { + margin: 0; + padding: 0; +} + +img, +svg { + display: block; + max-width: 100%; +} + +button { + font: inherit; + color: inherit; + cursor: pointer; +} + +input, +textarea, +select { + font: inherit; + color: inherit; +} + +/* ------------------------------------------------------------------------- + 2. Design tokens + ------------------------------------------------------------------------- */ + +:root { + /* Color: warm, readable palette */ + --color-bg: #faf7f2; + --color-surface: #ffffff; + --color-surface-alt: #f3ede2; + --color-text: #2b2622; + --color-text-muted: #6b5d52; + --color-primary: #5a7a4f; + --color-primary-hover: #486340; + --color-accent: #8a5a3b; + --color-accent-hover: #6f4730; + --color-border: #e3dccf; + --color-border-strong: #c9bfae; + --color-danger: #a94442; + --color-success: #4f7a5a; + + /* Typography */ + --font-serif: Georgia, "Iowan Old Style", "Source Serif Pro", serif; + --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, + sans-serif; + --font-size-base: 1rem; + --font-size-sm: 0.875rem; + --font-size-lg: 1.125rem; + --font-size-h1: 2rem; + --font-size-h2: 1.5rem; + --font-size-h3: 1.25rem; + --line-height-base: 1.6; + --line-height-tight: 1.25; + + /* Spacing scale */ + --space-1: 0.25rem; + --space-2: 0.5rem; + --space-3: 0.75rem; + --space-4: 1rem; + --space-5: 1.5rem; + --space-6: 2rem; + --space-7: 3rem; + + /* Layout */ + --max-width: 42rem; + --max-width-wide: 60rem; + + /* Radii */ + --radius-sm: 4px; + --radius-md: 8px; + --radius-lg: 12px; + + /* Shadows */ + --shadow-sm: 0 1px 2px rgba(43, 38, 34, 0.06); + --shadow-md: 0 4px 12px rgba(43, 38, 34, 0.1); + --shadow-lg: 0 12px 32px rgba(43, 38, 34, 0.18); + + /* Transitions */ + --transition-fast: 120ms ease; + --transition-base: 200ms ease; +} + +/* ------------------------------------------------------------------------- + 3. Base elements + ------------------------------------------------------------------------- */ + +body { + background-color: var(--color-bg); + color: var(--color-text); + font-family: var(--font-sans); + font-size: var(--font-size-base); + line-height: var(--line-height-base); + -webkit-font-smoothing: antialiased; + text-rendering: optimizeLegibility; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + font-family: var(--font-serif); + font-weight: 600; + line-height: var(--line-height-tight); + margin: 0; + color: var(--color-text); +} + +h1 { + font-size: var(--font-size-h1); +} + +h2 { + font-size: var(--font-size-h2); +} + +h3 { + font-size: var(--font-size-h3); +} + +p { + margin: 0; +} + +a { + color: var(--color-accent); + text-decoration: none; + transition: color var(--transition-fast); +} + +a:hover, +a:focus { + color: var(--color-accent-hover); + text-decoration: underline; +} + +ul, +ol { + margin: 0; + padding: 0; + list-style: none; +} + +label { + display: block; + font-size: var(--font-size-sm); + color: var(--color-text-muted); + font-weight: 500; +} + +input[type="text"], +input[type="email"], +input[type="password"], +input[type="date"], +input[type="number"], +textarea, +select { + display: block; + width: 100%; + margin-top: var(--space-1); + padding: var(--space-2) var(--space-3); + background-color: var(--color-surface); + color: var(--color-text); + border: 1px solid var(--color-border-strong); + border-radius: var(--radius-sm); + transition: border-color var(--transition-fast), + box-shadow var(--transition-fast); +} + +input:focus, +textarea:focus, +select:focus { + outline: none; + border-color: var(--color-primary); + box-shadow: 0 0 0 3px rgba(90, 122, 79, 0.15); +} + +button { + display: inline-block; + padding: var(--space-2) var(--space-4); + background-color: var(--color-surface); + color: var(--color-text); + border: 1px solid var(--color-border-strong); + border-radius: var(--radius-sm); + font-weight: 500; + transition: background-color var(--transition-fast), + border-color var(--transition-fast), color var(--transition-fast); +} + +button:hover, +button:focus { + background-color: var(--color-surface-alt); + border-color: var(--color-text-muted); +} + +form { + margin: 0; +} From d4a8adc4a4411ca8e659be0dee9f9833a236369b Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 1 May 2026 11:24:30 +0300 Subject: [PATCH 02/11] link app.css and add viewport meta in templates add a stylesheet link and the standard responsive viewport meta tag to every page template. purely additive - no markup or selector changes - so existing cypress assertions and page js id hooks remain intact. with this commit every page picks up the base styling from app.css. --- views/templates/admin.php | 3 +++ views/templates/forbidden.php | 3 +++ views/templates/home.php | 3 +++ views/templates/login.php | 3 +++ views/templates/register.php | 3 +++ views/templates/text.php | 3 +++ views/templates/texts.php | 3 +++ views/templates/today.php | 3 +++ 8 files changed, 24 insertions(+) diff --git a/views/templates/admin.php b/views/templates/admin.php index f1fc83d..59be004 100644 --- a/views/templates/admin.php +++ b/views/templates/admin.php @@ -1,7 +1,10 @@ + + Daily Goals - Admin + diff --git a/views/templates/forbidden.php b/views/templates/forbidden.php index 43cd644..334edac 100644 --- a/views/templates/forbidden.php +++ b/views/templates/forbidden.php @@ -1,7 +1,10 @@ + + Daily Goals - Forbidden +

403 Forbidden

diff --git a/views/templates/home.php b/views/templates/home.php index 258a404..837e0a6 100644 --- a/views/templates/home.php +++ b/views/templates/home.php @@ -1,7 +1,10 @@ + + Daily Goals - Home +

Home

diff --git a/views/templates/login.php b/views/templates/login.php index 93f4b56..7fa70fc 100644 --- a/views/templates/login.php +++ b/views/templates/login.php @@ -1,7 +1,10 @@ + + Daily Goals - Login +

Login

diff --git a/views/templates/register.php b/views/templates/register.php index 223247c..47cea7a 100644 --- a/views/templates/register.php +++ b/views/templates/register.php @@ -1,7 +1,10 @@ + + Daily Goals - Register +

Register

diff --git a/views/templates/text.php b/views/templates/text.php index 8f68729..477ec12 100644 --- a/views/templates/text.php +++ b/views/templates/text.php @@ -1,7 +1,10 @@ + + Daily Goals - Text + Back to Texts diff --git a/views/templates/texts.php b/views/templates/texts.php index f8e8d7d..a56b5d2 100644 --- a/views/templates/texts.php +++ b/views/templates/texts.php @@ -1,7 +1,10 @@ + + Daily Goals - Texts +

Texts

diff --git a/views/templates/today.php b/views/templates/today.php index 6edba97..e76d875 100644 --- a/views/templates/today.php +++ b/views/templates/today.php @@ -1,7 +1,10 @@ + + Daily Goals - Today +

Today

From b259a1243e8e05d36e81e78b1ed15eac52db8d3c Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 1 May 2026 11:24:58 +0300 Subject: [PATCH 03/11] add layout primitives and components to app.css extend app.css with the every-layout style primitives (container, stack, cluster, center) used to compose page shells, plus a small component layer: site-header, btn (primary/secondary/danger), card and card-link, list-cards, modal, error and a few utility classes. no template changes here - templates start adopting these classes in the per-page styling commits that follow. --- public/css/app.css | 200 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) diff --git a/public/css/app.css b/public/css/app.css index bc9ec31..519c7ec 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -216,3 +216,203 @@ button:focus { form { margin: 0; } + +/* ------------------------------------------------------------------------- + 4. Layout primitives + ------------------------------------------------------------------------- */ + +.container { + width: 100%; + max-width: var(--max-width); + margin-inline: auto; + padding: var(--space-5) var(--space-4); +} + +.container-wide { + max-width: var(--max-width-wide); +} + +.stack > * + * { + margin-top: var(--space-4); +} + +.stack-sm > * + * { + margin-top: var(--space-2); +} + +.stack-lg > * + * { + margin-top: var(--space-6); +} + +.cluster { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--space-3); +} + +.cluster-end { + justify-content: flex-end; +} + +.cluster-between { + justify-content: space-between; +} + +.center { + display: flex; + align-items: center; + justify-content: center; +} + +/* ------------------------------------------------------------------------- + 5. Components + ------------------------------------------------------------------------- */ + +.site-header { + border-bottom: 1px solid var(--color-border); + padding: var(--space-3) var(--space-4); + background-color: var(--color-surface); +} + +.site-header .site-header-inner { + width: 100%; + max-width: var(--max-width); + margin-inline: auto; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: var(--space-3); +} + +.btn { + display: inline-block; + padding: var(--space-2) var(--space-4); + border-radius: var(--radius-sm); + border: 1px solid var(--color-border-strong); + background-color: var(--color-surface); + color: var(--color-text); + font-weight: 500; + text-decoration: none; + transition: background-color var(--transition-fast), + border-color var(--transition-fast), color var(--transition-fast); +} + +.btn:hover, +.btn:focus { + background-color: var(--color-surface-alt); + border-color: var(--color-text-muted); + text-decoration: none; +} + +.btn-primary { + background-color: var(--color-primary); + border-color: var(--color-primary); + color: #ffffff; +} + +.btn-primary:hover, +.btn-primary:focus { + background-color: var(--color-primary-hover); + border-color: var(--color-primary-hover); + color: #ffffff; +} + +.btn-secondary { + background-color: transparent; + border-color: var(--color-border-strong); + color: var(--color-text); +} + +.btn-danger { + background-color: transparent; + border-color: var(--color-danger); + color: var(--color-danger); +} + +.btn-danger:hover, +.btn-danger:focus { + background-color: var(--color-danger); + color: #ffffff; +} + +.card { + background-color: var(--color-surface); + border: 1px solid var(--color-border); + border-radius: var(--radius-md); + padding: var(--space-4); + box-shadow: var(--shadow-sm); +} + +.card-link { + display: block; + color: inherit; + text-decoration: none; + transition: border-color var(--transition-fast), + box-shadow var(--transition-fast), + transform var(--transition-fast); +} + +.card-link:hover, +.card-link:focus { + border-color: var(--color-border-strong); + box-shadow: var(--shadow-md); + text-decoration: none; +} + +.list-cards { + display: flex; + flex-direction: column; + gap: var(--space-3); +} + +.modal { + position: fixed; + inset: 0; + z-index: 50; + display: flex; + align-items: center; + justify-content: center; + padding: var(--space-4); + background-color: rgba(43, 38, 34, 0.45); +} + +.modal[hidden] { + display: none; +} + +.modal-content { + width: 100%; + max-width: 28rem; + background-color: var(--color-surface); + border: 1px solid var(--color-border); + border-radius: var(--radius-md); + box-shadow: var(--shadow-lg); + padding: var(--space-5); +} + +.error { + color: var(--color-danger); + font-size: var(--font-size-sm); +} + +.muted { + color: var(--color-text-muted); +} + +/* ------------------------------------------------------------------------- + 6. Utilities + ------------------------------------------------------------------------- */ + +.full-width { + width: 100%; +} + +.text-center { + text-align: center; +} + +[hidden] { + display: none !important; +} From 807458ebe8a1e848f953fb37974a17ebc378fd8e Mon Sep 17 00:00:00 2001 From: Yisroel Baum Date: Fri, 1 May 2026 11:25:45 +0300 Subject: [PATCH 04/11] style home page with shell and card list apply the new design system to the home page: wrap content in a container/stack shell with a site-header for the logout and today links, render the texts list as a vertical stack of cards via the list-cards primitive, and dress the create plan modal with the new modal/btn classes. js renders each text as an li.card with the create-plan button preserved so existing cypress hooks (li, .create-plan, .plan-name, .save-plan, .cancel-plan, ids) keep matching. --- public/js/home.js | 8 ++++--- views/templates/home.php | 49 +++++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/public/js/home.js b/public/js/home.js index e7abc7c..ecf8268 100644 --- a/public/js/home.js +++ b/public/js/home.js @@ -9,9 +9,11 @@ document.addEventListener('DOMContentLoaded', () => { const texts = await response.json(); textsList.innerHTML = texts .map(text => - '
  • ' + text.name + - '
  • ' + '
  • ' + + '' + text.name + '' + + '' + + '
  • ' ) .join(''); } diff --git a/views/templates/home.php b/views/templates/home.php index 837e0a6..97d3aa7 100644 --- a/views/templates/home.php +++ b/views/templates/home.php @@ -7,24 +7,37 @@ -

    Home

    - - Today's schedule -
      -
    -