Allow chevrons, thumbnails or no media controls.

This commit is contained in:
Dermot Duffy
2021-09-06 16:03:51 -07:00
parent 2fa928467e
commit 7bd7731811
9 changed files with 137 additions and 85 deletions
+123
View File
@@ -0,0 +1,123 @@
@use "@material/image-list/mdc-image-list";
@use "@material/image-list";
@use './common.scss';
.frigate-card-contents {
width: 100%;
max-height: 277px; /* Max Lovelace 16/9 video height */
height: 100%;
aspect-ratio: 16 / 9;
overflow: auto;
}
.frigate-card-viewer {
width: 100%;
height: 100%;
aspect-ratio: 16 / 9;
}
.frigate-card-gallery {
overflow: auto;
-ms-overflow-style: none; /* Hide scrollbar: IE and Edge */
scrollbar-width: none; /* Hide scrollbar: Firefox */
height: 100%;
aspect-ratio: 16 / 9;
}
/* Hide scrollbar for Chrome, Safari and Opera */
.frigate-card-gallery::-webkit-scrollbar {
display: none;
}
.frigate-card-attention {
display: flex;
justify-content: center;
align-items: center;
padding: 0% 5% 0% 5%;
height: 100%;
}
.frigate-card-image-list {
@include image-list.standard-columns(5, 1px);
@include image-list.shape-radius(5px);
}
ha-card .frigate-card-image-list-folder {
display: flex;
justify-content: center;
align-items: center;
box-sizing: border-box;
text-align: center;
border-style: 2px solid;
opacity: 0.7;
color: var(--secondary-text-color, white);
border-color: var(--secondary-text-color, black);
background-color: var(--primary-background-color, black);
padding: 10px;
}
video, img {
display: block;
}
ha-card {
display: flex;
flex-direction: column;
margin: auto;
overflow: hidden;
width: 100%;
height: 100%;
position: relative;
background-color: var(--secondary-background-color, black);
transform-style: preserve-3d; /* Safari brings video elements forward without this */
}
/* Don't drop shadow or have radius for nested webrtc card */
webrtc-camera ha-card {
box-shadow: none;
border-radius: 0px;
background-color: var(--secondary-background-color, black);
}
.frigate-media-controls {
position: absolute;
z-index: 1;
overflow: hidden;
}
.frigate-media-controls.previous {
left: 45px;
}
.frigate-media-controls.next {
right: 45px;
}
.frigate-media-controls.chevrons {
top: calc(50% - (40px / 2));
}
.frigate-media-controls.thumbnails {
border-radius: 50%;
height: 48px;
top: calc(50% - (48px / 2));
box-shadow: 0px 0px 30px 1px black;
transition: all .2s ease;
opacity: 0.8;
}
.frigate-media-controls.thumbnails:hover {
opacity: 1 !important;
height: 72px;
top: calc(50% - (72px / 2));
}
.frigate-media-controls.previous.thumbnails:hover {
left: 33px;
}
.frigate-media-controls.next.thumbnails:hover {
right: 33px;
}
+16
View File
@@ -0,0 +1,16 @@
ha-icon-button.button {
z-index: 10;
color: var(--secondary-color, white);
opacity: 0.8;
background-color: rgba(0, 0, 0, 0.6);
border-radius: 50%;
padding: 0px;
margin: 3px;
--mdc-icon-button-size: 40px;
/* Buttons can always be clicked */
pointer-events: auto;
}
ha-icon-button.button.emphasize {
color: var(--primary-color, white);
}
+27
View File
@@ -0,0 +1,27 @@
.option {
padding: 4px 0px;
cursor: pointer;
}
.row {
display: flex;
margin-bottom: -14px;
pointer-events: none;
}
.title {
padding-left: 16px;
margin-top: -6px;
pointer-events: none;
}
.secondary {
padding-left: 40px;
color: var(--secondary-text-color);
pointer-events: none;
}
.values {
padding-left: 16px;
background: var(--secondary-background-color);
display: grid;
}
ha-formfield {
padding-bottom: 8px;
}
+40
View File
@@ -0,0 +1,40 @@
@use './common.scss';
.frigate-card-menu {
z-index: 1;
height: 46px;
overflow: hidden;
/* Menu div itself does not handle click events. Without this, in overlay
mode, the menu div prevents clicking on gallery items 'behind' the overlay.
*/
pointer-events: none;
}
.frigate-card-menu.overlay-hidden {
position: absolute;
width: 46px;
}
.frigate-card-menu.overlay-hidden.left {
left: 0px;
}
.frigate-card-menu.overlay-hidden.right {
right: 0px;
}
.frigate-card-menu.overlay-hidden.top {
top: 0px;
}
.frigate-card-menu.overlay-hidden.bottom {
bottom: 0px;
}
.frigate-card-menu.overlay-hidden.expanded-horizontal {
width: 100%;
background: linear-gradient(90deg, rgba(0,0,0,0.3), rgba(0,0,0,0));
}
.frigate-card-menu.overlay-hidden.expanded-vertical {
height: 100%;
background: linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0));
}
/* Full above/below menu */
.frigate-card-menu.full {
width: 100%;
background: var(--secondary-background-color);
}