Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

Merge remote-tracking branch 'origin/main' into pr26

nyblnetecd492c919cf
diff --cc slides/src/model.ts
index 93e6ca85,d930831e..bcbcd0cd
--- a/slides/src/model.ts
+++ b/slides/src/model.ts
@@@ -35,10 -35,12 +35,16 @@@ export interface ElementBase
* white glow.
*/
shadow?: ShadowSpec | ShadowSpec[]
+ /** Gaussian blur ON this element, in px. Composed into the SAME CSS `filter`
+ * as `shadow` (both apply). Survives PDF/print, unlike backdrop blur. */
+ blur?: number
+ /** CSS mix-blend-mode for this element ('screen' for neon light glows,
+ * 'multiply'/'overlay' for editorial duotones). Omitted/'' = normal. */
+ blend?: string
+ /** Frosted-glass backdrop blur behind this element, in px (0/undefined = off).
+ * Screen-only: browser print/PDF drops backdrop-filter (pair with a
+ * translucent `fill` so PDFs show a graceful flat panel). */
+ backdropFilter?: number
/** presentation effects, run in present mode only */
fx?: {
/** entrance animation when the slide is shown. fade-* nudge ~16px; slide-*
diff --cc slides/src/render.ts
index eab1e98d,e8d8d37c..abb8b4e1
--- a/slides/src/render.ts
+++ b/slides/src/render.ts
@@@ -129,16 -129,10 +129,17 @@@ export function applyElementFrame(node
node.style.transform = el.rotation ? `rotate(${el.rotation}deg)` : ''
node.style.opacity = String(el.opacity)
const shadows = Array.isArray(el.shadow) ? el.shadow : el.shadow ? [el.shadow] : []
- node.style.filter = shadows.length
- ? shadows.map((s) => `drop-shadow(${s.x ?? 0}px ${s.y ?? 0}px ${s.blur}px ${s.color})`).join(' ')
- : ''
+ const parts = shadows.map((s) => `drop-shadow(${s.x ?? 0}px ${s.y ?? 0}px ${s.blur}px ${s.color})`)
+ if (el.blur) parts.push(`blur(${el.blur}px)`)
+ node.style.filter = parts.length ? parts.join(' ') : ''
+ node.style.mixBlendMode = el.blend || ''
+ if (el.backdropFilter) {
+ const bf = `blur(${el.backdropFilter}px)`
+ node.style.backdropFilter = bf
+ node.style.setProperty('-webkit-backdrop-filter', bf)
+ } else {
+ node.style.backdropFilter = ''
+ }
}
// Gradient ids must be unique per rendered instance: the same element renders