Fixing absolute/relative layouts of Svelte layers

This commit is contained in:
David Négrier 2021-06-02 09:58:00 +02:00
parent 96cd097af8
commit 9e35f96ce5
4 changed files with 97 additions and 58 deletions

View File

@ -22,31 +22,48 @@
</script> </script>
<div> <div>
{#if $gameOverlayVisibilityStore}
<MyCamera></MyCamera>
<CameraControls></CameraControls>
{/if}
<div class="absolute-overlay">
{#if $loginSceneVisibleStore} {#if $loginSceneVisibleStore}
<div>
<LoginScene game={game}></LoginScene> <LoginScene game={game}></LoginScene>
</div>
{/if} {/if}
{#if $selectCharacterSceneVisibleStore} {#if $selectCharacterSceneVisibleStore}
<div>
<SelectCharacterScene game={ game }></SelectCharacterScene> <SelectCharacterScene game={ game }></SelectCharacterScene>
</div>
{/if} {/if}
{#if $customCharacterSceneVisibleStore} {#if $customCharacterSceneVisibleStore}
<div>
<CustomCharacterScene game={ game }></CustomCharacterScene> <CustomCharacterScene game={ game }></CustomCharacterScene>
</div>
{/if} {/if}
{#if $selectCompanionSceneVisibleStore} {#if $selectCompanionSceneVisibleStore}
<div>
<SelectCompanionScene game={ game }></SelectCompanionScene> <SelectCompanionScene game={ game }></SelectCompanionScene>
</div>
{/if} {/if}
{#if $enableCameraSceneVisibilityStore} {#if $enableCameraSceneVisibilityStore}
<div>
<EnableCameraScene game={game}></EnableCameraScene> <EnableCameraScene game={game}></EnableCameraScene>
</div>
{/if} {/if}
<!-- {#if $menuIconVisible}
<!--
{#if $menuIconVisible}
<div>
<MenuIcon /> <MenuIcon />
{/if} --> </div>
{/if}
-->
{#if $gameOverlayVisibilityStore}
<div>
<MyCamera></MyCamera>
<CameraControls></CameraControls>
</div>
{/if}
{#if $helpCameraSettingsVisibleStore} {#if $helpCameraSettingsVisibleStore}
<div>
<HelpCameraSettingsPopup game={ game }></HelpCameraSettingsPopup> <HelpCameraSettingsPopup game={ game }></HelpCameraSettingsPopup>
</div>
{/if} {/if}
</div> </div>
</div>

View File

@ -34,7 +34,8 @@
</script> </script>
<div class="btn-cam-action"> <div>
<div class="btn-cam-action">
<div class="btn-monitor" on:click={screenSharingClick} class:hide={!$screenSharingAvailableStore} class:enabled={$requestedScreenSharingState}> <div class="btn-monitor" on:click={screenSharingClick} class:hide={!$screenSharingAvailableStore} class:enabled={$requestedScreenSharingState}>
{#if $requestedScreenSharingState} {#if $requestedScreenSharingState}
<img src={monitorImg} alt="Start screen sharing"> <img src={monitorImg} alt="Start screen sharing">
@ -56,4 +57,5 @@
<img src={microphoneCloseImg} alt="Turn off microphone"> <img src={microphoneCloseImg} alt="Turn off microphone">
{/if} {/if}
</div> </div>
</div>
</div> </div>

View File

@ -11,6 +11,8 @@
import {onDestroy} from "svelte"; import {onDestroy} from "svelte";
import HorizontalSoundMeterWidget from "./HorizontalSoundMeterWidget.svelte"; import HorizontalSoundMeterWidget from "./HorizontalSoundMeterWidget.svelte";
import cinemaCloseImg from "../images/cinema-close.svg"; import cinemaCloseImg from "../images/cinema-close.svg";
import cinemaImg from "../images/cinema.svg";
import microphoneImg from "../images/microphone.svg";
export let game: Game; export let game: Game;
let selectedCamera : string|null = null; let selectedCamera : string|null = null;
@ -86,6 +88,8 @@
<section class="selectWebcamForm"> <section class="selectWebcamForm">
{#if $cameraListStore.length > 1 } {#if $cameraListStore.length > 1 }
<div class="control-group">
<img src={cinemaImg} alt="Camera" />
<div class="nes-select"> <div class="nes-select">
<select bind:value={selectedCamera} on:change={selectCamera}> <select bind:value={selectedCamera} on:change={selectCamera}>
{#each $cameraListStore as camera} {#each $cameraListStore as camera}
@ -95,9 +99,12 @@
{/each} {/each}
</select> </select>
</div> </div>
</div>
{/if} {/if}
{#if $microphoneListStore.length > 1 } {#if $microphoneListStore.length > 1 }
<div class="control-group">
<img src={microphoneImg} alt="Microphone" />
<div class="nes-select"> <div class="nes-select">
<select bind:value={selectedMicrophone} on:change={selectMicrophone}> <select bind:value={selectedMicrophone} on:change={selectMicrophone}>
{#each $microphoneListStore as microphone} {#each $microphoneListStore as microphone}
@ -107,6 +114,7 @@
{/each} {/each}
</select> </select>
</div> </div>
</div>
{/if} {/if}
</section> </section>
@ -190,6 +198,16 @@
font-size: 200%; font-size: 200%;
} }
.control-group {
display: flex;
flex-direction: row;
img {
width: 30px;
margin-right: 10px;
}
}
.webrtcsetup{ .webrtcsetup{
/*position: absolute; /*position: absolute;
top: 140px; top: 140px;

View File

@ -1212,13 +1212,15 @@ div.action.danger p.action-body{
height: 100%; height: 100%;
pointer-events: none; pointer-events: none;
.absolute-overlay { & > div {
position: absolute; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
& > * { & > div {
position: relative; position: absolute;
width: 100%;
height: 100%;
} }
} }
} }