Add support for precise layout cropping options.
This commit is contained in:
1 parent
ad1f30554e
commit
c7c85d188d
21 files changed
+251
-27
No files matched your search
@@ -24,4 +24,14 @@ export const updateElementStyleFromMediaLayoutConfig = (
|
||||
element.style.removeProperty(`--frigate-card-media-layout-position-${dimension}`);
|
||||
}
|
||||
}
|
||||
for (const dimension of ['top', 'bottom', 'left', 'right']) {
|
||||
if (mediaLayoutConfig?.view_box?.[dimension] !== undefined) {
|
||||
element.style.setProperty(
|
||||
`--frigate-card-media-layout-view-box-${dimension}`,
|
||||
`${mediaLayoutConfig.view_box[dimension]}%`,
|
||||
);
|
||||
} else {
|
||||
element.style.removeProperty(`--frigate-card-media-layout-view-box-${dimension}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user