Style fixes.
This commit is contained in:
+33
-36
@@ -26,7 +26,11 @@ import './editor';
|
|||||||
import frigate_card_style from './frigate-hass-card.scss';
|
import frigate_card_style from './frigate-hass-card.scss';
|
||||||
import frigate_card_menu_style from './frigate-hass-card-menu.scss';
|
import frigate_card_menu_style from './frigate-hass-card-menu.scss';
|
||||||
|
|
||||||
import { frigateCardConfigSchema, frigateGetEventsResponseSchema, FrigateMenuMode } from './types';
|
import {
|
||||||
|
frigateCardConfigSchema,
|
||||||
|
frigateGetEventsResponseSchema,
|
||||||
|
FrigateMenuMode,
|
||||||
|
} from './types';
|
||||||
import type {
|
import type {
|
||||||
FrigateCardView,
|
FrigateCardView,
|
||||||
FrigateCardConfig,
|
FrigateCardConfig,
|
||||||
@@ -96,7 +100,7 @@ export class FrigateCardMenu extends LitElement {
|
|||||||
static FRIGATE_CARD_MENU_ID: string = 'frigate-card-menu-id' as const;
|
static FRIGATE_CARD_MENU_ID: string = 'frigate-card-menu-id' as const;
|
||||||
|
|
||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
protected menuMode: FrigateMenuMode = "hidden";
|
protected menuMode: FrigateMenuMode = 'hidden';
|
||||||
|
|
||||||
@property({ attribute: false })
|
@property({ attribute: false })
|
||||||
protected expand = false;
|
protected expand = false;
|
||||||
@@ -122,7 +126,9 @@ export class FrigateCardMenu extends LitElement {
|
|||||||
protected _renderFrigateButton(): TemplateResult {
|
protected _renderFrigateButton(): TemplateResult {
|
||||||
return html` <ha-icon-button
|
return html` <ha-icon-button
|
||||||
class="button"
|
class="button"
|
||||||
icon=${this.menuMode != 'hidden' || this.expand ? 'mdi:alpha-f-box' : 'mdi:alpha-f-box-outline'}
|
icon=${this.menuMode != 'hidden' || this.expand
|
||||||
|
? 'mdi:alpha-f-box'
|
||||||
|
: 'mdi:alpha-f-box-outline'}
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
title="Frigate menu"
|
title="Frigate menu"
|
||||||
@click=${() => {
|
@click=${() => {
|
||||||
@@ -152,19 +158,20 @@ export class FrigateCardMenu extends LitElement {
|
|||||||
: 'mdi:walk';
|
: 'mdi:walk';
|
||||||
}
|
}
|
||||||
|
|
||||||
let menuClass = "frigate-card-menu-full";
|
let menuClass = 'frigate-card-menu-full';
|
||||||
if (["hidden", "overlay"].includes(this.menuMode)) {
|
if (['hidden', 'overlay'].includes(this.menuMode)) {
|
||||||
if (this.menuMode == 'overlay' || this.expand) {
|
if (this.menuMode == 'overlay' || this.expand) {
|
||||||
menuClass = "frigate-card-menu-overlay";
|
menuClass = 'frigate-card-menu-overlay';
|
||||||
} else {
|
} else {
|
||||||
menuClass = "frigate-card-menu-hidden";
|
menuClass = 'frigate-card-menu-hidden';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div class=${menuClass}>
|
<div class=${menuClass}>
|
||||||
${this._renderFrigateButton()}
|
${this._renderFrigateButton()}
|
||||||
${this.menuMode != "hidden" || this.expand ? html`
|
${this.menuMode != 'hidden' || this.expand
|
||||||
|
? html`
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
class="button"
|
class="button"
|
||||||
icon="mdi:cctv"
|
icon="mdi:cctv"
|
||||||
@@ -217,7 +224,8 @@ export class FrigateCardMenu extends LitElement {
|
|||||||
this._callAction('motion');
|
this._callAction('motion');
|
||||||
}}
|
}}
|
||||||
></ha-icon-button>`}
|
></ha-icon-button>`}
|
||||||
` : ``}
|
`
|
||||||
|
: ``}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -328,7 +336,8 @@ export class FrigateCard extends LitElement {
|
|||||||
|
|
||||||
protected _changeView(
|
protected _changeView(
|
||||||
view?: FrigateCardView | undefined,
|
view?: FrigateCardView | undefined,
|
||||||
event?: FrigateEvent | undefined): void {
|
event?: FrigateEvent | undefined,
|
||||||
|
): void {
|
||||||
if (view !== undefined) {
|
if (view !== undefined) {
|
||||||
this._viewMode = view;
|
this._viewMode = view;
|
||||||
} else {
|
} else {
|
||||||
@@ -637,7 +646,8 @@ export class FrigateCard extends LitElement {
|
|||||||
|
|
||||||
this._eventBeingShown = event;
|
this._eventBeingShown = event;
|
||||||
|
|
||||||
return html` <video
|
return html`
|
||||||
|
<video
|
||||||
class="frigate-card-viewer"
|
class="frigate-card-viewer"
|
||||||
muted
|
muted
|
||||||
controls
|
controls
|
||||||
@@ -747,45 +757,32 @@ export class FrigateCard extends LitElement {
|
|||||||
if (this.config.show_error) {
|
if (this.config.show_error) {
|
||||||
return this._showError(localize('common.show_error'));
|
return this._showError(localize('common.show_error'));
|
||||||
}
|
}
|
||||||
return html`
|
return html` <ha-card @click=${this._interactionHandler}>
|
||||||
<ha-card @click=${this._interactionHandler}>
|
|
||||||
${this.config.menu_mode != 'below' ? this._renderMenu() : ''}
|
${this.config.menu_mode != 'below' ? this._renderMenu() : ''}
|
||||||
<div class="frigate-card-contents">
|
<div class="frigate-card-contents">
|
||||||
${
|
${this._viewMode == 'clips'
|
||||||
this._viewMode == 'clips'
|
|
||||||
? html`<div class="frigate-card-gallery">
|
? html`<div class="frigate-card-gallery">
|
||||||
${until(this._renderEvents(), this._renderProgressIndicator())}
|
${until(this._renderEvents(), this._renderProgressIndicator())}
|
||||||
</div>`
|
</div>`
|
||||||
: ``
|
: ``}
|
||||||
}
|
${this._viewMode == 'snapshots'
|
||||||
${
|
|
||||||
this._viewMode == 'snapshots'
|
|
||||||
? html`<div class="frigate-card-gallery">
|
? html`<div class="frigate-card-gallery">
|
||||||
${until(this._renderEvents(), this._renderProgressIndicator())}
|
${until(this._renderEvents(), this._renderProgressIndicator())}
|
||||||
</div>`
|
</div>`
|
||||||
: ``
|
: ``}
|
||||||
}
|
${this._viewMode == 'clip'
|
||||||
${
|
|
||||||
this._viewMode == 'clip'
|
|
||||||
? html`<div class="frigate-card-viewer">
|
? html`<div class="frigate-card-viewer">
|
||||||
${until(this._renderClipPlayer(), this._renderProgressIndicator())}
|
${until(this._renderClipPlayer(), this._renderProgressIndicator())}
|
||||||
</div>`
|
</div>`
|
||||||
: ``
|
: ``}
|
||||||
}
|
${this._viewMode == 'snapshot'
|
||||||
${
|
|
||||||
this._viewMode == 'snapshot'
|
|
||||||
? html`<div class="frigate-card-viewer">
|
? html`<div class="frigate-card-viewer">
|
||||||
${until(this._renderSnapshotViewer(), this._renderProgressIndicator())}
|
${until(this._renderSnapshotViewer(), this._renderProgressIndicator())}
|
||||||
</div>`
|
</div>`
|
||||||
: ``
|
: ``}
|
||||||
}
|
${this._viewMode == 'live'
|
||||||
${
|
? html`<div class="frigate-card-viewer">${this._renderLiveViewer()}</div>`
|
||||||
this._viewMode == 'live'
|
: ``}
|
||||||
? html`<div class="frigate-card-viewer">
|
|
||||||
${this._renderLiveViewer()}
|
|
||||||
</div>`
|
|
||||||
: ``
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
${this.config.menu_mode == 'below' ? this._renderMenu() : ''}
|
${this.config.menu_mode == 'below' ? this._renderMenu() : ''}
|
||||||
</ha-card>`;
|
</ha-card>`;
|
||||||
|
|||||||
Reference in New Issue
Block a user