Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

v0.9.15: directional slide-in entrances (x channel); fold Presenter display into Speaker notes

nyblnet7b657e8c3c2f
diff --git a/slides/package.json b/slides/package.json
index f374719e..68004978 100644
--- a/slides/package.json
+++ b/slides/package.json
@@ -1,7 +1,7 @@
{
"name": "bento-slides",
"private": true,
- "version": "0.9.14",
+ "version": "0.9.15",
"type": "module",
"scripts": {
"dev": "vite",
@@ -21,4 +21,4 @@
"vite": "^7.1.1",
"vite-plugin-singlefile": "^2.3.3"
}
-}
\ No newline at end of file
+}
diff --git a/slides/src/anim.ts b/slides/src/anim.ts
index 26dcfe0d..a12392fc 100644
--- a/slides/src/anim.ts
+++ b/slides/src/anim.ts
@@ -1,7 +1,7 @@
// Bento's animation engine — the in-house replacement for GSAP, sized to
// exactly what the presenter and editor use:
// anim.to / anim.fromTo(target, vars) with channels:
-// opacity, y (translate px), scale, color, strokeDashoffset,
+// opacity, x / y (translate px), scale, color, strokeDashoffset,
// attr: { fill, stop-color, offset, x1..y2, … } (colors interpolate),
// motionPath: { path } (translate along an SVG path, relative),
// plain numeric props on non-element targets (countUp state objects)
@@ -271,6 +271,11 @@ export class Tween {
const f = from.opacity ?? parseFloat(getComputedStyle(el).opacity) ?? 1
const lerp = lerper(Number(f), Number(toVal))
this.applies.push((p) => { el.style.opacity = String(lerp(p)) })
+ } else if (key === 'x') {
+ const xf = xformOf(el)
+ const f = Number(from.x ?? xf.x)
+ const lerp = lerper(f, Number(toVal))
+ this.applies.push((p) => { xf.x = lerp(p) as number; writeXform(el) })
} else if (key === 'y') {
const x = xformOf(el)
const f = Number(from.y ?? x.y)
diff --git a/slides/src/editor/panels.ts b/slides/src/editor/panels.ts
index afebaa42..b60eba56 100644
--- a/slides/src/editor/panels.ts
+++ b/slides/src/editor/panels.ts
@@ -132,10 +132,11 @@ export class PropsPanel {
* live show can put speaker notes on a second screen. It CANNOT be requested
* during present — the S keypress activation is spent on window.open /
* fullscreen — so this is where it belongs: in the panel, before you present.
+ * Rendered inline under the "Speaker notes" section (same concern), no header
+ * of its own.
*/
private buildPresenterDisplay() {
if (!windowManagementSupported()) return
- this.section(t('Presenter display'))
const btn = document.createElement('button')
btn.className = 'ed-btn ed-btn-block'
const status = document.createElement('p')
@@ -201,8 +202,6 @@ export class PropsPanel {
this.host.appendChild(hint)
}
- this.buildPresenterDisplay()
-
// interactivity: naming, state-of, hover focus
this.section(t('Interactivity'))
const name = document.createElement('input')
@@ -316,6 +315,8 @@ export class PropsPanel {
notesHint.className = 'ed-hint'
notesHint.innerHTML = t('Press <b>S</b> while presenting to open the speaker view — these notes beside the current and next slide, with a timer.')
this.host.appendChild(notesHint)
+ // second-screen grant lives here too — notes go to the other display when set
+ this.buildPresenterDisplay()
}
private buildMultiPanel(els: SlideElement[]) {
@@ -416,8 +417,9 @@ export class PropsPanel {
}, true)
this.row(t('Enter'), this.select(
- ['none', 'fade', 'fade-up'], el.fx?.enter ?? 'none',
- (v) => setFx({ enter: v === 'none' ? undefined : (v as 'fade' | 'fade-up') })))
+ ['none', 'fade', 'fade-up', 'fade-down', 'slide-left', 'slide-right', 'slide-up', 'slide-down'],
+ el.fx?.enter ?? 'none',
+ (v) => setFx({ enter: v === 'none' ? undefined : (v as NonNullable<typeof el.fx>['enter']) })))
this.row(t('Count up'), this.select(
['off', 'on'], el.fx?.countUp ? 'on' : 'off',
(v) => setFx({ countUp: v === 'on' ? true : undefined })))
diff --git a/slides/src/model.ts b/slides/src/model.ts
index 8c6d7f15..917e7dec 100644
--- a/slides/src/model.ts
+++ b/slides/src/model.ts
@@ -25,8 +25,9 @@ export interface ElementBase {
shadow?: ShadowSpec | ShadowSpec[]
/** presentation effects, run in present mode only */
fx?: {
- /** entrance animation when the slide is shown */
- enter?: 'fade-up' | 'fade'
+ /** entrance animation when the slide is shown. fade-* nudge ~16px; slide-*
+ * sweep ~120px in from an edge (slide-left starts to the right, etc.) */
+ enter?: 'fade-up' | 'fade' | 'fade-down' | 'slide-left' | 'slide-right' | 'slide-up' | 'slide-down'
/** stagger step within the entrance sequence; equal values enter together */
order?: number
/** animate numeric parts of the text from 0 to their final value */