added init image
This commit is contained in:
+13
-11
@@ -1,17 +1,19 @@
|
|||||||
import dash_mantine_components as dmc
|
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")
|
||||||
|
|
||||||
image_element = dmc.Center(
|
image_element = dmc.Center(
|
||||||
dmc.Image(
|
html.Img(
|
||||||
|
style={
|
||||||
|
"width": "100%",
|
||||||
|
},
|
||||||
id="image-container",
|
id="image-container",
|
||||||
width=600,
|
src=f"data:image/png;base64, {init_img_enc}"
|
||||||
height=600,
|
|
||||||
withPlaceholder=True,
|
|
||||||
placeholder=[
|
|
||||||
dmc.Loader(
|
|
||||||
color="gray",
|
|
||||||
size="md"
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
Reference in New Issue
Block a user