25 lines
575 B
Python
25 lines
575 B
Python
from __future__ import annotations
|
|
|
|
from base64 import b64encode
|
|
from pathlib import Path
|
|
|
|
import dash_mantine_components as dmc
|
|
from dash import html
|
|
|
|
# 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,
|
|
),
|
|
)
|