first commit

This commit is contained in:
Joren de Graaf
2026-09-30 17:25:25 +02:00
commit 6baa19f11b
4271 changed files with 716371 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
node_modules/
+51
View File
@@ -0,0 +1,51 @@
# Tasknest frontend
This directory owns browser assets. Vite compiles `src/main.js`, its SCSS import,
and the local `htmx.org` dependency. Django renders those assets through the
`{% vite_asset 'src/main.js' %}` template tag in `planner/base.html`.
## First-time setup
Install Node.js 20.19+ (or a newer current LTS), then run:
```sh
cd main/frontend
npm install
```
This installs Vite, Sass, HTMX, and Concurrently.
## Development
From `main/frontend`, start the normal CORS-free development workflow with one command:
```sh
npm run dev
```
Concurrent output is labeled and color-coded: `assets` is cyan and `django` is green. Vite rebuilds SCSS and JavaScript whenever source files change; Django serves the generated assets from its own origin, so there is no request to port `5173`. Refresh the browser after an asset change. The command stops the other process if either process fails. The Django server listens on port `1234`; change the `dev:django` script in `package.json` if you need another port.
For environments where the browser can reach Vite directly on port `5173`, use optional HMR instead:
```sh
npm run dev:hmr
```
The HMR mode loads Vite's HMR client and `src/main.js` from the Vite server. If Django is served on a different host or port, set `VITE_DEV_SERVER` to the browser-reachable Vite URL. The development server uses `cors: true` deliberately; do not expose it as a production asset server.
## Production build
```sh
cd main/frontend
npm ci
npm run build
cd /home/jorenmartijn/django
VITE_USE_DEV_SERVER=false tasksnest/bin/python main/manage.py collectstatic
```
`npm run build` writes hashed assets and `.vite/manifest.json` to
`planner/static/planner/dist/`. With `VITE_USE_DEV_SERVER=false`, Django's
`vite_asset` tag reads that manifest and emits the correct hashed JavaScript and
CSS URLs. Build before `collectstatic`; do not commit `node_modules` or the
compiled `dist` output unless your deployment intentionally stores built assets
in source control.
+1837
View File
File diff suppressed because it is too large Load Diff
+23
View File
@@ -0,0 +1,23 @@
{
"name": "tasknest-frontend",
"private": true,
"version": "0.1.0",
"scripts": {
"dev": "concurrently --kill-others-on-fail --names assets,django --prefix-colors cyan,green \"npm run dev:assets\" \"npm run dev:django\"",
"dev:assets": "vite build --watch",
"dev:django": "VITE_USE_DEV_SERVER=false ../../tasksnest/bin/python ../manage.py runserver 0.0.0.0:1234",
"dev:hmr": "concurrently --kill-others-on-fail --names vite,django --prefix-colors cyan,green \"npm run dev:vite\" \"npm run dev:django:hmr\"",
"dev:vite": "vite",
"dev:django:hmr": "../../tasksnest/bin/python ../manage.py runserver 0.0.0.0:1234",
"build": "vite build",
"preview": "vite preview"
},
"devDependencies": {
"sass": "^1.93.2",
"vite": "^7.1.7",
"concurrently": "^9.2.1"
},
"dependencies": {
"htmx.org": "^2.0.7"
}
}
+197
View File
@@ -0,0 +1,197 @@
import htmx from 'htmx.org';
import './styles/main.scss';
window.htmx = htmx;
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
return parts.length === 2 ? parts.pop().split(';').shift() : '';
}
htmx.on('htmx:configRequest', (event) => {
event.detail.headers['X-CSRFToken'] = getCookie('csrftoken');
});
let fastingTimerInterval;
function formatElapsed(milliseconds) {
const totalSeconds = Math.max(0, Math.floor(milliseconds / 1000));
const hours = Math.floor(totalSeconds / 3600);
const minutes = Math.floor((totalSeconds % 3600) / 60);
const seconds = totalSeconds % 60;
return [hours, minutes, seconds].map((value) => String(value).padStart(2, '0')).join(':');
}
function updateFastingTimers() {
document.querySelectorAll('[data-fasting-timer]').forEach((timer) => {
const cycleStart = Date.parse(timer.dataset.cycleStart);
const cycleEnd = Date.parse(timer.dataset.cycleEnd);
if (!Number.isFinite(cycleStart) || !Number.isFinite(cycleEnd) || cycleEnd <= cycleStart) {
return;
}
const now = Date.now();
const progress = Math.max(0, Math.min(100, ((now - cycleStart) / (cycleEnd - cycleStart)) * 100));
const elapsed = timer.querySelector('[data-fasting-elapsed]');
const ring = timer.querySelector('[data-fasting-progress]');
if (elapsed) elapsed.textContent = formatElapsed(now - cycleStart);
if (ring) ring.style.strokeDashoffset = String(100 - progress);
timer.setAttribute('aria-label', `${timer.dataset.phase} progress: ${Math.floor(progress)} percent`);
// A server refresh switches to the next phase and synchronizes completion history.
if (now >= cycleEnd && !timer.dataset.refreshing) {
timer.dataset.refreshing = 'true';
htmx.ajax('GET', timer.dataset.refreshUrl, {target: '#fasting-widget', swap: 'outerHTML'});
}
});
}
function initialiseFastingTimers() {
window.clearInterval(fastingTimerInterval);
updateFastingTimers();
if (document.querySelector('[data-fasting-timer]')) {
fastingTimerInterval = window.setInterval(updateFastingTimers, 1000);
}
}
document.addEventListener('DOMContentLoaded', initialiseFastingTimers);
htmx.on('htmx:afterSwap', initialiseFastingTimers);
function initialiseGeolocation() {
const button = document.querySelector('[data-use-location]');
if (!button || button.dataset.ready) return;
button.dataset.ready = 'true';
button.addEventListener('click', () => {
const status = document.querySelector('[data-location-status]');
const latitude = document.querySelector('[name="latitude"]');
const longitude = document.querySelector('[name="longitude"]');
if (!navigator.geolocation) {
if (status) status.textContent = 'Location is unavailable in this browser. You can enter coordinates manually.';
return;
}
if (status) status.textContent = 'Requesting your location…';
navigator.geolocation.getCurrentPosition((position) => {
if (latitude) latitude.value = position.coords.latitude.toFixed(5);
if (longitude) longitude.value = position.coords.longitude.toFixed(5);
if (status) status.textContent = 'Location added. Save settings to confirm it.';
}, () => {
if (status) status.textContent = 'Location was unavailable. You can enter coordinates manually.';
}, {enableHighAccuracy: false, timeout: 10000, maximumAge: 0});
});
}
document.addEventListener('DOMContentLoaded', initialiseGeolocation);
htmx.on('htmx:afterSwap', initialiseGeolocation);
function initialiseCategoryPickers() {
document.querySelectorAll("[data-category-picker]").forEach((picker) => {
if (picker.dataset.ready) return;
picker.dataset.ready = "true";
const input = picker.querySelector("[data-category-input]");
const clearButton = picker.querySelector("[data-category-clear]");
const suggestions = picker.querySelector("[role=listbox]");
const suggestionUrl = input?.dataset.suggestionsUrl;
if (!input || !clearButton || !suggestions || !suggestionUrl) return;
let activeIndex = -1;
let requestSequence = 0;
const options = () => Array.from(suggestions.querySelectorAll("[role=option]"));
const updateClearButton = () => { clearButton.hidden = !input.value; };
const closeSuggestions = () => {
activeIndex = -1;
suggestions.hidden = true;
suggestions.replaceChildren();
input.setAttribute("aria-expanded", "false");
input.removeAttribute("aria-activedescendant");
};
const setActiveOption = (index) => {
const availableOptions = options();
if (!availableOptions.length) return;
activeIndex = (index + availableOptions.length) % availableOptions.length;
availableOptions.forEach((option, optionIndex) => {
option.setAttribute("aria-selected", String(optionIndex === activeIndex));
});
const activeOption = availableOptions[activeIndex];
input.setAttribute("aria-activedescendant", activeOption.id);
activeOption.scrollIntoView({ block: "nearest" });
};
const choose = (category) => {
input.value = category;
updateClearButton();
closeSuggestions();
input.focus();
};
const showSuggestions = (categories) => {
suggestions.replaceChildren();
activeIndex = -1;
input.removeAttribute("aria-activedescendant");
categories.forEach((category, index) => {
const option = document.createElement("li");
option.id = input.id + "-option-" + index;
option.setAttribute("role", "option");
option.setAttribute("aria-selected", "false");
option.dataset.categoryValue = category;
option.textContent = category;
suggestions.append(option);
});
suggestions.hidden = categories.length === 0;
input.setAttribute("aria-expanded", String(categories.length > 0));
};
const loadSuggestions = async () => {
const requestId = ++requestSequence;
const url = new URL(suggestionUrl, window.location.origin);
url.searchParams.set("q", input.value);
try {
const response = await fetch(url, { headers: { Accept: "application/json" } });
if (!response.ok || requestId !== requestSequence) return;
const payload = await response.json();
showSuggestions(payload.categories || []);
} catch {
if (requestId === requestSequence) closeSuggestions();
}
};
input.addEventListener("input", () => {
updateClearButton();
loadSuggestions();
});
input.addEventListener("focus", () => {
if (input.value) loadSuggestions();
});
input.addEventListener("keydown", (event) => {
const availableOptions = options();
if (event.key === "ArrowDown") {
event.preventDefault();
if (suggestions.hidden) loadSuggestions();
else setActiveOption(activeIndex + 1);
} else if (event.key === "ArrowUp" && !suggestions.hidden) {
event.preventDefault();
setActiveOption(activeIndex - 1);
} else if (event.key === "Enter" && activeIndex >= 0 && availableOptions[activeIndex]) {
event.preventDefault();
choose(availableOptions[activeIndex].dataset.categoryValue);
} else if (event.key === "Escape") {
closeSuggestions();
}
});
suggestions.addEventListener("click", (event) => {
const option = event.target.closest("[role=option]");
if (option) choose(option.dataset.categoryValue);
});
clearButton.addEventListener("click", () => {
input.value = "";
updateClearButton();
closeSuggestions();
input.focus();
});
});
}
document.addEventListener("DOMContentLoaded", initialiseCategoryPickers);
htmx.on("htmx:afterSwap", initialiseCategoryPickers);
+144
View File
@@ -0,0 +1,144 @@
@use 'sass:color';
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,600;9..144,700&display=swap');
$ink: #25292e;
$muted: #6d737a;
$line: #e6e8e3;
$surface: #ffffff;
$canvas: #f7f7f3;
$forest: #235943;
$forest-dark: #174333;
$mint: #e0f0e5;
$coral: #d95d4e;
$shadow: 0 18px 45px rgba(29, 43, 37, .08);
* { box-sizing: border-box; }
html { min-height: 100%; background: $canvas; }
body {
min-width: 320px;
margin: 0;
color: $ink;
background: $canvas;
font-family: 'DM Sans', system-ui, sans-serif;
font-size: 1rem;
line-height: 1.5;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.site-header {
border-bottom: 1px solid rgba($ink, .08);
background: rgba($canvas, .9);
backdrop-filter: blur(14px);
position: sticky;
top: 0;
z-index: 5;
&__inner {
max-width: 1180px;
min-height: 72px;
margin: 0 auto;
padding: 0 28px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 24px;
}
}
.brand {
display: inline-flex;
gap: 9px;
align-items: center;
color: $ink;
text-decoration: none;
font-family: Fraunces, Georgia, serif;
font-size: 1.35rem;
font-weight: 700;
letter-spacing: -.04em;
&__mark { display: grid; place-items: center; width: 27px; height: 27px; border-radius: 9px; color: white; background: $forest; font: 700 17px/1 'DM Sans', sans-serif; }
}
.primary-nav { display: flex; align-items: center; gap: 25px; font-size: .93rem; font-weight: 600; }
.primary-nav > a:not(.button) { text-decoration: none; color: $muted; &:hover { color: $forest; } }
.page-content { max-width: 1180px; margin: 0 auto; padding: 64px 28px 88px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin: 0 0 42px; }
.eyebrow { margin: 0 0 9px; color: $forest; font-size: .74rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 740px; margin-bottom: 13px; font-family: Fraunces, Georgia, serif; font-size: clamp(2.25rem, 5vw, 4.25rem); font-weight: 700; line-height: 1.04; letter-spacing: -.055em; }
h2 { font-family: Fraunces, Georgia, serif; letter-spacing: -.03em; }
.hero__copy { max-width: 500px; margin-bottom: 0; color: $muted; font-size: 1.08rem; }
.button {
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
min-height: 46px; padding: 0 19px; border: 1px solid $forest; border-radius: 999px;
color: white; background: $forest; text-decoration: none; font-size: .9rem; font-weight: 700;
transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
&:hover { background: $forest-dark; box-shadow: 0 7px 18px rgba($forest, .2); transform: translateY(-1px); }
&:focus-visible { outline: 3px solid rgba($forest, .3); outline-offset: 3px; }
&--compact { min-height: 38px; padding: 0 14px; }
&--secondary { color: $forest; border-color: rgba($forest, .28); background: transparent; &:hover { color: white; background: $forest; } }
&--danger { border-color: $coral; background: $coral; &:hover { background: color.adjust($coral, $lightness: -8%); } }
}
.text-link, .back-link a { color: $forest; font-weight: 700; text-underline-offset: 3px; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 24px; align-items: start; }.home-main { min-width: 0; }.homepage-sidebar { position: sticky; top: 96px; }.fasting-widget { padding: 23px; border: 1px solid $line; border-radius: 18px; background: $surface; box-shadow: $shadow; }.fasting-widget__topline { display: flex; align-items: start; justify-content: space-between; gap: 12px; }.fasting-widget h2 { margin: 0 0 8px; font-size: 1.38rem; }.fasting-widget__copy { margin: 0 0 18px; color: $muted; font-size: .9rem; }.fasting-state { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; font-size: .67rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }.fasting-state--fasting { color: #316e58; background: $mint; }.fasting-state--eating { color: #87651f; background: #fff5d9; }.fasting-timer { --timer-color: #2e8b67; position: relative; display: grid; place-items: center; width: min(100%, 215px); aspect-ratio: 1; margin: 19px auto 13px; }.fasting-timer--eating { --timer-color: #dc9a30; }.fasting-timer__ring { width: 100%; height: 100%; transform: rotate(-90deg); }.fasting-timer__track, .fasting-timer__progress { fill: none; stroke-width: 9; }.fasting-timer__track { stroke: #e9ece7; }.fasting-timer__progress { stroke: var(--timer-color); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .75s linear; }.fasting-timer__content { position: absolute; display: grid; justify-items: center; gap: 2px; padding: 20px; text-align: center; }.fasting-timer__content strong { font-size: clamp(1.6rem, 3.1vw, 2.25rem); font-variant-numeric: tabular-nums; letter-spacing: -.055em; line-height: 1; }.fasting-timer__content span { color: $muted; font-size: .72rem; font-weight: 700; }.fasting-widget__cycle-copy { text-align: center; font-size: .82rem; }.fasting-widget__cycle-copy time { color: $ink; font-weight: 700; }
.fasting-widget__schedule { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 13px 0; margin: 0 0 16px; border-top: 1px solid $line; border-bottom: 1px solid $line; }.fasting-widget__schedule dt { color: $muted; font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }.fasting-widget__schedule dd { margin: 3px 0 0; font-size: .86rem; font-weight: 700; }.fasting-widget__actions { display: flex; align-items: center; gap: 14px; }.fasting-widget__actions form { margin: 0; }.fasting-history { margin-top: 22px; }.fasting-history h3 { margin: 0 0 8px; color: $muted; font-family: 'DM Sans', system-ui, sans-serif; font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }.fasting-history ul { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }.fasting-history li { display: flex; justify-content: space-between; gap: 8px; color: $muted; font-size: .78rem; }.fasting-history time { color: $ink; font-weight: 700; }.fasting-form { display: grid; gap: 14px; }.fasting-form .field label:not(.checkbox-field) { display: block; margin-bottom: 6px; color: #444b4b; font-size: .82rem; font-weight: 700; }.fasting-form .field input:not([type='checkbox']) { width: 100%; padding: 9px 10px; border: 1px solid #cfd4cb; border-radius: 8px; color: $ink; }.fasting-form .field small { display: block; margin-top: 4px; color: $muted; font-size: .75rem; }
.task-panel, .detail-card, .task-form, .confirmation-card { border: 1px solid $line; border-radius: 20px; background: $surface; box-shadow: $shadow; }
.task-filters { display: flex; align-items: end; gap: 14px; padding: 21px 24px; border-bottom: 1px solid $line; background: #fcfcfa; border-radius: 20px 20px 0 0; }
.task-filters label { display: block; margin-bottom: 5px; color: $muted; font-size: .77rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.task-filters select { min-width: 160px; padding: 8px 34px 8px 11px; border: 1px solid #cfd4cb; border-radius: 8px; background: white; color: $ink; }
.task-filters__actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.loading-indicator { color: $muted; font-size: .85rem; }
.htmx-indicator { opacity: 0; transition: opacity .18s ease; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.task-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 24px; }
.task-card { display: flex; flex-direction: column; min-height: 253px; padding: 20px; border: 1px solid $line; border-radius: 15px; background: white; transition: transform .18s ease, box-shadow .18s ease; &:hover { box-shadow: 0 12px 24px rgba(25, 37, 31, .08); transform: translateY(-2px); } }
.task-card--inactive { background: #fbfbf9; opacity: .72; }
.task-card__topline, .task-card__footer, .task-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-card__topline { color: $muted; font-size: .78rem; }
.priority { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.priority--low { color: #537363; background: #edf5ef; }
.priority--medium { color: #87651f; background: #fff5d9; }
.priority--high { color: #9f4034; background: #fff0ed; }
.task-card h2 { margin: 19px 0 7px; font-size: 1.35rem; line-height: 1.18; }.task-card h2 a { text-decoration: none; &:hover { color: $forest; } }
.task-card__description { margin-bottom: 14px; color: $muted; font-size: .9rem; }.task-card__meta { justify-content: flex-start; flex-wrap: wrap; color: $muted; font-size: .77rem; }.task-card__meta span { padding: 3px 7px; border-radius: 5px; background: #f2f3ef; }
.subtask-count { margin: auto 0 12px; color: $muted; font-size: .78rem; }.task-card__footer { padding-top: 13px; border-top: 1px solid $line; }.task-card__footer form { margin: 0; }
.status-button { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; color: $muted; background: none; font-size: .79rem; font-weight: 700; }.status-button__dot { width: 8px; height: 8px; border-radius: 50%; background: $forest; }.task-card--inactive .status-button__dot { background: #aeb4ae; }
.empty-state { padding: 70px 24px; text-align: center; }.empty-state h2 { margin: 11px 0 4px; font-size: 1.5rem; }.empty-state p { color: $muted; }.empty-state__icon { display: grid; place-items: center; width: 45px; height: 45px; margin: auto; border-radius: 14px; color: $forest; background: $mint; font-weight: 700; }
.planner-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 38px; align-items: end; margin-bottom: 38px; }.planner-hero > div > p:last-child { max-width: 540px; margin-bottom: 0; color: $muted; font-size: 1.05rem; }.planner-controls { display: flex; align-items: end; gap: 12px; padding: 18px; border: 1px solid $line; border-radius: 16px; background: $surface; box-shadow: $shadow; }.planner-controls label { display: block; margin-bottom: 5px; color: $muted; font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }.planner-controls input, .planner-controls select { min-height: 39px; padding: 7px 9px; border: 1px solid #cfd4cb; border-radius: 8px; background: white; color: $ink; }.planner-controls .button { min-height: 39px; padding: 0 14px; }.recommendations-panel { border: 1px solid $line; border-radius: 20px; background: $surface; box-shadow: $shadow; overflow: hidden; }.recommendations-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 25px 28px; border-bottom: 1px solid $line; background: #fcfcfa; }.recommendations-panel__header h2 { margin: 0; font-size: 1.65rem; }.budget-note { margin: 0; color: $muted; font-size: .9rem; }.budget-note strong { color: $forest; }.recommendation-list { padding: 16px 24px 24px; }.recommendation-card { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 23px 4px; border-bottom: 1px solid $line; }.recommendation-card:last-child { border-bottom: 0; }.recommendation-card h3 { margin: 11px 0 4px; font-family: Fraunces, Georgia, serif; font-size: 1.32rem; letter-spacing: -.025em; }.recommendation-card h3 a { text-decoration: none; &:hover { color: $forest; } }.recommendation-card__main > p { margin: 0; color: $muted; font-size: .88rem; }.recommendation-card__subtasks { grid-column: 1 / -1; margin-top: 5px; padding: 15px 17px; border-radius: 10px; background: #f6f8f4; }.recommendation-card__subtasks h4 { margin: 0 0 8px; color: $muted; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; }.recommendation-card__subtasks ul { display: grid; gap: 7px; padding: 0; margin: 0; list-style: none; }.recommendation-card__subtasks li { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }.recommendation-card__subtasks a { color: $ink; font-weight: 700; }.recommendation-card__subtasks span { color: $muted; font-size: .82rem; }
.back-link { margin-bottom: 25px; font-size: .9rem; }.detail-card { overflow: hidden; }.detail-card__header { display: flex; justify-content: space-between; gap: 28px; padding: 42px 44px; color: white; background: $forest; }.detail-card__header .eyebrow { color: #b7d9c2; }.detail-card__header h1 { margin-bottom: 10px; }.detail-card__date { margin: 0; color: #d6e8da; }.detail-card__actions { display: flex; align-items: start; gap: 13px; }.detail-card__actions .button--secondary { color: white; border-color: rgba(white, .5); }.detail-card__actions .button--secondary:hover { color: $forest; background: white; }.icon-link { color: #d6e8da; font-size: .86rem; }.detail-card__body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(190px, .7fr); gap: 40px; padding: 38px 44px; }.prose { color: #3e4549; }.prose p:last-child { margin-bottom: 0; }.muted { color: $muted; }.task-facts { margin: 0; }.task-facts > div { padding: 13px 0; border-bottom: 1px solid $line; }.task-facts > div:first-child { padding-top: 0; }.task-facts dt { color: $muted; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }.task-facts dd { margin: 3px 0 0; font-weight: 600; }.task-facts a { color: $forest; }.subtasks-section { margin: 42px 0 0; }.subtasks-section h2 { margin-bottom: 14px; font-size: 2rem; }.subtasks-list { max-width: 760px; padding: 0; margin: 0; list-style: none; border-top: 1px solid $line; }.subtasks-list li { display: flex; justify-content: space-between; gap: 20px; padding: 15px 4px; border-bottom: 1px solid $line; }.subtasks-list a { color: $ink; font-weight: 700; }.subtasks-list span { color: $muted; font-size: .86rem; }
.inline-form-panel { padding: 32px; }.inline-form-panel__header { display: flex; align-items: start; justify-content: space-between; gap: 24px; margin-bottom: 27px; }.inline-form-panel__header h2 { margin: 0 0 5px; font-size: 2rem; }.inline-form-panel__header p:last-child { margin: 0; color: $muted; }.task-form--inline { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.form-layout { display: grid; grid-template-columns: minmax(250px, .7fr) minmax(0, 1.3fr); gap: clamp(32px, 7vw, 100px); align-items: start; }.form-layout__intro { padding-top: 25px; }.form-layout__intro h1 { font-size: clamp(2.4rem, 4vw, 3.5rem); }.form-layout__intro p:last-child { color: $muted; font-size: 1.05rem; }.task-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 30px; }.field { min-width: 0; }.field--title, .field--description, .field--parent_task, .form-actions { grid-column: 1 / -1; }.field label:not(.checkbox-field) { display: block; margin-bottom: 7px; color: #444b4b; font-size: .85rem; font-weight: 700; }.field input:not([type='checkbox']), .field select, .field textarea { width: 100%; padding: 10px 11px; border: 1px solid #cfd4cb; border-radius: 9px; color: $ink; background: white; outline: none; transition: border .15s, box-shadow .15s; &:focus { border-color: $forest; box-shadow: 0 0 0 3px rgba($forest, .12); } }.field textarea { resize: vertical; }.checkbox-field { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; color: #444b4b; font-size: .9rem; font-weight: 600; }.checkbox-field input { width: 17px; height: 17px; accent-color: $forest; }.field small { display: block; margin-top: 4px; color: $muted; }.field--error input, .field--error select, .field--error textarea { border-color: $coral; }.field-error, .form-errors { margin: 5px 0 0; color: #aa382d; font-size: .84rem; }.form-errors { grid-column: 1 / -1; padding: 11px; border-radius: 8px; background: #fff0ed; }.form-actions { display: flex; align-items: center; gap: 18px; margin-top: 4px; }.confirmation-card { max-width: 660px; padding: 46px; }.confirmation-card h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); }.confirmation-card > p:not(.eyebrow) { max-width: 500px; color: $muted; font-size: 1.05rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 820px) { .home-layout { grid-template-columns: 1fr; }.homepage-sidebar { position: static; }.planner-hero { grid-template-columns: 1fr; align-items: start; }.planner-controls { justify-content: start; }.task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }.form-layout { grid-template-columns: 1fr; }.form-layout__intro { padding-top: 0; }.detail-card__header, .detail-card__body { padding: 30px; }.detail-card__header { display: block; }.detail-card__actions { margin-top: 24px; }.detail-card__body { grid-template-columns: 1fr; gap: 30px; } }
@media (max-width: 560px) { .planner-controls { display: grid; grid-template-columns: 1fr; }.planner-controls input, .planner-controls select { width: 100%; }.recommendations-panel__header { display: block; padding: 20px; }.budget-note { margin-top: 10px; }.recommendation-list { padding: 8px 20px 20px; }.recommendation-card { grid-template-columns: 1fr; }.recommendation-card > .text-link { justify-self: start; }.site-header__inner, .page-content { padding-left: 18px; padding-right: 18px; }.site-header__inner { min-height: 62px; }.primary-nav { gap: 12px; }.primary-nav > a:not(.button) { display: none; }.page-content { padding-top: 40px; }.hero { display: block; margin-bottom: 30px; }.hero .button { margin-top: 21px; }.task-filters { flex-wrap: wrap; padding: 17px; }.task-filters > div { flex: 1; }.task-filters__actions { width: 100%; margin-left: 0; }.task-filters select { width: 100%; }.task-grid { grid-template-columns: 1fr; padding: 15px; }.task-form { grid-template-columns: 1fr; padding: 22px; }.field--title, .field--description, .field--parent_task, .form-actions { grid-column: auto; }.detail-card__header, .detail-card__body, .confirmation-card, .inline-form-panel { padding: 25px; }.detail-card__actions { align-items: center; }.subtasks-list li { padding-left: 0; padding-right: 0; } }
.nav-logout { margin: 0; }.nav-logout button { padding: 0; border: 0; color: $muted; background: transparent; font-weight: 600; &:hover { color: $forest; } }.flash-message { max-width: 760px; margin: 0 auto 24px; padding: 12px 15px; border-radius: 10px; color: $forest-dark; background: $mint; font-weight: 600; }.weather-widget { margin-bottom: 18px; padding: 20px 23px; border: 1px solid $line; border-radius: 18px; background: linear-gradient(145deg, #f7fbf8, $surface); box-shadow: $shadow; }.weather-widget__topline { display: flex; align-items: start; justify-content: space-between; }.weather-widget h2 { margin: 0; font-size: 1.38rem; }.weather-widget__icon { font-size: 2rem; }.weather-widget__reading { margin: 14px 0 3px; color: $ink; }.weather-widget__reading strong { font-size: 1.7rem; letter-spacing: -.05em; }.weather-widget__detail { margin: 0 0 10px; color: $muted; font-size: .84rem; }.auth-panel, .settings-page { max-width: 680px; margin: 0 auto; }.auth-panel { padding: 36px; border: 1px solid $line; border-radius: 20px; background: $surface; box-shadow: $shadow; }.auth-panel h1, .settings-page > h1 { font-size: clamp(2.3rem, 4vw, 3.5rem); }.auth-panel form, .settings-card form { display: grid; gap: 16px; }.form-field { display: grid; gap: 6px; }.form-field label { color: #444b4b; font-size: .85rem; font-weight: 700; }.form-field input, .form-field select { min-height: 42px; padding: 9px 10px; border: 1px solid #cfd4cb; border-radius: 9px; }.form-field small { color: $muted; }.settings-card { margin-top: 24px; padding: 28px; border: 1px solid $line; border-radius: 18px; background: $surface; box-shadow: $shadow; }.settings-card h2 { margin-bottom: 7px; }.settings-card > p { color: $muted; }.settings-card [data-location-status] { min-height: 1.5em; color: $muted; font-size: .85rem; }
.task-weather-forecast { display: flex; align-items: center; gap: 7px; margin: 13px 0 0; padding: 9px 10px; border-radius: 8px; color: #3d5750; background: #f1f7f2; font-size: .78rem; font-weight: 600; }.task-weather-forecast > span:first-child { font-size: 1.05rem; }
.workout-panel { margin-top: 30px; padding: 27px 29px; border: 1px solid $line; border-radius: 20px; background: $surface; box-shadow: $shadow; }.workout-panel__header { display: flex; align-items: center; gap: 20px; }.workout-panel__header h2 { margin: 0; font-size: 1.7rem; }.workout-panel__header p:last-child { margin: 4px 0 0; color: $muted; font-size: .86rem; }.workout-panel__summary { display: grid; margin-left: auto; text-align: right; }.workout-panel__summary strong { color: $forest; font-size: 1.3rem; }.workout-panel__summary span, .workout-panel__note { color: $muted; font-size: .78rem; }.workout-panel__note { margin: 17px 0 -3px; }.workout-list { margin-top: 23px; border-top: 1px solid $line; }.workout-entry { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 2px; border-bottom: 1px solid $line; }.workout-entry--completed { opacity: .62; }.workout-entry--completed h3 { text-decoration: line-through; }.workout-entry h3 { margin: 0 0 3px; font-family: Fraunces, Georgia, serif; font-size: 1.16rem; }.workout-entry p { margin: 0; color: $muted; font-size: .84rem; }.workout-entry__actions { display: flex; align-items: center; gap: 13px; }.workout-entry__actions form { margin: 0; }.workout-entry__remove { padding: 0; border: 0; background: transparent; color: $coral; }.workout-empty { margin-top: 22px; color: $muted; }.workout-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }.workout-form .field--error, .workout-form .form-actions { grid-column: 1 / -1; }
@media (max-width: 560px) { .workout-panel { padding: 22px; }.workout-panel__header, .workout-entry { align-items: flex-start; flex-wrap: wrap; }.workout-panel__summary { margin-left: 0; text-align: left; }.workout-entry__actions { width: 100%; }.workout-form { grid-template-columns: 1fr; } }
.checkin-panel { margin-top: 30px; padding: 27px 29px; border: 1px solid $line; border-radius: 20px; background: $surface; box-shadow: $shadow; }
.checkin-panel__header { display: flex; justify-content: space-between; gap: 24px; align-items: start; }.checkin-panel__header h2 { margin: 0; font-size: 1.7rem; }.checkin-panel__header > div > p:last-child { margin: 4px 0 0; color: $muted; font-size: .86rem; }.checkin-streaks { display: flex; flex-wrap: wrap; justify-content: end; gap: 12px 18px; margin: 0; }.checkin-streaks > div { min-width: 74px; }.checkin-streaks dt { color: $muted; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }.checkin-streaks dd { margin: 2px 0 0; color: $forest; font-size: .92rem; font-weight: 700; }.checkin-streaks__note { min-width: 115px; }.checkin-streaks__note dd { color: $muted; font-size: .75rem; }
.checkin-form { display: grid; grid-template-columns: 120px repeat(2, minmax(110px, 1fr)); gap: 15px; align-items: end; margin-top: 24px; padding: 19px 0; border-top: 1px solid $line; border-bottom: 1px solid $line; }.checkin-form .field label:not(.checkbox-field) { display: block; margin-bottom: 6px; color: #444b4b; font-size: .8rem; font-weight: 700; }.checkin-form .field input:not([type='checkbox']) { width: 100%; min-height: 39px; padding: 8px 9px; border: 1px solid #cfd4cb; border-radius: 8px; color: $ink; background: white; }.checkin-form .field small { display: block; margin-top: 3px; color: $muted; font-size: .7rem; }.checkin-form__note { grid-column: 1 / 3; }.checkin-form__physio { grid-column: 3 / -1; }.checkin-form .form-actions { grid-column: 1 / -1; margin: -2px 0 0; }
.checkin-calendar { margin-top: 23px; }.checkin-calendar__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }.checkin-calendar__header h3 { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 1.16rem; }.checkin-calendar__header .text-link { width: 28px; text-align: center; text-decoration: none; }.checkin-calendar__weekdays, .checkin-calendar__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }.checkin-calendar__weekdays { margin-bottom: 5px; color: $muted; font-size: .66rem; font-weight: 700; text-align: center; text-transform: uppercase; }.checkin-day { position: relative; display: grid; min-height: 47px; padding: 5px; border: 1px solid transparent; border-radius: 8px; color: $ink; background: #f4f5f1; text-decoration: none; }.checkin-day:hover { border-color: rgba($forest, .45); }.checkin-day:focus-visible { outline: 3px solid rgba($forest, .3); outline-offset: 2px; }.checkin-day--unrecorded { color: #89908a; background: #f3f4f1; border-style: dashed; border-color: #d9ddd5; }.checkin-day--zero { color: #35664d; background: #dff0e4; }.checkin-day--low { color: #5d6a2a; background: #eef2d7; }.checkin-day--moderate { color: #815d1d; background: #fff0c8; }.checkin-day--high { color: #99412f; background: #ffe0d8; }.checkin-day--severe { color: white; background: #be4c40; }.checkin-day--outside { opacity: .48; }.checkin-day--today { border-color: $forest; }.checkin-day--selected { box-shadow: inset 0 0 0 2px $ink; }.checkin-day__number { font-size: .7rem; font-weight: 700; }.checkin-day__score { align-self: end; justify-self: end; font-size: 1rem; line-height: 1; }.checkin-day__empty { align-self: end; justify-self: end; font-size: .8rem; }.checkin-day__physio { position: absolute; right: 5px; bottom: 4px; font-size: .62rem; font-weight: 700; }.checkin-calendar__legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 12px 0 0; color: $muted; font-size: .72rem; }.checkin-calendar__legend span { display: inline-flex; align-items: center; gap: 5px; }.checkin-legend { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }.checkin-legend--unrecorded { border: 1px dashed #aeb4ae; background: #f3f4f1; }.checkin-legend--zero { background: #dff0e4; }
@media (max-width: 700px) { .checkin-panel__header { display: block; }.checkin-streaks { justify-content: start; margin-top: 17px; }.checkin-form { grid-template-columns: 1fr 1fr; }.checkin-form__note, .checkin-form__physio { grid-column: 1 / -1; } } @media (max-width: 420px) { .checkin-panel { padding: 22px; }.checkin-day { min-height: 42px; padding: 4px; }.checkin-calendar__grid { gap: 3px; }.checkin-day__score { font-size: .88rem; } }
.checkin-physio-total { margin: 10px 0 0; color: $muted; font-size: .83rem; }.checkin-physio-total strong { color: $forest; font-size: 1rem; }
.checkin-streaks { display: grid; grid-template-columns: repeat(3, minmax(100px, 1fr)); align-items: start; width: min(100%, 410px); gap: 18px; }.checkin-streaks > div { min-width: 0; }.checkin-streaks dt { display: flex; align-items: center; gap: 4px; min-height: 1.2em; }.checkin-streaks dd { white-space: nowrap; }.checkin-tooltip { position: relative; display: inline-grid; place-items: center; width: 15px; height: 15px; padding: 0; border: 0; border-radius: 50%; color: $forest; background: $mint; font: 700 10px/1 sans-serif; cursor: help; }.checkin-tooltip:focus-visible { outline: 2px solid $forest; outline-offset: 2px; }.checkin-tooltip__content { position: absolute; z-index: 2; bottom: calc(100% + 8px); left: 50%; width: 190px; padding: 8px 9px; border-radius: 7px; color: white; background: $ink; font: 500 .72rem/1.35 'DM Sans', system-ui, sans-serif; letter-spacing: normal; text-transform: none; text-align: left; visibility: hidden; opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(3px); transition: opacity .15s ease, transform .15s ease, visibility .15s; }.checkin-tooltip:hover .checkin-tooltip__content, .checkin-tooltip:focus .checkin-tooltip__content { visibility: visible; opacity: 1; transform: translateX(-50%) translateY(0); }
@media (max-width: 700px) { .checkin-streaks { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 12px; } } @media (max-width: 420px) { .checkin-streaks { grid-template-columns: 1fr 1fr; }.checkin-streaks > div:last-child { grid-column: 1 / -1; } }
.task-card--completed { background: #f5f8f4; }.task-card--completed h2 { text-decoration: line-through; }.task-card--completed .task-completion-button { color: $forest; }.task-card--completed .task-completion-button .status-button__dot { background: $forest; }.task-card__footer { flex-wrap: wrap; justify-content: flex-start; }.task-card__footer .text-link { margin-left: auto; }.task-completion-button.button { min-height: 38px; }.recommendation-card__actions { display: flex; align-items: center; justify-content: end; gap: 14px; }.recommendation-card__actions form { margin: 0; }.recommendation-card__actions .button { min-height: 38px; }
@media (max-width: 560px) { .recommendation-card__actions { justify-self: start; } }
.category-picker { position: relative; }.category-picker input { padding-right: 40px !important; }.category-picker__clear { position: absolute; top: 50%; right: 7px; display: grid; place-items: center; width: 27px; height: 27px; padding: 0; border: 0; border-radius: 50%; color: $muted; background: transparent; font-size: 1.25rem; line-height: 1; transform: translateY(-50%); }.category-picker__clear:hover { color: $ink; background: #edf0eb; }.category-picker__clear:focus-visible { outline: 2px solid $forest; outline-offset: 1px; }.category-picker__suggestions { position: absolute; z-index: 5; top: calc(100% + 5px); right: 0; left: 0; max-height: 180px; padding: 5px; margin: 0; overflow-y: auto; border: 1px solid $line; border-radius: 9px; background: $surface; box-shadow: $shadow; list-style: none; }.category-picker__suggestions [role="option"] { padding: 8px 9px; border-radius: 6px; cursor: pointer; font-size: .9rem; }.category-picker__suggestions [role="option"][aria-selected="true"], .category-picker__suggestions [role="option"]:hover { color: $forest-dark; background: $mint; }
.checkin-form__heading { grid-column: 1 / -1; margin: 0 0 -2px; font-family: Fraunces, Georgia, serif; font-size: 1.08rem; }.checkin-form--sleep { margin-top: -1px; border-top: 0; }.checkin-form--sleep .checkin-form__note { grid-column: 1 / -1; }.checkin-day__sleep { position: absolute; top: 4px; right: 5px; color: currentColor; font-size: .82rem; font-weight: 700; }.checkin-day__physio { left: 5px; right: auto; }.checkin-legend--sleep { width: auto; height: auto; color: $forest; background: transparent; font-style: normal; }.sleep-trend { margin-top: 24px; padding-top: 20px; border-top: 1px solid $line; }.sleep-trend header { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }.sleep-trend h3 { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 1.16rem; }.sleep-trend header p, .sleep-trend__empty { margin: 0; color: $muted; font-size: .78rem; }.sleep-trend header p { max-width: 420px; text-align: right; }.sleep-trend__table-wrap { margin-top: 12px; overflow-x: auto; }.sleep-trend table { width: 100%; border-collapse: collapse; font-size: .82rem; }.sleep-trend th, .sleep-trend td { padding: 8px 5px; border-bottom: 1px solid $line; text-align: left; }.sleep-trend thead th { color: $muted; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; }.sleep-trend tbody th { font-weight: 600; }.sleep-trend__empty { margin-top: 10px; }
@media (max-width: 700px) { .sleep-trend header { display: block; }.sleep-trend header p { margin-top: 5px; text-align: left; } }
.checkin-tabs { display: flex; gap: 6px; margin-top: 22px; padding-bottom: 1px; border-bottom: 1px solid $line; }.checkin-tabs__tab { padding: 9px 12px 10px; border-bottom: 2px solid transparent; color: $muted; font-size: .84rem; font-weight: 700; text-decoration: none; }.checkin-tabs__tab:hover { color: $forest; }.checkin-tabs__tab:focus-visible { outline: 2px solid $forest; outline-offset: -2px; }.checkin-tabs__tab.is-active { border-color: $forest; color: $forest; }
+25
View File
@@ -0,0 +1,25 @@
import { defineConfig } from 'vite';
import { fileURLToPath, URL } from 'node:url';
const root = fileURLToPath(new URL('.', import.meta.url));
export default defineConfig({
root,
base: '/static/planner/dist/',
publicDir: false,
server: {
host: '0.0.0.0',
port: 5173,
strictPort: true,
// The Vite server is development-only; accept the Django origin in use.
cors: false,
},
build: {
outDir: fileURLToPath(new URL('../planner/static/planner/dist', import.meta.url)),
emptyOutDir: true,
manifest: true,
rollupOptions: {
input: fileURLToPath(new URL('./src/main.js', import.meta.url)),
},
},
});