Minor fixes / clarifications.

This commit is contained in:
Dermot Duffy
2023-03-12 13:35:19 -07:00
parent 94c1415e58
commit 709676cd8e
2 changed files with 12 additions and 8 deletions
+11 -8
View File
@@ -13,7 +13,7 @@ import { createRef, ref, Ref } from 'lit/directives/ref.js';
import { StyleInfo, styleMap } from 'lit/directives/style-map.js';
import throttle from 'lodash-es/throttle';
import screenfull from 'screenfull';
import { string, z } from 'zod';
import { z } from 'zod';
import { actionHandler } from './action-handler-directive.js';
import {
CardConditionManager,
@@ -1816,13 +1816,16 @@ class FrigateCard extends LitElement {
protected _setPropertiesForExpandedMode(): void {
// When a new media loads, set the aspect ratio for when the card is
// expanded/popped-up.
if (this._view?.isAnyMediaView() && this._lastValidMediaLoadedInfo) {
this.style.setProperty(
'--frigate-card-expand-aspect-ratio',
`${this._lastValidMediaLoadedInfo.width} / ${this._lastValidMediaLoadedInfo.height}`,
);
}
// expanded/popped-up. This is based exclusively on last media content,
// as dimension configuration does not apply in fullscreen or expanded mode.
this.style.setProperty(
'--frigate-card-expand-aspect-ratio',
this._view?.isAnyMediaView() && this._lastValidMediaLoadedInfo
? `${this._lastValidMediaLoadedInfo.width} / ${this._lastValidMediaLoadedInfo.height}`
: 'unset',
);
// Non-media mays have no intrinsic dimensions and so we need to explicit
// request the dialog to use all available space.
this.style.setProperty(
'--frigate-card-expand-width',
this._view?.isAnyMediaView() ? 'none' : 'var(--frigate-card-expand-max-width)',
+1
View File
@@ -19,6 +19,7 @@
--frigate-card-expand-max-width: 85vw;
--frigate-card-expand-width: none;
--frigate-card-expand-height: none;
--frigate-card-expand-aspect-ratio: unset;
}
:host([dark]) {