22 lines
536 B
Python
22 lines
536 B
Python
import dash_mantine_components as dmc
|
|
from dash import html
|
|
from pathlib import Path
|
|
from base64 import b64encode
|
|
|
|
# read init img
|
|
init_img_path = Path(__file__).parent / "init_img.png"
|
|
with open(init_img_path.absolute(), "rb") as fh:
|
|
init_img_enc = b64encode(fh.read()).decode("utf-8")
|
|
# generate init img string
|
|
init_img_src = f"data:image/png;base64, {init_img_enc}"
|
|
|
|
image_element = dmc.Center(
|
|
html.Img(
|
|
style={
|
|
"width": "100%",
|
|
},
|
|
id="image-container",
|
|
src=init_img_src
|
|
)
|
|
)
|