MkImageCompare
Node to show an Image comparison (using a slider).¶
Example: Regular¶
Bases: MkTemplate
Name | Children | Inherits |
---|---|---|
MkTemplate mknodes.templatenodes.mktemplate Node representing a jinja template. |
graph TD
94721311906912["mkimagecompare.MkImageCompare"]
94721308869584["mktemplate.MkTemplate"]
94721311697232["mkcontainer.MkContainer"]
94721308848336["mknode.MkNode"]
94721311766592["node.Node"]
140564252373184["builtins.object"]
94721308869584 --> 94721311906912
94721311697232 --> 94721308869584
94721308848336 --> 94721311697232
94721311766592 --> 94721308848336
140564252373184 --> 94721311766592
/home/runner/work/mknodes/mknodes/mknodes/basenodes/mkimagecompare/metadata.toml
[metadata]
icon = "mdi:image-off"
name = "MkImageCompare"
group = "image"
[[resources.js]]
link = "https://unpkg.com/img-comparison-slider@7/dist/index.js"
defer = true
[[resources.css]]
filename = "https://unpkg.com/img-comparison-slider@7/dist/styles.css"
[examples.regular]
title = "Regular"
jinja = """
{{ "https://picsum.photos/700" | MkImageCompare(after_image="https://picsum.photos/701") }}
"""
[output.html]
template = """
<img-comparison-slider>
<img src="{{ node.before_image }}" slot="first">
<img src="{{ node.after_image }}" slot="second">
</img-comparison-slider>
"""