This is an attempt to address the feedback in https://github.com/vector-im/element-call/pull/1099#discussion_r1226863404 that the video grid and video tile components have become too tightly coupled. After this change, the only requirements that the video grid makes of its child components are: - They accept ref, style, and item props - They attach the ref and styles to a react-spring animated element Note: I removed the video grid Storybook file, because I'm not aware of anyone using Storybook for development of Element Call beyond Robert, and it would take some effort to fix to work with these changes.
189 lines
3.4 KiB
CSS
189 lines
3.4 KiB
CSS
/*
|
|
Copyright 2022 New Vector Ltd
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
you may not use this file except in compliance with the License.
|
|
You may obtain a copy of the License at
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
See the License for the specific language governing permissions and
|
|
limitations under the License.
|
|
*/
|
|
|
|
.videoTile {
|
|
position: absolute;
|
|
contain: strict;
|
|
top: 0;
|
|
container-name: videoTile;
|
|
container-type: size;
|
|
--tileRadius: 8px;
|
|
border-radius: var(--tileRadius);
|
|
overflow: hidden;
|
|
cursor: pointer;
|
|
|
|
/* HACK: This has no visual effect due to the short duration, but allows the
|
|
JS to detect movement via the transform property for audio spatialization */
|
|
transition: transform 0.000000001s;
|
|
}
|
|
|
|
.videoTile * {
|
|
user-select: none;
|
|
}
|
|
|
|
.videoTile video {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
background-color: #444;
|
|
}
|
|
|
|
.videoTile.isLocal:not(.screenshare) video {
|
|
transform: scaleX(-1);
|
|
}
|
|
|
|
.videoTile::after {
|
|
position: absolute;
|
|
top: -1px;
|
|
left: -1px;
|
|
right: -1px;
|
|
bottom: -1px;
|
|
content: "";
|
|
border-radius: var(--tileRadius);
|
|
box-shadow: inset 0 0 0 4px var(--accent) !important;
|
|
opacity: 0;
|
|
transition: opacity ease 0.15s;
|
|
}
|
|
|
|
.videoTile.speaking::after {
|
|
opacity: 1;
|
|
}
|
|
|
|
.videoTile.maximised {
|
|
position: relative;
|
|
border-radius: 0;
|
|
height: 100%;
|
|
width: 100%;
|
|
}
|
|
|
|
.videoTile.screenshare > video {
|
|
object-fit: contain;
|
|
}
|
|
|
|
.infoBubble {
|
|
position: absolute;
|
|
height: 24px;
|
|
padding: 0 8px;
|
|
color: var(--primary-content);
|
|
background-color: var(--background-85);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border-radius: 4px;
|
|
user-select: none;
|
|
max-width: calc(100% - 48px);
|
|
overflow: hidden;
|
|
z-index: 1;
|
|
}
|
|
|
|
.infoBubble > svg {
|
|
height: 16px;
|
|
width: 16px;
|
|
margin-right: 4px;
|
|
}
|
|
|
|
.toolbar {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
height: 42px;
|
|
|
|
color: var(--primary-content);
|
|
background-color: var(--background-85);
|
|
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
|
|
overflow: hidden;
|
|
z-index: 1;
|
|
|
|
transition: opacity ease 0.15s;
|
|
}
|
|
|
|
.toolbar:not(:hover) {
|
|
opacity: 0;
|
|
}
|
|
|
|
.toolbar:hover + .presenterLabel {
|
|
top: calc(42px + 20px); /* toolbar + margin */
|
|
}
|
|
|
|
.button {
|
|
margin-right: 16px;
|
|
}
|
|
|
|
.button svg {
|
|
width: 16px;
|
|
height: 16px;
|
|
}
|
|
|
|
.memberName {
|
|
left: 16px;
|
|
bottom: 16px;
|
|
}
|
|
|
|
.memberName > :last-child {
|
|
margin-right: 0px;
|
|
}
|
|
|
|
.memberName span {
|
|
font-size: var(--font-size-caption);
|
|
font-weight: 400;
|
|
line-height: var(--font-size-body);
|
|
text-overflow: ellipsis;
|
|
overflow: hidden;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.videoMutedOverlay {
|
|
width: 100%;
|
|
height: 100%;
|
|
background-color: #21262c;
|
|
}
|
|
|
|
.presenterLabel {
|
|
position: absolute;
|
|
top: 20px;
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
background-color: #17191c;
|
|
border-radius: 4px;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
padding: 4px 8px;
|
|
font-weight: normal;
|
|
font-size: var(--font-size-caption);
|
|
line-height: var(--font-size-body);
|
|
}
|
|
|
|
.screensharePIP {
|
|
bottom: 8px;
|
|
right: 8px;
|
|
width: 25%;
|
|
max-width: 360px;
|
|
border-radius: 20px;
|
|
}
|
|
|
|
@media (min-width: 800px) {
|
|
.videoTile {
|
|
--tileRadius: 20px;
|
|
}
|
|
}
|