mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-29 21:15:19 +00:00
Make the loading state more subtle
- instead of a label we show a animated gradient
This commit is contained in:
@@ -191,7 +191,6 @@
|
|||||||
"expand": "Expand",
|
"expand": "Expand",
|
||||||
"mute_for_me": "Mute for me",
|
"mute_for_me": "Mute for me",
|
||||||
"muted_for_me": "Muted for me",
|
"muted_for_me": "Muted for me",
|
||||||
"volume": "Volume",
|
"volume": "Volume"
|
||||||
"waiting_for_media": "Waiting for media..."
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,9 @@ borders don't support gradients */
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: -1; /* Put it below the outline */
|
z-index: -1; /* Put it below the outline */
|
||||||
opacity: 0; /* Hidden unless speaking */
|
opacity: 0; /* Hidden unless speaking */
|
||||||
transition: opacity ease 0.15s;
|
/* this only animates in one direction. In the other direction,
|
||||||
|
the background will disappear and the opacity has no effect.*/
|
||||||
|
transition: opacity ease 0.5s;
|
||||||
inset: calc(-1 * var(--cpd-border-width-4));
|
inset: calc(-1 * var(--cpd-border-width-4));
|
||||||
border-radius: var(--cpd-space-5x);
|
border-radius: var(--cpd-space-5x);
|
||||||
background-blend-mode: overlay, normal;
|
background-blend-mode: overlay, normal;
|
||||||
@@ -48,6 +50,11 @@ borders don't support gradients */
|
|||||||
outline: var(--cpd-border-width-2) solid var(--cpd-color-bg-canvas-default) !important;
|
outline: var(--cpd-border-width-2) solid var(--cpd-color-bg-canvas-default) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tile.loading {
|
||||||
|
/* !important because loading border should take priority over hover */
|
||||||
|
outline: var(--cpd-border-width-2) solid var(--cpd-color-bg-canvas-default) !important;
|
||||||
|
}
|
||||||
|
|
||||||
.tile.handRaised::before {
|
.tile.handRaised::before {
|
||||||
background: linear-gradient(
|
background: linear-gradient(
|
||||||
119deg,
|
119deg,
|
||||||
@@ -62,6 +69,31 @@ borders don't support gradients */
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tile.loading::before {
|
||||||
|
background: linear-gradient(
|
||||||
|
var(--angle),
|
||||||
|
var(--cpd-color-green-900) 0%,
|
||||||
|
var(--cpd-color-blue-200) 100%
|
||||||
|
);
|
||||||
|
opacity: 1;
|
||||||
|
animation: rotate-gradient linear 2s infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@property --angle {
|
||||||
|
syntax: "<angle>";
|
||||||
|
inherits: false;
|
||||||
|
initial-value: 0deg;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes rotate-gradient {
|
||||||
|
from {
|
||||||
|
--angle: 0deg;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
--angle: 360deg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media (hover: hover) {
|
@media (hover: hover) {
|
||||||
.tile:hover {
|
.tile:hover {
|
||||||
outline: var(--cpd-border-width-2) solid
|
outline: var(--cpd-border-width-2) solid
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import {
|
|||||||
useDisplayName,
|
useDisplayName,
|
||||||
LocalUserMediaViewModel,
|
LocalUserMediaViewModel,
|
||||||
RemoteUserMediaViewModel,
|
RemoteUserMediaViewModel,
|
||||||
|
EncryptionStatus,
|
||||||
} from "../state/MediaViewModel";
|
} from "../state/MediaViewModel";
|
||||||
import { Slider } from "../Slider";
|
import { Slider } from "../Slider";
|
||||||
import { MediaView } from "./MediaView";
|
import { MediaView } from "./MediaView";
|
||||||
@@ -145,6 +146,8 @@ const UserMediaTile = forwardRef<HTMLDivElement, UserMediaTileProps>(
|
|||||||
className={classNames(className, styles.tile, {
|
className={classNames(className, styles.tile, {
|
||||||
[styles.speaking]: showSpeaking,
|
[styles.speaking]: showSpeaking,
|
||||||
[styles.handRaised]: !showSpeaking && !!handRaised,
|
[styles.handRaised]: !showSpeaking && !!handRaised,
|
||||||
|
[styles.loading]:
|
||||||
|
encryptionStatus === EncryptionStatus.Connecting && !vm.local,
|
||||||
})}
|
})}
|
||||||
nameTagLeadingIcon={
|
nameTagLeadingIcon={
|
||||||
<AudioIcon
|
<AudioIcon
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ describe("MediaView", () => {
|
|||||||
<MediaView {...baseProps} video={undefined} localParticipant={false} />,
|
<MediaView {...baseProps} video={undefined} localParticipant={false} />,
|
||||||
);
|
);
|
||||||
expect(screen.getByRole("img", { name: "some name" })).toBeVisible();
|
expect(screen.getByRole("img", { name: "some name" })).toBeVisible();
|
||||||
expect(screen.getByText("video_tile.waiting_for_media")).toBeVisible();
|
expect(screen.getByTestId("videoTile")).toBeVisible();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -120,11 +120,6 @@ export const MediaView = forwardRef<HTMLDivElement, Props>(
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
{!video && !localParticipant && (
|
|
||||||
<div className={styles.status}>
|
|
||||||
{t("video_tile.waiting_for_media")}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{/* TODO: Bring this back once encryption status is less broken */}
|
{/* TODO: Bring this back once encryption status is less broken */}
|
||||||
{/*encryptionStatus !== EncryptionStatus.Okay && (
|
{/*encryptionStatus !== EncryptionStatus.Okay && (
|
||||||
<div className={styles.status}>
|
<div className={styles.status}>
|
||||||
|
|||||||
Reference in New Issue
Block a user