diff --git a/packages/theme/styles/components.scss b/packages/theme/styles/components.scss index af256ddde6..7bd43ef2a7 100644 --- a/packages/theme/styles/components.scss +++ b/packages/theme/styles/components.scss @@ -724,7 +724,7 @@ &.categoryHeader { position: sticky; top: 0; - z-index: 1; + z-index: 100; } &.selectable.large { .hulyAccordionItem-header__label-wrapper { diff --git a/packages/theme/styles/love.scss b/packages/theme/styles/love.scss index cadb7b3bbb..58b53087c4 100644 --- a/packages/theme/styles/love.scss +++ b/packages/theme/styles/love.scss @@ -175,6 +175,18 @@ & > .antiEditBox input { font-size: .7rem; } } } +@container floorGridContainer (max-width: 380px) { + .floorGrid-room::before, + .floorGrid-configureRoom::before { border-radius: 0.25rem; } + .floorGrid-room .floorGrid-room__header { + top: calc(100% / var(--huly-floor-roomHeight) / 3 * -1.6 + .125rem); + span { font-size: .5rem; } + } + .floorGrid-configureRoom .floorGrid-configureRoom__header { + top: calc(100% / var(--huly-floor-roomHeight) / 3 * -1.6 + .125rem); + & > .antiEditBox input { font-size: .5rem; } + } +} // Room @media only screen and (max-width: 1024px) { diff --git a/packages/ui/src/utils.ts b/packages/ui/src/utils.ts index f091f01a7a..a5614425f7 100644 --- a/packages/ui/src/utils.ts +++ b/packages/ui/src/utils.ts @@ -64,7 +64,7 @@ export function checkMobile (): boolean { * @public */ export function isSafari (): boolean { - return navigator.userAgent.toLowerCase().includes('safari/') + return /^((?!chrome|android).)*safari/i.test(navigator.userAgent.toLowerCase()) } /** diff --git a/plugins/love-resources/src/components/Floor.svelte b/plugins/love-resources/src/components/Floor.svelte index 72b3cf146c..8b3aeb8990 100644 --- a/plugins/love-resources/src/components/Floor.svelte +++ b/plugins/love-resources/src/components/Floor.svelte @@ -14,25 +14,15 @@ --> -{#if !useResize} +{#if mode === 'fit'} +
{ + wrapperWidth = element.clientWidth + wrapperHeight = element.clientHeight + checkGrid() + }} + > +
+ +
+
+{:else if mode === 'width'} + {@const minSize = preview ? MIN_SIZE_REM : MIN_SIZE_REM_UMW} + {@const maxSize = preview ? MAX_SIZE_REM_PRE : MAX_SIZE_REM_UMW}
{ dispatch('resize', { width: element.clientWidth, height: element.clientHeight }) }} - class="floorGrid" + class="floorGrid w-full" {style} - style:grid-template-columns={`repeat(${FULL_GW}, 1fr)`} - style:grid-template-rows={rows ? `repeat(${rows}, 1fr)` : undefined} + style:grid-template-columns={`repeat(${FULL_GW}, minmax(${MIN_SIZE_REM_UMW}rem, ${MAX_SIZE_REM_UMW}rem))`} + style:grid-template-rows={`repeat(${rows}, minmax(${MIN_SIZE_REM_UMW}rem, ${MAX_SIZE_REM_UMW}rem))`} style:aspect-ratio={`${FULL_GW} / ${rows}`} style:margin-inline={marginInline} > @@ -88,11 +135,26 @@ display: grid; grid-auto-flow: row; grid-auto-rows: 1fr; - place-items: stretch; - place-content: start center; flex-shrink: 0; gap: 0; - width: 100%; container: floorGridContainer / inline-size; + + &.full { + width: 100%; + width: -moz-available; + } + } + .floorGrid-wrapper { + display: flex; + flex-direction: column; + align-items: center; + flex-grow: 1; + width: 100%; + height: 100%; + + .floorGrid { + width: 100%; + height: 100%; + } } diff --git a/plugins/love-resources/src/components/FloorView.svelte b/plugins/love-resources/src/components/FloorView.svelte index a7b19d2964..d565a2edca 100644 --- a/plugins/love-resources/src/components/FloorView.svelte +++ b/plugins/love-resources/src/components/FloorView.svelte @@ -32,7 +32,7 @@ $: rows = calculateFloorSize(rooms) - 1 - + {#each rooms as room} diff --git a/plugins/love-resources/src/components/LoveWidget.svelte b/plugins/love-resources/src/components/LoveWidget.svelte index 2c0c273657..da1939a5d4 100644 --- a/plugins/love-resources/src/components/LoveWidget.svelte +++ b/plugins/love-resources/src/components/LoveWidget.svelte @@ -69,6 +69,7 @@ configure={configure && floor?._id === _floor._id} rooms={getRooms($rooms, _floor._id)} selected={floor?._id === _floor._id} + background={'var(--theme-panel-color)'} on:configure={() => { if (floor?._id === _floor._id) { configure = !configure diff --git a/plugins/love-resources/src/components/ParticipantView.svelte b/plugins/love-resources/src/components/ParticipantView.svelte index df0b6d70f8..3cf72f2d47 100644 --- a/plugins/love-resources/src/components/ParticipantView.svelte +++ b/plugins/love-resources/src/components/ParticipantView.svelte @@ -16,7 +16,7 @@ import { Person, formatName } from '@hcengineering/contact' import { Avatar, personByIdStore } from '@hcengineering/contact-resources' import { Ref } from '@hcengineering/core' - import { Icon, Loading, resizeObserver } from '@hcengineering/ui' + import { Icon, Loading } from '@hcengineering/ui' import love from '../plugin' export let _id: string @@ -28,7 +28,6 @@ let parent: HTMLDivElement let activeTrack: boolean = false - let filled: boolean = false export function appendChild (track: HTMLMediaElement): void { const video = parent.querySelector('.video') @@ -53,36 +52,20 @@ activeTrack = !value } - let labelWidth: number - let parentWidth: number - $: filled = labelWidth === parentWidth && labelWidth > 0 $: user = $personByIdStore.get(_id as Ref) -
{ - parentWidth = element.clientWidth - }} -> -
{ - labelWidth = element.clientWidth - }} - > +
+
{formatName(name)} {#if connecting}
{/if} -
- -
+
+
+
@@ -139,40 +122,40 @@ .label { position: absolute; - top: 0; - left: 0; - max-width: 100%; - padding: 0.5rem 0.5rem 0.25rem 1rem; - color: white; - font-weight: 500; - background-color: rgba(0, 0, 0, 0.3); - border-radius: 0.75rem 0 0.25rem 0; display: flex; align-items: center; - gap: 0.25rem; - z-index: 1; + gap: 0.375rem; + top: 0.5rem; + left: 0.5rem; + max-width: calc(100% - 1rem); + padding: 0.375rem; text-overflow: ellipsis; overflow: hidden; - - span { - text-shadow: 0 0 0.25rem black; - } - &.filled { - padding: 0.5rem 1rem 0.25rem 1rem; - border-radius: 0.75rem 0.75rem 0 0; - } + font-weight: 500; + font-size: 0.75rem; + color: rgba(35, 37, 45, 0.75); + background-color: rgba(255, 255, 255, 0.4); + border-radius: 0.375rem; + z-index: 1; } &.small .label { - font-size: 0.75rem; - padding: 0.25rem 0.25rem 0.25rem 0.5rem; - - &.filled { - padding: 0.25rem 0.5rem; - } + font-size: 0.625rem; } } .icon { + position: absolute; + display: flex; + justify-content: center; + align-items: center; + right: 0.5rem; + bottom: 0.5rem; + width: 2rem; + height: 2rem; + background-color: #36373d; + border-radius: 0.5rem; + z-index: 1; + &:not(.muted) { display: none; } diff --git a/plugins/love-resources/src/stores.ts b/plugins/love-resources/src/stores.ts index 2f50d05a26..cc75b258c3 100644 --- a/plugins/love-resources/src/stores.ts +++ b/plugins/love-resources/src/stores.ts @@ -17,7 +17,6 @@ import { aiBotEmailSocialId } from '@hcengineering/ai-bot' import love from './plugin' import { personRefByPersonIdStore } from '@hcengineering/contact-resources' -import { getLoveUseMaxWidth } from './utils' export const rooms = writable([]) export const myOffice = derived(rooms, (val) => { @@ -142,5 +141,3 @@ onClient(() => { ) }) export const lockedRoom = writable('') - -export const loveUseMaxWidth = writable(getLoveUseMaxWidth()) diff --git a/plugins/love-resources/src/utils.ts b/plugins/love-resources/src/utils.ts index 6dde25f339..9d6babff07 100644 --- a/plugins/love-resources/src/utils.ts +++ b/plugins/love-resources/src/utils.ts @@ -86,14 +86,7 @@ import { get, writable } from 'svelte/store' import { sendMessage } from './broadcast' import RoomSettingsPopup from './components/RoomSettingsPopup.svelte' import love from './plugin' -import { - $myPreferences, - currentMeetingMinutes, - currentRoom, - myOffice, - selectedRoomPlace, - loveUseMaxWidth -} from './stores' +import { $myPreferences, currentMeetingMinutes, currentRoom, myOffice, selectedRoomPlace } from './stores' export const selectedCamId = 'selectedDevice_cam' export const selectedMicId = 'selectedDevice_mic' @@ -1168,18 +1161,3 @@ export async function getMeetingMinutesTitle ( return meeting?.title ?? '' } - -// Floor Scaling (Max Width) -const useMaxWidthKey = 'loveUseMaxWidth' -export const saveLoveUseMaxWidth = (useMaxWidth: boolean): void => { - if (useMaxWidth) localStorage.setItem(useMaxWidthKey, 'true') - else localStorage.removeItem(useMaxWidthKey) -} -export const getLoveUseMaxWidth = (): boolean => { - return localStorage.getItem(useMaxWidthKey) === 'true' -} -export const toggleLoveUseMaxWidth = (): void => { - const value = !get(loveUseMaxWidth) - loveUseMaxWidth.set(value) - saveLoveUseMaxWidth(value) -}