Commit graph

12 commits

Author SHA1 Message Date
navi
48e06bb689 chore: sync bun.lock with less + @types/less 2026-09-28 14:32:35 +02:00
navi
a05c860c6e fix: bind :thisSlide per style block instead of per compile pass
Every slide's :thisSlide rules leaked into every other slide: the whole
joined source was recompiled once per slide with all occurrences rebound,
so each pass attached every slide's scoped rules to that pass's slide and
the concatenated output applied them all to everyone. Bind the token while
each block still belongs to one slide (global block -> any slide) and
compile the project once - also drops the O(n) duplicated CSS output.
2026-09-28 14:29:37 +02:00
navi
97ae327415 feat: compiled-style thumbnails and Less compilation in a worker
- thumbnails: compile the project stylesheet once per rebuild and feed it
  into the layout sandbox, compose each tile like the runtime does
  (<section data-ps-slide> around the slide), and show example HTML on
  the global tile instead of another real slide's content.
- worker: less compiles off the main thread in less-worker; a side-effect
  module shims window/document and disables the browser build's page
  auto-init, and compilation falls back inline if the worker can't start.
- code-to-element: wrap styles[] entries in <style> blocks - raw CSS text
  in the iframe head fell into <body> and rendered as literal garbage.
2026-09-28 13:05:42 +02:00
navi
14916e6416 refactor: order-independent scene setters, fragment-safe style extraction 2026-09-27 23:00:24 +02:00
navi
a7e463cb94 feat: render the global slide as a <?= html ?> / <?= css ?> template 2026-09-27 22:36:46 +02:00
navi
2282b13325 feat: author styles in a <style> tag written in the slide itself
Less now lives in <style> tags alongside the slide HTML, so there is one
editor buffer and no separate stylesheet tab.

- compile.ts extracts every <style> tag in the deck (global slide first,
  then each slide in order) into one project stylesheet, strips the raw tags
  from the markup so uncompiled Less never reaches the DOM, and compiles that
  source once per slide with :thisSlide resolving to the slide being compiled.
- editor.ts is back to a single buffer; the CSS/LESS workers still highlight,
  validate and complete the Less inside the tag.
- thumbnails render markup with style tags removed, exactly like the
  presentation does.
2026-09-27 21:58:26 +02:00
navi
799921e213 feat: presentation runtime with lifecycle states and :thisSlide
- src/slides/compile.ts compiles a project into runtime-ready slides.
  :thisSlide is resolved to each slide's own selector before Less runs,
  so output is deterministic and never depends on which slide is visible.
- src/slides/runtime.ts mounts every slide once and moves them through
  idle -> entering -> current -> leaving via a data-ps-state attribute;
  CSS owns the animation, JS only owns the lifecycle. Rapid input
  coalesces into a single settle instead of a queue of stale operations.
  Arrow/space/Home/End keys, plus history integration: back/forward step
  through slides and a reload restores the slide you were on.
- The editor gained two buffers: HTML slides and the project Less. The
  preview and the presentation are the same runtime (present = fullscreen
  of the same stage), and broken Less keeps the last good preview while
  reporting the error.

Adds `less` (the authoring language) and `@types/less`.
2026-09-27 21:22:04 +02:00
jan
bbfb1fce04 asdasdasdass 2026-09-27 20:18:32 +02:00
jan
9278fe9314 i dont even know what 2026-09-27 20:18:26 +02:00
jan
e309455edc refactor css + add dark mode + maybe some other stuff idk dont remember what else i did 2026-09-24 20:18:18 +02:00
jan
22e17a92d4 idk basically did parts of slides 2026-09-24 18:52:25 +02:00
jan
4d42fb6340 init 2026-09-23 21:28:03 +02:00