target attr for dioramas

This commit is contained in:
David Allemang
2026-10-01 10:24:41 -04:00
parent ef14673672
commit 05a6e311e8

View File

@@ -52,6 +52,7 @@
loop: auto, loop: auto,
subticks: auto, subticks: auto,
aspect: auto, aspect: auto,
target: auto,
) = { ) = {
let attrs = (:) let attrs = (:)
if theta != auto { attrs.insert("theta", str(theta)) } if theta != auto { attrs.insert("theta", str(theta)) }
@@ -65,6 +66,7 @@
if autoplay != auto { attrs.insert("autoplay", if (autoplay) { "" } else { "false" }) } if autoplay != auto { attrs.insert("autoplay", if (autoplay) { "" } else { "false" }) }
if loop != auto { attrs.insert("loop", if (loop) { "" } else { "false" }) } if loop != auto { attrs.insert("loop", if (loop) { "" } else { "false" }) }
if subticks != auto { attrs.insert("subticks", if (subticks) { "" } else { "false" }) } if subticks != auto { attrs.insert("subticks", if (subticks) { "" } else { "false" }) }
if aspect != auto { attrs.insert("style", "aspect-ratio: " + str(aspect)); } if aspect != auto { attrs.insert("style", "aspect-ratio: " + str(aspect)) }
if target != auto { attrs.insert("target", target.map(str).join(" ")) }
html.elem("mc-diorama", html.script(body, type: "text/mc-world"), attrs: attrs) html.elem("mc-diorama", html.script(body, type: "text/mc-world"), attrs: attrs)
} }