From 0943ec89915d9341f04eb1caab34982e8804412a Mon Sep 17 00:00:00 2001 From: Gregoire Parant Date: Mon, 21 Feb 2022 01:09:53 +0100 Subject: [PATCH] Define color text by brightness Signed-off-by: Gregoire Parant --- .../EmbedScreens/CoWebsiteThumbnailSlot.svelte | 9 +++++---- .../Video/ScreenSharingMediaBox.svelte | 6 ++++-- .../src/Components/Video/VideoMediaBox.svelte | 6 ++++-- front/src/Components/Video/utils.ts | 18 ++++++++++++++++++ front/src/Phaser/Entity/Character.ts | 2 +- 5 files changed, 32 insertions(+), 9 deletions(-) diff --git a/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte b/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte index ecd62b71..d8431704 100644 --- a/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte +++ b/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte @@ -326,8 +326,6 @@ } &.jitsi { - filter: invert(100%); - -webkit-filter: invert(100%); padding: 7px; } } @@ -343,15 +341,18 @@ display: none; position: absolute; background-color: rgba(0, 0, 0, 0.6); - top: -30px; + top: -40px; left: -4px; width: 0 !important; min-height: 20px; transition: all 0.2s ease; overflow: hidden; color: white; - padding: 2px; + padding: 4px; border-radius: 4px; + p { + margin-bottom: 0; + } } } diff --git a/front/src/Components/Video/ScreenSharingMediaBox.svelte b/front/src/Components/Video/ScreenSharingMediaBox.svelte index d7609421..73fb792e 100644 --- a/front/src/Components/Video/ScreenSharingMediaBox.svelte +++ b/front/src/Components/Video/ScreenSharingMediaBox.svelte @@ -4,13 +4,15 @@ import type { Streamable } from "../../Stores/StreamableCollectionStore"; import type { ScreenSharingPeer } from "../../WebRtc/ScreenSharingPeer"; - import { getColorByString, srcObject } from "./utils"; + import { getColorByString, srcObject, getTextColorByBackgroundColor } from "./utils"; export let clickable = false; export let peer: ScreenSharingPeer; let streamStore = peer.streamStore; let name = peer.userName; + let backGroundColor = getColorByString(peer.userName); + let textColor = getTextColorByBackgroundColor(backGroundColor); let statusStore = peer.statusStore; let embedScreen: EmbedScreen; @@ -32,7 +34,7 @@ {/if} {#if $streamStore !== null} - {name} + {name}