Menu style will adapt if iframe in map is opened (#1422)
This commit is contained in:
parent
65b9da926b
commit
2ea7b0cff1
@ -7,7 +7,13 @@
|
|||||||
import GlobalMessageSubMenu from "./GlobalMessagesSubMenu.svelte";
|
import GlobalMessageSubMenu from "./GlobalMessagesSubMenu.svelte";
|
||||||
import ContactSubMenu from "./ContactSubMenu.svelte";
|
import ContactSubMenu from "./ContactSubMenu.svelte";
|
||||||
import CustomSubMenu from "./CustomSubMenu.svelte"
|
import CustomSubMenu from "./CustomSubMenu.svelte"
|
||||||
import {customMenuIframe, menuVisiblilityStore, SubMenusInterface, subMenusStore} from "../../Stores/MenuStore";
|
import {
|
||||||
|
checkSubMenuToShow,
|
||||||
|
customMenuIframe,
|
||||||
|
menuVisiblilityStore,
|
||||||
|
SubMenusInterface,
|
||||||
|
subMenusStore
|
||||||
|
} from "../../Stores/MenuStore";
|
||||||
import {onDestroy, onMount} from "svelte";
|
import {onDestroy, onMount} from "svelte";
|
||||||
import {get} from "svelte/store";
|
import {get} from "svelte/store";
|
||||||
import type {Unsubscriber} from "svelte/store";
|
import type {Unsubscriber} from "svelte/store";
|
||||||
@ -25,6 +31,8 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
checkSubMenuToShow();
|
||||||
|
|
||||||
switchMenu(SubMenusInterface.settings);
|
switchMenu(SubMenusInterface.settings);
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -95,6 +103,7 @@
|
|||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-submenu-container nes-container is-rounded" transition:fly="{{ y: -1000, duration: 500 }}">
|
<div class="menu-submenu-container nes-container is-rounded" transition:fly="{{ y: -1000, duration: 500 }}">
|
||||||
|
<button type="button" class="nes-btn is-error close" on:click={closeMenu}>×</button>
|
||||||
<h2>{activeSubMenu}</h2>
|
<h2>{activeSubMenu}</h2>
|
||||||
<svelte:component this={activeComponent} {...props}/>
|
<svelte:component this={activeComponent} {...props}/>
|
||||||
</div>
|
</div>
|
||||||
@ -110,9 +119,9 @@
|
|||||||
|
|
||||||
font-family: "Press Start 2P";
|
font-family: "Press Start 2P";
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
height: 80vh;
|
height: 80%;
|
||||||
width: 75vw;
|
width: 75%;
|
||||||
top: 10vh;
|
top: 10%;
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
@ -139,16 +148,34 @@
|
|||||||
div.menu-submenu-container {
|
div.menu-submenu-container {
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
color: whitesmoke;
|
color: whitesmoke;
|
||||||
|
|
||||||
|
.nes-btn.is-error.close {
|
||||||
|
position: absolute;
|
||||||
|
top: -20px;
|
||||||
|
right: -20px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 800px) {
|
@media only screen and (max-width: 800px) {
|
||||||
div.menu-container-main {
|
div.menu-container-main {
|
||||||
--size-first-columns-grid: 120px;
|
--size-first-columns-grid: 120px;
|
||||||
height: 70vh;
|
height: 70%;
|
||||||
top: 55px;
|
top: 55px;
|
||||||
width: 100vw;
|
width: 100%;
|
||||||
font-size: 0.5em;
|
font-size: 0.5em;
|
||||||
|
|
||||||
|
div.menu-nav-sidebar {
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.menu-submenu-container {
|
||||||
|
.nes-btn.is-error.close {
|
||||||
|
position: absolute;
|
||||||
|
top: -35px;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -52,11 +52,6 @@
|
|||||||
enableCameraSceneVisibilityStore.showEnableCameraScene();
|
enableCameraSceneVisibilityStore.showEnableCameraScene();
|
||||||
gameManager.leaveGame(EnableCameraSceneName,new EnableCameraScene());
|
gameManager.leaveGame(EnableCameraSceneName,new EnableCameraScene());
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Uncomment when login will be completely developed
|
|
||||||
/*function clickLogin() {
|
|
||||||
connectionManager.loadOpenIDScreen();
|
|
||||||
}*/
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="customize-main">
|
<div class="customize-main">
|
||||||
@ -71,20 +66,17 @@
|
|||||||
</section>
|
</section>
|
||||||
{:else}
|
{:else}
|
||||||
<section>
|
<section>
|
||||||
<a type="button" class="nes-btn" href="/login">Sing in</a>
|
<a type="button" class="nes-btn" href="/login">Sign in</a>
|
||||||
</section>
|
</section>
|
||||||
{/if}
|
{/if}
|
||||||
<section>
|
<section>
|
||||||
<button type="button" class="nes-btn" on:click|preventDefault={openEditNameScene}>Edit Name</button>
|
<button type="button" class="nes-btn" on:click|preventDefault={openEditNameScene}>Edit Name</button>
|
||||||
<button type="button" class="nes-btn is-rounded" on:click|preventDefault={openEditSkinScene}>Edit Skin</button>
|
<button type="button" class="nes-btn" on:click|preventDefault={openEditSkinScene}>Edit Skin</button>
|
||||||
<button type="button" class="nes-btn" on:click|preventDefault={openEditCompanionScene}>Edit Companion</button>
|
<button type="button" class="nes-btn" on:click|preventDefault={openEditCompanionScene}>Edit Companion</button>
|
||||||
</section>
|
</section>
|
||||||
<section>
|
<section>
|
||||||
<button type="button" class="nes-btn" on:click|preventDefault={openEnableCameraScene}>Setup camera</button>
|
<button type="button" class="nes-btn" on:click|preventDefault={openEnableCameraScene}>Setup camera</button>
|
||||||
</section>
|
</section>
|
||||||
<!-- <section>
|
|
||||||
<button type="button" class="nes-btn is-primary" on:click|preventDefault={clickLogin}>Login</button>
|
|
||||||
</section>-->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@ -93,6 +85,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
flex-wrap: wrap;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
|
|
||||||
iframe{
|
iframe{
|
||||||
|
@ -94,6 +94,7 @@ function changeNotification() {
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
div.settings-main {
|
div.settings-main {
|
||||||
height: calc(100% - 40px);
|
height: calc(100% - 40px);
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
section {
|
section {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@ -112,14 +113,14 @@ function changeNotification() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
section.settings-section-noSaveOption {
|
section.settings-section-noSaveOption {
|
||||||
--nb-noSaveOptions: 2; //number of sub-element in the section
|
display: flex;
|
||||||
display: grid;
|
align-items: center;
|
||||||
grid-template-columns: calc(100% / var(--nb-noSaveOptions)) calc(100% / var(--nb-noSaveOptions)); //Same size for every sub-element
|
flex-wrap: wrap;
|
||||||
|
|
||||||
label {
|
label {
|
||||||
|
flex: 1 1 auto;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 100%;
|
margin: 0 0 15px;
|
||||||
margin: 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,12 +130,6 @@ function changeNotification() {
|
|||||||
section {
|
section {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.settings-section-noSaveOption {
|
|
||||||
height: 80px;
|
|
||||||
grid-template-columns: none;
|
|
||||||
grid-template-rows: calc(100% / var(--nb-noSaveOptions)) calc(100% / var(--nb-noSaveOptions)); //Same size for every sub-element;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -71,7 +71,7 @@ function createSubMenusStore() {
|
|||||||
|
|
||||||
export const subMenusStore = createSubMenusStore();
|
export const subMenusStore = createSubMenusStore();
|
||||||
|
|
||||||
function checkSubMenuToShow() {
|
export function checkSubMenuToShow() {
|
||||||
if (!get(userIsAdminStore)) {
|
if (!get(userIsAdminStore)) {
|
||||||
subMenusStore.removeMenu(SubMenusInterface.globalMessages);
|
subMenusStore.removeMenu(SubMenusInterface.globalMessages);
|
||||||
}
|
}
|
||||||
@ -81,8 +81,6 @@ function checkSubMenuToShow() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
checkSubMenuToShow();
|
|
||||||
|
|
||||||
export const customMenuIframe = new Map<string, { url: string; allowApi: boolean }>();
|
export const customMenuIframe = new Map<string, { url: string; allowApi: boolean }>();
|
||||||
|
|
||||||
export function handleMenuRegistrationEvent(
|
export function handleMenuRegistrationEvent(
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
//TextGlobalMessage
|
//TextGlobalMessage
|
||||||
section.section-input-send-text {
|
section.section-input-send-text {
|
||||||
--height-toolbar: 15%;
|
--height-toolbar: 20%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.ql-toolbar{
|
.ql-toolbar{
|
||||||
height: var(--height-toolbar);
|
max-height: var(--height-toolbar);
|
||||||
background: whitesmoke;
|
background: whitesmoke;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user