Compare commits
4 Commits
397ee1a413
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 89d0dcc67c | |||
| 3c2d90fb7e | |||
| 20f4fd7095 | |||
| aa31507ff5 |
@@ -19,6 +19,9 @@ No framework, no build step. PHP + SQLite for caching, Bootstrap 5 for the UI.
|
|||||||
selection** from the browser (`manage.php`, password protected): add
|
selection** from the browser (`manage.php`, password protected): add
|
||||||
channels by `@handle`, disable or remove feeds — no config editing needed.
|
channels by `@handle`, disable or remove feeds — no config editing needed.
|
||||||
- Paginates with a **"Load more stories"** button (AJAX, 20 per page).
|
- Paginates with a **"Load more stories"** button (AJAX, 20 per page).
|
||||||
|
- Streams the page shell (header, filters and a skeleton loader) to the browser
|
||||||
|
**before** the feeds are fetched, so something paints within milliseconds on
|
||||||
|
every open.
|
||||||
- Caches everything in **SQLite** so page loads never wait on the network; feeds
|
- Caches everything in **SQLite** so page loads never wait on the network; feeds
|
||||||
are refreshed on demand when stale (default TTL 30 min).
|
are refreshed on demand when stale (default TTL 30 min).
|
||||||
|
|
||||||
@@ -217,13 +220,16 @@ index.php api/items.php
|
|||||||
FeedService::page(source, page, pageSize, since) ← read path
|
FeedService::page(source, page, pageSize, since) ← read path
|
||||||
└─ FeedRepository::getItems()/countItems() SQL over the SQLite cache
|
└─ FeedRepository::getItems()/countItems() SQL over the SQLite cache
|
||||||
│
|
│
|
||||||
└─ View::render('layout' | 'cards') server-rendered HTML
|
└─ View::render('cards') server-rendered HTML
|
||||||
(api/items.php returns that HTML inside a JSON envelope)
|
(api/items.php returns that HTML inside a JSON envelope)
|
||||||
```
|
```
|
||||||
|
|
||||||
**Request lifecycle (page load):** bootstrap → refresh stale feeds → validate
|
**Request lifecycle (page load):** bootstrap → sync configured feeds → render
|
||||||
`source`/`range` → query one page → render `templates/layout.php` which includes
|
`templates/shell.php` (head, header, filters, skeleton loader) and **flush it**
|
||||||
`templates/cards.php`.
|
→ refresh stale feeds → query one page → append the rendered
|
||||||
|
`templates/content.php` (which includes `templates/cards.php`) and drop the
|
||||||
|
loader. The shell paints while the refresh is still running; the loader never
|
||||||
|
outlives the fetch — the content chunk removes it as soon as it arrives.
|
||||||
|
|
||||||
**Request lifecycle (load more):** `assets/app.js` calls `api/items.php` with the
|
**Request lifecycle (load more):** `assets/app.js` calls `api/items.php` with the
|
||||||
next `page` (plus current `source` and `range`), receives
|
next `page` (plus current `source` and `range`), receives
|
||||||
@@ -283,7 +289,8 @@ button when `has_more` is false.
|
|||||||
│ ├── ManageAuth.php manage.php gate: password, CSRF, flash messages
|
│ ├── ManageAuth.php manage.php gate: password, CSRF, flash messages
|
||||||
│ └── View.php Escaping + render() + labels/colors/time formatting
|
│ └── View.php Escaping + render() + labels/colors/time formatting
|
||||||
├── templates/
|
├── templates/
|
||||||
│ ├── layout.php Full page shell, filters, grid, empty state, Load more
|
│ ├── shell.php Streamed first: head, header, filters, feed loader
|
||||||
|
│ ├── content.php Streamed after the refresh: grid, empty state, Load more
|
||||||
│ ├── manage.php Feed management page (login, add forms, feed list)
|
│ ├── manage.php Feed management page (login, add forms, feed list)
|
||||||
│ └── cards.php One feed card partial (used by page + API)
|
│ └── cards.php One feed card partial (used by page + API)
|
||||||
├── assets/
|
├── assets/
|
||||||
@@ -461,6 +468,23 @@ sourceColor('hackernews') // hex used for the card spine, chip and active pill
|
|||||||
|
|
||||||
The source tab and filter pill are generated automatically from `sources()`.
|
The source tab and filter pill are generated automatically from `sources()`.
|
||||||
|
|
||||||
|
### Colour system (`assets/style.css`)
|
||||||
|
|
||||||
|
The dashboard has **no house colour**. One ink ramp (`--bg` → `--ink`) carries
|
||||||
|
every neutral surface, line, and label, and the only saturated colour on screen
|
||||||
|
belongs to the sources — used strictly as a signal: filter pill, card spine,
|
||||||
|
source chip, timestamp, feed health. Two rules hold it together:
|
||||||
|
|
||||||
|
- **Bright fill, deep ink type.** Every filled state (active pill, source chip,
|
||||||
|
primary action) is a bright fill with `--ink-deep` type — no white text on
|
||||||
|
saturated fills, no gradient fills.
|
||||||
|
- **One hue per source, mirrored in two places.** `:root` defines the token
|
||||||
|
(`--youtube`, `--reddit`, `--rt`) and `View::sourceColor()` returns the same
|
||||||
|
hex for the inline `--src`/`--pill` values the templates emit. Change both.
|
||||||
|
|
||||||
|
The header rail (`.wire-rail`) is the colour legend: one segment per source, in
|
||||||
|
order.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Deployment notes (Apache + php-fpm on SELinux, e.g. Fedora)
|
## Deployment notes (Apache + php-fpm on SELinux, e.g. Fedora)
|
||||||
|
|||||||
+249
-123
@@ -1,21 +1,47 @@
|
|||||||
:root {
|
/* ==========================================================================
|
||||||
--ink: #160b2e;
|
RSS Feed Dashboard — "Nightwire" palette
|
||||||
--ink-soft: #5b5178;
|
--------------------------------------------------------------------------
|
||||||
--bg: #f4f1ff;
|
Thesis: the dashboard has no house colour. One calm ink family carries the
|
||||||
--surface: #ffffff;
|
whole interface; the only saturated colour belongs to the sources
|
||||||
--line: #e6dffb;
|
(YouTube / Reddit / RT) and is used strictly as a signal — filter pills,
|
||||||
|
card spines, chips, timestamps, feed health.
|
||||||
|
|
||||||
--accent: #6a3dff;
|
Rule for every filled state: bright fill, deep ink type.
|
||||||
--youtube: #ff1f4b;
|
========================================================================== */
|
||||||
--reddit: #ff6a00;
|
|
||||||
--rt: #00c389;
|
:root {
|
||||||
--sun: #ffc24b;
|
color-scheme: dark;
|
||||||
|
|
||||||
|
/* Ink ramp — cool indigo-slate, not black */
|
||||||
|
--bg: #0f1319;
|
||||||
|
--surface: #161b24;
|
||||||
|
--surface-2: #1e242f;
|
||||||
|
--line: #262d3a;
|
||||||
|
--line-2: #3a4351;
|
||||||
|
|
||||||
|
--ink: #f1f3f7;
|
||||||
|
--ink-soft: #a3adbd;
|
||||||
|
--ink-faint: #828da1;
|
||||||
|
--ink-deep: #0c1015; /* type that sits on a bright fill */
|
||||||
|
|
||||||
|
/* Source signals — the only chroma in the UI */
|
||||||
|
--youtube: #ff3b5c;
|
||||||
|
--reddit: #ff7a2f;
|
||||||
|
--rt: #1fcb93;
|
||||||
|
|
||||||
|
/* Neutral interactive: the "All" tab, neutral pills, primary action */
|
||||||
|
--accent: var(--ink);
|
||||||
|
|
||||||
--display: "Space Grotesk", system-ui, sans-serif;
|
--display: "Space Grotesk", system-ui, sans-serif;
|
||||||
--body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
|
--body: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
|
||||||
--mono: "JetBrains Mono", ui-monospace, monospace;
|
--mono: "JetBrains Mono", ui-monospace, monospace;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::selection {
|
||||||
|
background: var(--ink);
|
||||||
|
color: var(--ink-deep);
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------- Shell ---------- */
|
/* ---------- Shell ---------- */
|
||||||
|
|
||||||
.app-body {
|
.app-body {
|
||||||
@@ -27,17 +53,15 @@
|
|||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* One soft wash of panel light from the top edge. No coloured blobs, so the
|
||||||
|
source hues stay the only chroma on screen. */
|
||||||
.app-body::before {
|
.app-body::before {
|
||||||
content: "";
|
content: "";
|
||||||
position: fixed;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
z-index: 0;
|
z-index: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background:
|
background: radial-gradient(58rem 30rem at 50% -14%, rgba(241, 243, 247, 0.055), transparent 72%);
|
||||||
radial-gradient(42rem 30rem at 6% -8%, rgba(106, 61, 255, 0.18), transparent 62%),
|
|
||||||
radial-gradient(36rem 26rem at 98% -4%, rgba(255, 31, 75, 0.14), transparent 60%),
|
|
||||||
radial-gradient(34rem 26rem at 52% 112%, rgba(0, 195, 137, 0.16), transparent 62%),
|
|
||||||
radial-gradient(30rem 22rem at 82% 78%, rgba(255, 106, 0, 0.12), transparent 60%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.site-header,
|
.site-header,
|
||||||
@@ -52,10 +76,10 @@ main {
|
|||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
z-index: 20;
|
z-index: 20;
|
||||||
background: rgba(255, 255, 255, 0.78);
|
background: rgba(15, 19, 25, 0.82);
|
||||||
border-bottom: 1px solid var(--line);
|
border-bottom: 1px solid var(--line);
|
||||||
backdrop-filter: saturate(180%) blur(16px);
|
backdrop-filter: saturate(160%) blur(16px);
|
||||||
-webkit-backdrop-filter: saturate(180%) blur(16px);
|
-webkit-backdrop-filter: saturate(160%) blur(16px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand {
|
.brand {
|
||||||
@@ -65,12 +89,18 @@ main {
|
|||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Signal bars: three feeds, ascending strength, one per source hue. */
|
||||||
.brand-mark {
|
.brand-mark {
|
||||||
width: 26px;
|
width: 30px;
|
||||||
height: 26px;
|
height: 26px;
|
||||||
border-radius: 9px;
|
border-radius: 9px;
|
||||||
background: conic-gradient(from 220deg, var(--accent), var(--youtube), var(--reddit), var(--rt), var(--accent));
|
border: 1px solid var(--line);
|
||||||
box-shadow: 0 6px 16px rgba(106, 61, 255, 0.4);
|
background:
|
||||||
|
linear-gradient(var(--youtube), var(--youtube)) 6px bottom / 3px 8px no-repeat,
|
||||||
|
linear-gradient(var(--reddit), var(--reddit)) 12px bottom / 3px 13px no-repeat,
|
||||||
|
linear-gradient(var(--rt), var(--rt)) 18px bottom / 3px 18px no-repeat,
|
||||||
|
var(--surface-2);
|
||||||
|
box-shadow: 0 4px 14px -6px rgba(0, 0, 0, 0.65);
|
||||||
}
|
}
|
||||||
|
|
||||||
.brand-text {
|
.brand-text {
|
||||||
@@ -83,10 +113,7 @@ main {
|
|||||||
|
|
||||||
.brand-text em {
|
.brand-text em {
|
||||||
font-style: normal;
|
font-style: normal;
|
||||||
background: linear-gradient(90deg, var(--accent), var(--youtube) 55%, var(--reddit));
|
color: var(--ink-faint);
|
||||||
-webkit-background-clip: text;
|
|
||||||
background-clip: text;
|
|
||||||
color: transparent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-meta {
|
.header-meta {
|
||||||
@@ -99,30 +126,38 @@ main {
|
|||||||
opacity: 0.4;
|
opacity: 0.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Desk is live — neutral pulse, so it is never confused with a source. */
|
||||||
.pulse {
|
.pulse {
|
||||||
width: 8px;
|
width: 8px;
|
||||||
height: 8px;
|
height: 8px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
background: var(--rt);
|
background: var(--ink);
|
||||||
animation: pulse 2.2s ease-out infinite;
|
animation: pulse 2.2s ease-out infinite;
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes pulse {
|
@keyframes pulse {
|
||||||
0% { box-shadow: 0 0 0 0 rgba(0, 195, 137, 0.55); }
|
0% { box-shadow: 0 0 0 0 rgba(241, 243, 247, 0.32); }
|
||||||
70% { box-shadow: 0 0 0 9px rgba(0, 195, 137, 0); }
|
70% { box-shadow: 0 0 0 9px rgba(241, 243, 247, 0); }
|
||||||
100% { box-shadow: 0 0 0 0 rgba(0, 195, 137, 0); }
|
100% { box-shadow: 0 0 0 0 rgba(241, 243, 247, 0); }
|
||||||
}
|
}
|
||||||
|
|
||||||
.spectrum-rail {
|
/* Three wires — one segment per source, page-coloured gaps between them. */
|
||||||
height: 5px;
|
.wire-rail {
|
||||||
|
height: 3px;
|
||||||
background: linear-gradient(90deg,
|
background: linear-gradient(90deg,
|
||||||
var(--accent), var(--youtube) 32%, var(--reddit) 60%, var(--sun) 78%, var(--rt));
|
var(--youtube) 0, var(--youtube) calc(33.333% - 1px),
|
||||||
|
var(--bg) calc(33.333% - 1px), var(--bg) calc(33.333% + 1px),
|
||||||
|
var(--reddit) calc(33.333% + 1px), var(--reddit) calc(66.666% - 1px),
|
||||||
|
var(--bg) calc(66.666% - 1px), var(--bg) calc(66.666% + 1px),
|
||||||
|
var(--rt) calc(66.666% + 1px));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- Filter pills ---------- */
|
/* ---------- Filter pills ---------- */
|
||||||
|
|
||||||
.filter-pills {
|
.filter-pills {
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: var(--line-2) transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-pill {
|
.filter-pill {
|
||||||
@@ -133,13 +168,13 @@ main {
|
|||||||
padding: 0.42rem 0.95rem;
|
padding: 0.42rem 0.95rem;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
background: rgba(255, 255, 255, 0.7);
|
background: rgba(255, 255, 255, 0.04);
|
||||||
color: var(--ink);
|
color: var(--ink);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
font-size: 0.86rem;
|
font-size: 0.86rem;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
|
transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-pill .pill-dot {
|
.filter-pill .pill-dot {
|
||||||
@@ -152,19 +187,21 @@ main {
|
|||||||
|
|
||||||
.filter-pill:hover {
|
.filter-pill:hover {
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
box-shadow: 0 8px 18px -10px var(--pill);
|
background: rgba(255, 255, 255, 0.07);
|
||||||
|
border-color: var(--line-2);
|
||||||
color: var(--ink);
|
color: var(--ink);
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-pill.active {
|
.filter-pill.active {
|
||||||
background: var(--pill);
|
background: var(--pill);
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
color: #fff;
|
color: var(--ink-deep);
|
||||||
box-shadow: 0 10px 22px -10px var(--pill);
|
box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--pill) 75%, transparent);
|
||||||
}
|
}
|
||||||
|
|
||||||
.filter-pill.active .pill-dot {
|
.filter-pill.active .pill-dot {
|
||||||
background: rgba(255, 255, 255, 0.9);
|
background: currentColor;
|
||||||
|
opacity: 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
.refresh-chip {
|
.refresh-chip {
|
||||||
@@ -173,8 +210,9 @@ main {
|
|||||||
gap: 0.4rem;
|
gap: 0.4rem;
|
||||||
padding: 0.32rem 0.7rem;
|
padding: 0.32rem 0.7rem;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
background: rgba(106, 61, 255, 0.1);
|
border: 1px solid var(--line);
|
||||||
color: var(--accent);
|
background: var(--surface-2);
|
||||||
|
color: var(--ink-soft);
|
||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
@@ -185,12 +223,14 @@ main {
|
|||||||
font-size: 0.66rem;
|
font-size: 0.66rem;
|
||||||
letter-spacing: 0.14em;
|
letter-spacing: 0.14em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
color: var(--ink-soft);
|
color: var(--ink-faint);
|
||||||
padding-right: 0.15rem;
|
padding-right: 0.15rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.range-pills {
|
.range-pills {
|
||||||
gap: 0.35rem;
|
gap: 0.35rem;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: var(--line-2) transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.range-pill {
|
.range-pill {
|
||||||
@@ -199,26 +239,27 @@ main {
|
|||||||
padding: 0.32rem 0.75rem;
|
padding: 0.32rem 0.75rem;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
background: rgba(255, 255, 255, 0.7);
|
background: rgba(255, 255, 255, 0.04);
|
||||||
color: var(--ink-soft);
|
color: var(--ink-soft);
|
||||||
font-size: 0.78rem;
|
font-size: 0.78rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
|
transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.range-pill:hover {
|
.range-pill:hover {
|
||||||
color: var(--ink);
|
color: var(--ink);
|
||||||
border-color: var(--accent);
|
border-color: var(--line-2);
|
||||||
|
background: rgba(255, 255, 255, 0.07);
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.range-pill.active {
|
.range-pill.active {
|
||||||
background: var(--accent);
|
background: var(--ink);
|
||||||
border-color: transparent;
|
border-color: transparent;
|
||||||
color: #fff;
|
color: var(--ink-deep);
|
||||||
box-shadow: 0 10px 22px -10px var(--accent);
|
box-shadow: 0 8px 20px -10px rgba(241, 243, 247, 0.45);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- Cards ---------- */
|
/* ---------- Cards ---------- */
|
||||||
@@ -229,23 +270,25 @@ main {
|
|||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
border-top: 4px solid var(--src);
|
border-top: 4px solid var(--src);
|
||||||
border-radius: 18px;
|
border-radius: 18px;
|
||||||
background: var(--surface);
|
background:
|
||||||
|
linear-gradient(180deg, color-mix(in srgb, var(--src) 8%, transparent), transparent 34%),
|
||||||
|
var(--surface);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
box-shadow: 0 1px 2px rgba(22, 11, 46, 0.04), 0 14px 34px -26px rgba(22, 11, 46, 0.5);
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 34px -28px rgba(0, 0, 0, 0.9);
|
||||||
transition: transform 0.18s ease, box-shadow 0.18s ease;
|
transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.feed-card:hover {
|
.feed-card:hover {
|
||||||
transform: translateY(-4px);
|
transform: translateY(-4px);
|
||||||
box-shadow: 0 20px 44px -20px rgba(22, 11, 46, 0.4);
|
border-color: color-mix(in srgb, var(--src) 32%, var(--line));
|
||||||
box-shadow: 0 20px 44px -20px color-mix(in srgb, var(--src) 55%, transparent);
|
box-shadow: 0 22px 44px -24px color-mix(in srgb, var(--src) 45%, transparent), 0 18px 34px -28px rgba(0, 0, 0, 0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
.feed-thumb-link {
|
.feed-thumb-link {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: block;
|
display: block;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background: #efeaff;
|
background: color-mix(in srgb, var(--src) 16%, var(--surface));
|
||||||
}
|
}
|
||||||
|
|
||||||
.feed-thumb-link::after {
|
.feed-thumb-link::after {
|
||||||
@@ -253,7 +296,7 @@ main {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background: linear-gradient(to top, rgba(22, 11, 46, 0.5), transparent 52%);
|
background: linear-gradient(to top, rgba(9, 11, 15, 0.55), transparent 52%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.feed-thumb {
|
.feed-thumb {
|
||||||
@@ -275,7 +318,7 @@ main {
|
|||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
letter-spacing: 0.09em;
|
letter-spacing: 0.09em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
color: #fff;
|
color: var(--ink-deep);
|
||||||
background: var(--src);
|
background: var(--src);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +329,7 @@ main {
|
|||||||
z-index: 1;
|
z-index: 1;
|
||||||
padding: 0.24rem 0.6rem;
|
padding: 0.24rem 0.6rem;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
box-shadow: 0 6px 16px -6px rgba(22, 11, 46, 0.6);
|
box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.7);
|
||||||
}
|
}
|
||||||
|
|
||||||
.source-chip {
|
.source-chip {
|
||||||
@@ -303,7 +346,7 @@ main {
|
|||||||
.feed-name {
|
.feed-name {
|
||||||
font-size: 0.68rem;
|
font-size: 0.68rem;
|
||||||
letter-spacing: 0.02em;
|
letter-spacing: 0.02em;
|
||||||
color: var(--ink-soft);
|
color: var(--ink-faint);
|
||||||
}
|
}
|
||||||
|
|
||||||
.feed-card .card-title {
|
.feed-card .card-title {
|
||||||
@@ -338,7 +381,7 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.card-footer-meta {
|
.card-footer-meta {
|
||||||
border-top: 1px dashed var(--line);
|
border-top: 1px solid var(--line);
|
||||||
}
|
}
|
||||||
|
|
||||||
.author {
|
.author {
|
||||||
@@ -349,32 +392,89 @@ main {
|
|||||||
.timestamp {
|
.timestamp {
|
||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: var(--src);
|
color: color-mix(in srgb, var(--src) 78%, var(--ink));
|
||||||
}
|
}
|
||||||
|
|
||||||
.mono {
|
.mono {
|
||||||
font-family: var(--mono);
|
font-family: var(--mono);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ---------- Feed loader ---------- */
|
||||||
|
|
||||||
|
/* Skeleton cards hold the feed's place while the first page is fetched. The
|
||||||
|
spine stays neutral: no source colour is known yet, so the sources keep
|
||||||
|
their chroma to themselves. */
|
||||||
|
.skeleton-card {
|
||||||
|
--src: var(--line-2);
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-thumb,
|
||||||
|
.skeleton-chip,
|
||||||
|
.skeleton-line {
|
||||||
|
display: block;
|
||||||
|
background: linear-gradient(90deg, var(--surface-2) 25%, var(--line-2) 37%, var(--surface-2) 63%);
|
||||||
|
background-size: 400% 100%;
|
||||||
|
border-radius: 6px;
|
||||||
|
animation: skeleton-sweep 1.5s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-thumb {
|
||||||
|
width: 100%;
|
||||||
|
aspect-ratio: 16 / 9;
|
||||||
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-chip {
|
||||||
|
width: 46px;
|
||||||
|
height: 18px;
|
||||||
|
border-radius: 999px;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-line {
|
||||||
|
height: 0.62rem;
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-title {
|
||||||
|
height: 1.02rem;
|
||||||
|
margin-bottom: 0.75rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.skeleton-timestamp {
|
||||||
|
width: 3.25rem;
|
||||||
|
height: 0.72rem;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes skeleton-sweep {
|
||||||
|
from {
|
||||||
|
background-position: 100% 50%;
|
||||||
|
}
|
||||||
|
|
||||||
|
to {
|
||||||
|
background-position: 0 50%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* ---------- Empty state ---------- */
|
/* ---------- Empty state ---------- */
|
||||||
|
|
||||||
.empty-state {
|
.empty-state {
|
||||||
padding: 4.5rem 1rem;
|
padding: 4.5rem 1rem;
|
||||||
color: var(--ink-soft);
|
color: var(--ink-faint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Same signal-bars mark as the header, unlit — a quiet, static glyph. */
|
||||||
.empty-mark {
|
.empty-mark {
|
||||||
width: 58px;
|
width: 44px;
|
||||||
height: 58px;
|
height: 30px;
|
||||||
margin: 0 auto 1rem;
|
margin: 0 auto 1rem;
|
||||||
border-radius: 20px;
|
background:
|
||||||
background: conic-gradient(from 220deg, var(--accent), var(--youtube), var(--reddit), var(--rt), var(--accent));
|
linear-gradient(var(--youtube), var(--youtube)) 12px bottom / 4px 10px no-repeat,
|
||||||
filter: saturate(1.1);
|
linear-gradient(var(--reddit), var(--reddit)) 19px bottom / 4px 16px no-repeat,
|
||||||
animation: spin 12s linear infinite;
|
linear-gradient(var(--rt), var(--rt)) 26px bottom / 4px 22px no-repeat;
|
||||||
}
|
opacity: 0.5;
|
||||||
|
|
||||||
@keyframes spin {
|
|
||||||
to { transform: rotate(360deg); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.empty-title {
|
.empty-title {
|
||||||
@@ -383,47 +483,48 @@ main {
|
|||||||
color: var(--ink);
|
color: var(--ink);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- Button ---------- */
|
/* ---------- Primary action ---------- */
|
||||||
|
|
||||||
.btn-energy {
|
/* The tally light: the brightest thing on the page, so there is never a
|
||||||
|
question about what the primary action is. */
|
||||||
|
.btn-tally {
|
||||||
border: 0;
|
border: 0;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
padding: 0.7rem 1.7rem;
|
padding: 0.7rem 1.7rem;
|
||||||
font-family: var(--display);
|
font-family: var(--display);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: #fff;
|
color: var(--ink-deep);
|
||||||
background: linear-gradient(100deg, var(--accent), var(--youtube) 48%, var(--reddit) 78%, var(--rt));
|
background: var(--ink);
|
||||||
background-size: 160% 100%;
|
box-shadow: 0 12px 28px -14px rgba(241, 243, 247, 0.4);
|
||||||
box-shadow: 0 14px 30px -14px rgba(106, 61, 255, 0.8);
|
transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
|
||||||
transition: transform 0.15s ease, background-position 0.4s ease, box-shadow 0.15s ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-energy:hover,
|
.btn-tally:hover,
|
||||||
.btn-energy:focus {
|
.btn-tally:focus {
|
||||||
color: #fff;
|
color: var(--ink-deep);
|
||||||
transform: translateY(-2px);
|
transform: translateY(-2px);
|
||||||
background-position: 100% 0;
|
background: #ffffff;
|
||||||
box-shadow: 0 18px 36px -14px rgba(255, 31, 75, 0.7);
|
box-shadow: 0 18px 34px -14px rgba(241, 243, 247, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-energy:disabled {
|
.btn-tally:disabled {
|
||||||
opacity: 0.65;
|
opacity: 0.55;
|
||||||
transform: none;
|
transform: none;
|
||||||
color: #fff;
|
color: var(--ink-deep);
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-soft {
|
.alert-soft {
|
||||||
border: 1px solid #ffe1a8;
|
border: 1px solid color-mix(in srgb, var(--youtube) 40%, transparent);
|
||||||
border-radius: 14px;
|
border-radius: 14px;
|
||||||
background: #fff8ea;
|
background: color-mix(in srgb, var(--youtube) 12%, var(--surface));
|
||||||
color: #7a5a12;
|
color: #ffc2ce;
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-ok-soft {
|
.alert-ok-soft {
|
||||||
border: 1px solid #b7ecd2;
|
border: 1px solid color-mix(in srgb, var(--rt) 40%, transparent);
|
||||||
border-radius: 14px;
|
border-radius: 14px;
|
||||||
background: #ecfbf3;
|
background: color-mix(in srgb, var(--rt) 12%, var(--surface));
|
||||||
color: #14624a;
|
color: #9beed2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- Manage page ---------- */
|
/* ---------- Manage page ---------- */
|
||||||
@@ -434,27 +535,27 @@ main {
|
|||||||
padding: 0.38rem 0.85rem;
|
padding: 0.38rem 0.85rem;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
background: rgba(255, 255, 255, 0.7);
|
background: rgba(255, 255, 255, 0.04);
|
||||||
color: var(--ink-soft);
|
color: var(--ink-soft);
|
||||||
font-size: 0.78rem;
|
font-size: 0.78rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
|
transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.manage-link:hover {
|
.manage-link:hover {
|
||||||
color: var(--accent);
|
color: var(--ink);
|
||||||
border-color: var(--accent);
|
border-color: var(--line-2);
|
||||||
|
background: rgba(255, 255, 255, 0.07);
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
box-shadow: 0 8px 18px -12px var(--accent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.manage-title {
|
.manage-title {
|
||||||
font-size: 0.68rem;
|
font-size: 0.68rem;
|
||||||
letter-spacing: 0.14em;
|
letter-spacing: 0.14em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
color: var(--ink-soft);
|
color: var(--ink-faint);
|
||||||
}
|
}
|
||||||
|
|
||||||
.manage-main {
|
.manage-main {
|
||||||
@@ -466,7 +567,7 @@ main {
|
|||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
border-radius: 18px;
|
border-radius: 18px;
|
||||||
padding: 1.25rem 1.4rem;
|
padding: 1.25rem 1.4rem;
|
||||||
box-shadow: 0 1px 2px rgba(22, 11, 46, 0.04), 0 14px 34px -26px rgba(22, 11, 46, 0.5);
|
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 18px 34px -28px rgba(0, 0, 0, 0.9);
|
||||||
}
|
}
|
||||||
|
|
||||||
.manage-notice {
|
.manage-notice {
|
||||||
@@ -523,7 +624,7 @@ main {
|
|||||||
font-size: 0.68rem;
|
font-size: 0.68rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
color: var(--ink-soft);
|
color: var(--ink-soft);
|
||||||
background: rgba(22, 11, 46, 0.06);
|
background: rgba(255, 255, 255, 0.07);
|
||||||
padding: 0.12rem 0.5rem;
|
padding: 0.12rem 0.5rem;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
}
|
}
|
||||||
@@ -549,7 +650,7 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.feed-row:hover {
|
.feed-row:hover {
|
||||||
box-shadow: 0 12px 26px -18px rgba(22, 11, 46, 0.55);
|
box-shadow: 0 12px 26px -18px rgba(0, 0, 0, 0.85);
|
||||||
}
|
}
|
||||||
|
|
||||||
.feed-row.is-off {
|
.feed-row.is-off {
|
||||||
@@ -576,22 +677,21 @@ main {
|
|||||||
letter-spacing: 0.09em;
|
letter-spacing: 0.09em;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
color: var(--ink-soft);
|
color: var(--ink-soft);
|
||||||
background: rgba(22, 11, 46, 0.06);
|
background: rgba(255, 255, 255, 0.07);
|
||||||
padding: 0.16rem 0.5rem;
|
padding: 0.16rem 0.5rem;
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.feed-row-url {
|
.feed-row-url {
|
||||||
font-size: 0.66rem;
|
font-size: 0.66rem;
|
||||||
color: var(--ink-soft);
|
color: var(--ink-faint);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
max-width: 36ch;
|
max-width: 36ch;
|
||||||
opacity: 0.85;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.feed-row-url:hover {
|
.feed-row-url:hover {
|
||||||
color: var(--accent);
|
color: var(--ink);
|
||||||
opacity: 1;
|
text-decoration: underline;
|
||||||
}
|
}
|
||||||
|
|
||||||
.health {
|
.health {
|
||||||
@@ -619,8 +719,7 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.health-idle {
|
.health-idle {
|
||||||
color: var(--ink-soft);
|
color: var(--ink-faint);
|
||||||
opacity: 0.75;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.feed-row-actions {
|
.feed-row-actions {
|
||||||
@@ -631,49 +730,76 @@ main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.btn-mini {
|
.btn-mini {
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line-2);
|
||||||
border-radius: 999px;
|
border-radius: 999px;
|
||||||
background: rgba(255, 255, 255, 0.75);
|
background: rgba(255, 255, 255, 0.04);
|
||||||
color: var(--ink-soft);
|
color: var(--ink-soft);
|
||||||
font-size: 0.72rem;
|
font-size: 0.72rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
padding: 0.3rem 0.85rem;
|
padding: 0.3rem 0.85rem;
|
||||||
transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
|
transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-mini:hover,
|
.btn-mini:hover,
|
||||||
.btn-mini:focus {
|
.btn-mini:focus {
|
||||||
color: var(--ink);
|
color: var(--ink);
|
||||||
border-color: var(--ink-soft);
|
border-color: var(--ink-faint);
|
||||||
|
background: rgba(255, 255, 255, 0.08);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-mini-on {
|
.btn-mini-on {
|
||||||
color: var(--accent);
|
color: var(--ink);
|
||||||
border-color: rgba(106, 61, 255, 0.45);
|
border-color: var(--ink-faint);
|
||||||
background: rgba(106, 61, 255, 0.08);
|
background: rgba(255, 255, 255, 0.1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-mini-on:hover,
|
.btn-mini-on:hover,
|
||||||
.btn-mini-on:focus {
|
.btn-mini-on:focus {
|
||||||
color: var(--accent);
|
color: var(--ink);
|
||||||
border-color: var(--accent);
|
border-color: var(--ink-soft);
|
||||||
background: rgba(106, 61, 255, 0.14);
|
background: rgba(255, 255, 255, 0.14);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-mini-danger:hover,
|
.btn-mini-danger:hover,
|
||||||
.btn-mini-danger:focus {
|
.btn-mini-danger:focus {
|
||||||
color: var(--youtube);
|
color: var(--youtube);
|
||||||
border-color: rgba(255, 31, 75, 0.5);
|
border-color: color-mix(in srgb, var(--youtube) 55%, transparent);
|
||||||
background: rgba(255, 31, 75, 0.07);
|
background: color-mix(in srgb, var(--youtube) 12%, transparent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------- Form controls ---------- */
|
||||||
|
|
||||||
|
.form-control {
|
||||||
|
background: var(--surface-2);
|
||||||
|
border: 1px solid var(--line-2);
|
||||||
|
color: var(--ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control::placeholder {
|
||||||
|
color: var(--ink-faint);
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-control:focus {
|
||||||
|
background: var(--surface-2);
|
||||||
|
border-color: var(--ink-soft);
|
||||||
|
color: var(--ink);
|
||||||
|
box-shadow: 0 0 0 3px rgba(241, 243, 247, 0.12);
|
||||||
|
}
|
||||||
|
|
||||||
|
code {
|
||||||
|
color: var(--ink);
|
||||||
|
background: rgba(255, 255, 255, 0.06);
|
||||||
|
padding: 0.1rem 0.35rem;
|
||||||
|
border-radius: 6px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- Focus & motion ---------- */
|
/* ---------- Focus & motion ---------- */
|
||||||
|
|
||||||
a:focus-visible,
|
a:focus-visible,
|
||||||
button:focus-visible {
|
button:focus-visible,
|
||||||
outline: 3px solid rgba(106, 61, 255, 0.55);
|
input:focus-visible {
|
||||||
|
outline: 2px solid var(--ink);
|
||||||
outline-offset: 2px;
|
outline-offset: 2px;
|
||||||
border-radius: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (prefers-reduced-motion: reduce) {
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
|||||||
@@ -61,4 +61,11 @@ return [
|
|||||||
'label' => 'RT News',
|
'label' => 'RT News',
|
||||||
'url' => 'https://www.rt.com/rss/',
|
'url' => 'https://www.rt.com/rss/',
|
||||||
],
|
],
|
||||||
|
|
||||||
|
// BBC News (top stories).
|
||||||
|
[
|
||||||
|
'source' => 'bbc',
|
||||||
|
'label' => 'BBC News',
|
||||||
|
'url' => 'https://feeds.bbci.co.uk/news/rss.xml',
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -6,13 +6,11 @@ declare(strict_types=1);
|
|||||||
$app = require __DIR__ . '/src/bootstrap.php';
|
$app = require __DIR__ . '/src/bootstrap.php';
|
||||||
|
|
||||||
$config = $app['config'];
|
$config = $app['config'];
|
||||||
|
$repository = $app['repository'];
|
||||||
$service = $app['service'];
|
$service = $app['service'];
|
||||||
|
|
||||||
$refresh = $service->refreshStale();
|
|
||||||
|
|
||||||
$sources = $service->sources();
|
|
||||||
$activeSource = $_GET['source'] ?? null;
|
$activeSource = $_GET['source'] ?? null;
|
||||||
if (!is_string($activeSource) || !in_array($activeSource, $sources, true)) {
|
if (!is_string($activeSource) || $activeSource === '') {
|
||||||
$activeSource = null;
|
$activeSource = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,13 +19,41 @@ $activeRange = $_GET['range'] ?? '';
|
|||||||
if (!is_string($activeRange) || !array_key_exists($activeRange, $ranges)) {
|
if (!is_string($activeRange) || !array_key_exists($activeRange, $ranges)) {
|
||||||
$activeRange = '';
|
$activeRange = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$since = $activeRange !== '' ? gmdate('c', time() - (int) $ranges[$activeRange]) : null;
|
$since = $activeRange !== '' ? gmdate('c', time() - (int) $ranges[$activeRange]) : null;
|
||||||
|
$pageSize = (int) $config['page_size'];
|
||||||
|
|
||||||
$page = $service->page($activeSource, 1, (int) $config['page_size'], $since);
|
// Register the configured feeds before anything renders so the filter tabs are
|
||||||
|
// complete on a fresh database; refreshStale() repeats the same sync cheaply.
|
||||||
|
$repository->syncFeeds($app['feeds']);
|
||||||
|
|
||||||
echo App\View::render('layout', [
|
$sources = $service->sources();
|
||||||
|
if ($activeSource !== null && !in_array($activeSource, $sources, true)) {
|
||||||
|
$activeSource = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send the shell (header, filters and the feed loader) before refreshing, so
|
||||||
|
// the loader is on screen while the feeds are being fetched. Nothing may hold
|
||||||
|
// those bytes back.
|
||||||
|
ini_set('zlib.output_compression', '0');
|
||||||
|
while (ob_get_level() > 0 && ob_end_flush()) {
|
||||||
|
// Drop any active output buffers so the shell reaches the browser now.
|
||||||
|
}
|
||||||
|
|
||||||
|
echo App\View::render('shell', [
|
||||||
'config' => $config,
|
'config' => $config,
|
||||||
'sources' => $sources,
|
'sources' => $sources,
|
||||||
|
'activeSource' => $activeSource,
|
||||||
|
'activeRange' => $activeRange,
|
||||||
|
'cachedTotal' => $repository->countItems($activeSource, $since),
|
||||||
|
]);
|
||||||
|
|
||||||
|
flush();
|
||||||
|
|
||||||
|
$refresh = $service->refreshStale();
|
||||||
|
$page = $service->page($activeSource, 1, $pageSize, $since);
|
||||||
|
|
||||||
|
echo App\View::render('content', [
|
||||||
'activeSource' => $activeSource,
|
'activeSource' => $activeSource,
|
||||||
'activeRange' => $activeRange,
|
'activeRange' => $activeRange,
|
||||||
'page' => $page,
|
'page' => $page,
|
||||||
|
|||||||
+7
-4
@@ -17,6 +17,7 @@ final class View
|
|||||||
'youtube' => 'YouTube',
|
'youtube' => 'YouTube',
|
||||||
'reddit' => 'Reddit',
|
'reddit' => 'Reddit',
|
||||||
'rt' => 'RT',
|
'rt' => 'RT',
|
||||||
|
'bbc' => 'BBC',
|
||||||
default => ucfirst($source),
|
default => ucfirst($source),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -27,6 +28,7 @@ final class View
|
|||||||
'youtube' => 'text-bg-danger',
|
'youtube' => 'text-bg-danger',
|
||||||
'reddit' => 'text-bg-warning',
|
'reddit' => 'text-bg-warning',
|
||||||
'rt' => 'text-bg-dark',
|
'rt' => 'text-bg-dark',
|
||||||
|
'bbc' => 'text-bg-danger',
|
||||||
default => 'text-bg-secondary',
|
default => 'text-bg-secondary',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -34,10 +36,11 @@ final class View
|
|||||||
public static function sourceColor(string $source): string
|
public static function sourceColor(string $source): string
|
||||||
{
|
{
|
||||||
return match ($source) {
|
return match ($source) {
|
||||||
'youtube' => '#ff1f4b',
|
'youtube' => '#ff3b5c',
|
||||||
'reddit' => '#ff6a00',
|
'reddit' => '#ff7a2f',
|
||||||
'rt' => '#00c389',
|
'rt' => '#1fcb93',
|
||||||
default => '#6a3dff',
|
'bbc' => '#bb1919',
|
||||||
|
default => '#f1f3f7',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,88 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use App\View;
|
||||||
|
|
||||||
|
/** @var string|null $activeSource */
|
||||||
|
/** @var string|null $activeRange */
|
||||||
|
/** @var array<string, mixed> $page */
|
||||||
|
/** @var array<string, mixed> $refresh */
|
||||||
|
|
||||||
|
$activeRange = $activeRange ?? '';
|
||||||
|
$errors = $refresh['errors'] ?? [];
|
||||||
|
$total = (int) $page['total'];
|
||||||
|
?>
|
||||||
|
<?php if (($refresh['attempted'] ?? 0) > 0): ?>
|
||||||
|
<div class="d-flex justify-content-end mb-3">
|
||||||
|
<span class="refresh-chip mono">
|
||||||
|
<span aria-hidden="true">↻</span>
|
||||||
|
<?= (int) $refresh['succeeded'] ?>/<?= (int) $refresh['attempted'] ?> feeds
|
||||||
|
· <?= (int) $refresh['new_items'] ?> new
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<?php if ($errors !== []): ?>
|
||||||
|
<div class="alert alert-warning alert-dismissible fade show small alert-soft" role="alert">
|
||||||
|
<strong>Some feeds could not be refreshed:</strong>
|
||||||
|
<ul class="mb-0 ps-3">
|
||||||
|
<?php foreach ($errors as $error): ?>
|
||||||
|
<li><?= View::e((string) $error) ?></li>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</ul>
|
||||||
|
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<div id="feed"
|
||||||
|
class="row g-4"
|
||||||
|
data-api="api/items.php"
|
||||||
|
data-source="<?= View::e((string) ($activeSource ?? '')) ?>"
|
||||||
|
data-range="<?= View::e($activeRange) ?>"
|
||||||
|
data-page="1"
|
||||||
|
data-page-size="<?= (int) $page['page_size'] ?>"
|
||||||
|
data-has-more="<?= $page['has_more'] ? '1' : '0' ?>"
|
||||||
|
data-total="<?= $total ?>">
|
||||||
|
<?= View::render('cards', ['items' => $page['items']]) ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="feed-empty" class="empty-state text-center <?= $total > 0 ? 'd-none' : '' ?>">
|
||||||
|
<div class="empty-mark" aria-hidden="true"></div>
|
||||||
|
<?php if ($activeRange !== ''): ?>
|
||||||
|
<p class="empty-title mb-1">Nothing in the past <?= View::e(View::rangeLabel($activeRange)) ?></p>
|
||||||
|
<p class="small mb-0">Try a wider time range to see more.</p>
|
||||||
|
<?php else: ?>
|
||||||
|
<p class="empty-title mb-1">Nothing in the feed yet</p>
|
||||||
|
<p class="small mb-0">Feeds may be rate limited right now — reload in a moment.</p>
|
||||||
|
<?php endif; ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center mt-5">
|
||||||
|
<button id="load-more"
|
||||||
|
type="button"
|
||||||
|
class="btn btn-tally <?= $page['has_more'] ? '' : 'd-none' ?>">
|
||||||
|
<span class="spinner-border spinner-border-sm me-2 d-none" role="status" aria-hidden="true"></span>
|
||||||
|
Load more stories
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
||||||
|
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||||
|
<script src="assets/app.js" defer></script>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var loader = document.getElementById('feed-loader');
|
||||||
|
if (loader !== null) {
|
||||||
|
loader.remove();
|
||||||
|
}
|
||||||
|
|
||||||
|
var count = document.getElementById('story-count');
|
||||||
|
if (count !== null) {
|
||||||
|
count.textContent = '<?= $total ?> stories';
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -19,7 +19,7 @@ foreach ($feeds as $feed) {
|
|||||||
$actionUrl = 'manage.php';
|
$actionUrl = 'manage.php';
|
||||||
?>
|
?>
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en" data-bs-theme="light">
|
<html lang="en" data-bs-theme="dark">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
@@ -41,10 +41,10 @@ $actionUrl = 'manage.php';
|
|||||||
</a>
|
</a>
|
||||||
<div class="d-flex align-items-center gap-3">
|
<div class="d-flex align-items-center gap-3">
|
||||||
<span class="mono manage-title">Manage feeds</span>
|
<span class="mono manage-title">Manage feeds</span>
|
||||||
<a class="manage-link" href="?">← Dashboard</a>
|
<a class="manage-link" href="index.php">← Dashboard</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spectrum-rail" aria-hidden="true"></div>
|
<div class="wire-rail" aria-hidden="true"></div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="container-xxl py-4 manage-main">
|
<main class="container-xxl py-4 manage-main">
|
||||||
@@ -70,7 +70,7 @@ $actionUrl = 'manage.php';
|
|||||||
<input type="hidden" name="csrf" value="<?= $csrf ?>">
|
<input type="hidden" name="csrf" value="<?= $csrf ?>">
|
||||||
<input type="hidden" name="action" value="login">
|
<input type="hidden" name="action" value="login">
|
||||||
<input type="password" name="input" class="form-control mono" placeholder="Password" required autofocus autocomplete="current-password">
|
<input type="password" name="input" class="form-control mono" placeholder="Password" required autofocus autocomplete="current-password">
|
||||||
<button type="submit" class="btn btn-energy btn-compact">Sign in</button>
|
<button type="submit" class="btn btn-tally btn-compact">Sign in</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
@@ -91,7 +91,7 @@ $actionUrl = 'manage.php';
|
|||||||
<input type="text" name="input" class="form-control mono" inputmode="url"
|
<input type="text" name="input" class="form-control mono" inputmode="url"
|
||||||
placeholder="r/homelab · homelab · reddit.com/r/homelab"
|
placeholder="r/homelab · homelab · reddit.com/r/homelab"
|
||||||
required maxlength="300" autocomplete="off">
|
required maxlength="300" autocomplete="off">
|
||||||
<button type="submit" class="btn btn-energy btn-compact">Add</button>
|
<button type="submit" class="btn btn-tally btn-compact">Add</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -104,7 +104,7 @@ $actionUrl = 'manage.php';
|
|||||||
<input type="text" name="input" class="form-control mono" inputmode="url"
|
<input type="text" name="input" class="form-control mono" inputmode="url"
|
||||||
placeholder="@handle · UC… channel ID · channel URL"
|
placeholder="@handle · UC… channel ID · channel URL"
|
||||||
required maxlength="300" autocomplete="off">
|
required maxlength="300" autocomplete="off">
|
||||||
<button type="submit" class="btn btn-energy btn-compact">Add</button>
|
<button type="submit" class="btn btn-tally btn-compact">Add</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,8 +8,7 @@ use App\View;
|
|||||||
/** @var array<int, string> $sources */
|
/** @var array<int, string> $sources */
|
||||||
/** @var string|null $activeSource */
|
/** @var string|null $activeSource */
|
||||||
/** @var string|null $activeRange */
|
/** @var string|null $activeRange */
|
||||||
/** @var array<string, mixed> $page */
|
/** @var int $cachedTotal */
|
||||||
/** @var array<string, mixed> $refresh */
|
|
||||||
|
|
||||||
$tabs = ['' => 'All'];
|
$tabs = ['' => 'All'];
|
||||||
foreach ($sources as $source) {
|
foreach ($sources as $source) {
|
||||||
@@ -34,16 +33,14 @@ $linkFor = static function (string $source, string $range): string {
|
|||||||
|
|
||||||
return $params === [] ? '?' : '?' . http_build_query($params);
|
return $params === [] ? '?' : '?' . http_build_query($params);
|
||||||
};
|
};
|
||||||
|
|
||||||
$errors = $refresh['errors'] ?? [];
|
|
||||||
$total = (int) $page['total'];
|
|
||||||
?>
|
?>
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en" data-bs-theme="light">
|
<html lang="en" data-bs-theme="dark">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<title>RSS Feed Dashboard</title>
|
<title>RSS Feed Dashboard</title>
|
||||||
|
<noscript><style>#feed-loader{display:none}</style></noscript>
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap"
|
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap"
|
||||||
@@ -62,14 +59,14 @@ $total = (int) $page['total'];
|
|||||||
<div class="d-flex align-items-center gap-3">
|
<div class="d-flex align-items-center gap-3">
|
||||||
<div class="header-meta d-none d-md-flex align-items-center">
|
<div class="header-meta d-none d-md-flex align-items-center">
|
||||||
<span class="pulse" aria-hidden="true"></span>
|
<span class="pulse" aria-hidden="true"></span>
|
||||||
<span class="mono"><?= $total ?> stories</span>
|
<span class="mono" id="story-count"><?= $cachedTotal ?> stories</span>
|
||||||
<span class="sep">/</span>
|
<span class="sep">/</span>
|
||||||
<span class="mono">YouTube · Reddit · RT</span>
|
<span class="mono">YouTube · Reddit · RT</span>
|
||||||
</div>
|
</div>
|
||||||
<a class="manage-link" href="manage.php">Manage</a>
|
<a class="manage-link" href="manage.php">Manage</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="spectrum-rail" aria-hidden="true"></div>
|
<div class="wire-rail" aria-hidden="true"></div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="container-xxl py-4">
|
<main class="container-xxl py-4">
|
||||||
@@ -90,14 +87,6 @@ $total = (int) $page['total'];
|
|||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<?php if (($refresh['attempted'] ?? 0) > 0): ?>
|
|
||||||
<span class="refresh-chip mono">
|
|
||||||
<span aria-hidden="true">↻</span>
|
|
||||||
<?= (int) $refresh['succeeded'] ?>/<?= (int) $refresh['attempted'] ?> feeds
|
|
||||||
· <?= (int) $refresh['new_items'] ?> new
|
|
||||||
</span>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex flex-wrap align-items-center gap-2 mt-3">
|
<div class="d-flex flex-wrap align-items-center gap-2 mt-3">
|
||||||
@@ -113,53 +102,26 @@ $total = (int) $page['total'];
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ($errors !== []): ?>
|
<div id="feed-loader" class="row g-4" role="status">
|
||||||
<div class="alert alert-warning alert-dismissible fade show small alert-soft" role="alert">
|
<span class="visually-hidden">Loading feeds…</span>
|
||||||
<strong>Some feeds could not be refreshed:</strong>
|
<?php for ($placeholder = 0; $placeholder < 3; $placeholder++): ?>
|
||||||
<ul class="mb-0 ps-3">
|
<div class="col-12 col-md-6 col-xl-4">
|
||||||
<?php foreach ($errors as $error): ?>
|
<div class="card h-100 feed-card skeleton-card" aria-hidden="true">
|
||||||
<li><?= View::e((string) $error) ?></li>
|
<div class="skeleton-thumb"></div>
|
||||||
<?php endforeach; ?>
|
<div class="card-body d-flex flex-column">
|
||||||
</ul>
|
<div class="d-flex align-items-center gap-2 mb-2">
|
||||||
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
|
<span class="skeleton-chip"></span>
|
||||||
</div>
|
<span class="skeleton-line w-50 mb-0"></span>
|
||||||
<?php endif; ?>
|
</div>
|
||||||
|
<span class="skeleton-line skeleton-title w-100"></span>
|
||||||
<div id="feed"
|
<span class="skeleton-line w-100"></span>
|
||||||
class="row g-4"
|
<span class="skeleton-line w-75"></span>
|
||||||
data-api="api/items.php"
|
<div class="card-footer-meta mt-auto d-flex justify-content-between align-items-center pt-3">
|
||||||
data-source="<?= View::e((string) ($activeSource ?? '')) ?>"
|
<span class="skeleton-line w-25 mb-0"></span>
|
||||||
data-range="<?= View::e($activeRange) ?>"
|
<span class="skeleton-line skeleton-timestamp"></span>
|
||||||
data-page="1"
|
</div>
|
||||||
data-page-size="<?= (int) $page['page_size'] ?>"
|
</div>
|
||||||
data-has-more="<?= $page['has_more'] ? '1' : '0' ?>"
|
</div>
|
||||||
data-total="<?= $total ?>">
|
</div>
|
||||||
<?= View::render('cards', ['items' => $page['items']]) ?>
|
<?php endfor; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="feed-empty" class="empty-state text-center <?= $total > 0 ? 'd-none' : '' ?>">
|
|
||||||
<div class="empty-mark" aria-hidden="true"></div>
|
|
||||||
<?php if ($activeRange !== ''): ?>
|
|
||||||
<p class="empty-title mb-1">Nothing in the past <?= View::e(View::rangeLabel($activeRange)) ?></p>
|
|
||||||
<p class="small mb-0">Try a wider time range to see more.</p>
|
|
||||||
<?php else: ?>
|
|
||||||
<p class="empty-title mb-1">Nothing in the feed yet</p>
|
|
||||||
<p class="small mb-0">Feeds may be rate limited right now — reload in a moment.</p>
|
|
||||||
<?php endif; ?>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="text-center mt-5">
|
|
||||||
<button id="load-more"
|
|
||||||
type="button"
|
|
||||||
class="btn btn-energy <?= $page['has_more'] ? '' : 'd-none' ?>">
|
|
||||||
<span class="spinner-border spinner-border-sm me-2 d-none" role="status" aria-hidden="true"></span>
|
|
||||||
Load more stories
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
|
||||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
|
||||||
<script src="assets/app.js" defer></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Reference in New Issue
Block a user