Add top bar for tools

This commit is contained in:
Pieter Vander Vennet 2024-08-29 12:16:35 +02:00
parent 70cc3f4f51
commit bcb7d8fb02
3 changed files with 87 additions and 51 deletions

View file

@ -863,14 +863,14 @@ video {
margin: 0.5rem; margin: 0.5rem;
} }
.m-1 {
margin: 0.25rem;
}
.m-0\.5 { .m-0\.5 {
margin: 0.125rem; margin: 0.125rem;
} }
.m-1 {
margin: 0.25rem;
}
.m-11 { .m-11 {
margin: 2.75rem; margin: 2.75rem;
} }
@ -1009,10 +1009,6 @@ video {
margin-bottom: 4rem; margin-bottom: 4rem;
} }
.mt-1 {
margin-top: 0.25rem;
}
.mr-0\.5 { .mr-0\.5 {
margin-right: 0.125rem; margin-right: 0.125rem;
} }
@ -1025,6 +1021,10 @@ video {
margin-right: 0.25rem; margin-right: 0.25rem;
} }
.mt-1 {
margin-top: 0.25rem;
}
.mb-4 { .mb-4 {
margin-bottom: 1rem; margin-bottom: 1rem;
} }
@ -3353,6 +3353,11 @@ video {
padding-right: 0.25rem; padding-right: 0.25rem;
} }
.py-2 {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
.px-3 { .px-3 {
padding-left: 0.75rem; padding-left: 0.75rem;
padding-right: 0.75rem; padding-right: 0.75rem;
@ -3403,11 +3408,6 @@ video {
padding-bottom: 0.75rem; padding-bottom: 0.75rem;
} }
.py-2 {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
}
.py-2\.5 { .py-2\.5 {
padding-top: 0.625rem; padding-top: 0.625rem;
padding-bottom: 0.625rem; padding-bottom: 0.625rem;
@ -4818,6 +4818,10 @@ code {
background-color: #00000088; background-color: #00000088;
} }
.bg-black-light-transparent {
background-color: #00000044;
}
.block-ruby { .block-ruby {
display: block ruby; display: block ruby;
} }
@ -7180,14 +7184,18 @@ svg.apply-fill path {
margin-right: 0.5rem; margin-right: 0.5rem;
} }
.sm\:mt-2 {
margin-top: 0.5rem;
}
.sm\:mr-1 { .sm\:mr-1 {
margin-right: 0.25rem; margin-right: 0.25rem;
} }
.sm\:mt-0 {
margin-top: 0px;
}
.sm\:mt-2 {
margin-top: 0.5rem;
}
.sm\:mb-0 { .sm\:mb-0 {
margin-bottom: 0px; margin-bottom: 0px;
} }
@ -7236,6 +7244,10 @@ svg.apply-fill path {
width: 50%; width: 50%;
} }
.sm\:w-64 {
width: 16rem;
}
.sm\:w-11 { .sm\:w-11 {
width: 2.75rem; width: 2.75rem;
} }
@ -7663,6 +7675,11 @@ svg.apply-fill path {
.lg\:flex-row { .lg\:flex-row {
flex-direction: row; flex-direction: row;
} }
.lg\:py-4 {
padding-top: 1rem;
padding-bottom: 1rem;
}
} }
@media (min-width: 1280px) { @media (min-width: 1280px) {

View file

@ -46,7 +46,7 @@
import SelectedElementPanel from "./Base/SelectedElementPanel.svelte" import SelectedElementPanel from "./Base/SelectedElementPanel.svelte"
import MenuDrawer from "./BigComponents/MenuDrawer.svelte" import MenuDrawer from "./BigComponents/MenuDrawer.svelte"
import DrawerLeft from "./Base/DrawerLeft.svelte" import DrawerLeft from "./Base/DrawerLeft.svelte"
import { ariaLabel, ariaLabelStore } from "../Utils/ariaLabel"
export let state: ThemeViewState export let state: ThemeViewState
let layout = state.layout let layout = state.layout
let maplibremap: UIEventSource<MlMap> = state.map let maplibremap: UIEventSource<MlMap> = state.map
@ -146,7 +146,6 @@
let debug = state.featureSwitches.featureSwitchIsDebugging let debug = state.featureSwitches.featureSwitchIsDebugging
debug.addCallbackAndRun((dbg) => { debug.addCallbackAndRun((dbg) => {
if (dbg) { if (dbg) {
document.body.classList.add("debug") document.body.classList.add("debug")
@ -167,7 +166,6 @@
animation?.cameraAnimation(mlmap) animation?.cameraAnimation(mlmap)
} }
</script> </script>
<main> <main>
@ -190,28 +188,18 @@
<div class="pointer-events-none absolute top-0 left-0 w-full"> <div class="pointer-events-none absolute top-0 left-0 w-full">
<!-- Top components --> <!-- Top components -->
<div class="pointer-events-auto float-right mt-1 flex flex-col px-1 max-[480px]:w-full sm:m-2"> <div class="flex bg-black-light-transparent pointer-events-auto items-center justify-between px-4 py-2 flex-wrap-reverse">
<If condition={state.visualFeedback}> <!-- Top bar with tools -->
{#if $selectedElement === undefined} <div class="flex items-center">
<div class="w-fit">
<VisualFeedbackPanel {state} /> <MapControlButton
</div> arialabel={Translations.t.general.labels.menu}
{/if} on:click={() => {console.log("Opening...."); state.guistate.menuIsOpened.setData(true)}}
</If> on:keydown={forwardEventToMap}
<If condition={state.featureSwitches.featureSwitchSearch}> >
<Geosearch <MenuIcon class="h-8 w-8 cursor-pointer" />
bounds={state.mapProperties.bounds} </MapControlButton>
on:searchCompleted={() => {
state.map?.data?.getCanvas()?.focus()
}}
perLayer={state.perLayer}
selectedElement={state.selectedElement}
geolocationState={state.geolocation.geolocationState}
/>
</If>
</div>
<div class="float-left m-1 flex flex-col sm:mt-2">
<If condition={state.featureSwitches.featureSwitchWelcomeMessage}>
<MapControlButton <MapControlButton
on:click={() => state.guistate.pageStates.about_theme.set(true)} on:click={() => state.guistate.pageStates.about_theme.set(true)}
on:keydown={forwardEventToMap} on:keydown={forwardEventToMap}
@ -225,14 +213,40 @@
</b> </b>
</div> </div>
</MapControlButton> </MapControlButton>
</div>
<If condition={state.featureSwitches.featureSwitchSearch}>
<div class="w-full sm:w-64 my-2 sm:mt-0">
<Geosearch
bounds={state.mapProperties.bounds}
on:searchCompleted={() => {
state.map?.data?.getCanvas()?.focus()
}}
perLayer={state.perLayer}
selectedElement={state.selectedElement}
geolocationState={state.geolocation.geolocationState}
/>
</div>
</If>
</div>
<div class="pointer-events-auto float-right mt-1 flex flex-col px-1 max-[480px]:w-full sm:m-2">
<If condition={state.visualFeedback}>
{#if $selectedElement === undefined}
<div class="w-fit">
<VisualFeedbackPanel {state} />
</div>
{/if}
</If>
</div>
<div class="float-left m-1 flex flex-col sm:mt-2">
<If condition={state.featureSwitches.featureSwitchWelcomeMessage}>
<MapControlButton
arialabel={Translations.t.general.labels.menu}
on:click={() => {console.log("Opening...."); state.guistate.menuIsOpened.setData(true)}}
on:keydown={forwardEventToMap}
>
<MenuIcon class="h-8 w-8 cursor-pointer" />
</MapControlButton>
</If> </If>
{#if currentViewLayer?.tagRenderings && currentViewLayer.defaultIcon()} {#if currentViewLayer?.tagRenderings && currentViewLayer.defaultIcon()}
<MapControlButton <MapControlButton
@ -310,7 +324,8 @@
/> />
</If> </If>
<button <button
class="as-link bg-black-transparent pointer-events-auto ml-1 h-fit max-h-12 cursor-pointer self-end self-center overflow-hidden rounded-2xl px-1 text-white opacity-50 hover:opacity-100" class="unstyled bg-black-transparent pointer-events-auto ml-1 h-fit max-h-12 cursor-pointer overflow-hidden rounded-2xl px-1 text-white opacity-50 hover:opacity-100"
style="background: #00000088; padding: 0.25rem; border-radius: 2rem;"
on:click={() => {state.guistate.pageStates.copyright.set(true)}} on:click={() => {state.guistate.pageStates.copyright.set(true)}}
> >
© <span class="hidden sm:inline sm:pr-2"> © <span class="hidden sm:inline sm:pr-2">
@ -387,7 +402,7 @@
<svelte:fragment slot="error" /> <svelte:fragment slot="error" />
</LoginToggle> </LoginToggle>
<DrawerLeft shown={state.guistate.menuIsOpened} > <DrawerLeft shown={state.guistate.menuIsOpened}>
<MenuDrawer onlyLink={true} {state} /> <MenuDrawer onlyLink={true} {state} />
</DrawerLeft> </DrawerLeft>
<MenuDrawer onlyLink={false} {state} /> <MenuDrawer onlyLink={false} {state} />

View file

@ -469,6 +469,10 @@ code {
background-color: #00000088; background-color: #00000088;
} }
.bg-black-light-transparent {
background-color: #00000044;
}
.block-ruby { .block-ruby {
display: block ruby; display: block ruby;
} }