target attr for dioramas
This commit is contained in:
4
lib.typ
4
lib.typ
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user