forked from MapComplete/MapComplete
UX: tone down popover elements
This commit is contained in:
parent
559605a169
commit
d0b487bfa5
4 changed files with 27 additions and 24 deletions
|
@ -2822,10 +2822,6 @@ input[type="range"].range-lg::-moz-range-thumb {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.overflow-ellipsis {
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.text-ellipsis {
|
.text-ellipsis {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
}
|
}
|
||||||
|
@ -8344,6 +8340,10 @@ svg.apply-fill path {
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sm\:block {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
.sm\:inline {
|
.sm\:inline {
|
||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
|
@ -8420,6 +8420,10 @@ svg.apply-fill path {
|
||||||
width: auto;
|
width: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sm\:grow-0 {
|
||||||
|
flex-grow: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.sm\:grid-cols-2 {
|
.sm\:grid-cols-2 {
|
||||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||||
}
|
}
|
||||||
|
@ -8432,6 +8436,10 @@ svg.apply-fill path {
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sm\:justify-start {
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
.sm\:gap-y-3 {
|
.sm\:gap-y-3 {
|
||||||
row-gap: 0.75rem;
|
row-gap: 0.75rem;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,16 @@
|
||||||
import Tr from "../Base/Tr.svelte"
|
import Tr from "../Base/Tr.svelte"
|
||||||
import { onDestroy } from "svelte"
|
import { onDestroy } from "svelte"
|
||||||
import { Popover } from "flowbite-svelte"
|
import { Popover } from "flowbite-svelte"
|
||||||
|
import { Store } from "../../Logic/UIEventSource"
|
||||||
|
|
||||||
export let state: ThemeViewState
|
export let state: ThemeViewState
|
||||||
let gpsState = state.geolocationState
|
let gpsState = state.geolocationState
|
||||||
export let mapIsDragged: Store<void>
|
export let mapIsDragged: Store<void>
|
||||||
let open = true
|
let open = true
|
||||||
|
|
||||||
function showFor(timeoutSeconds: number = 5) {
|
function showFor(timeoutSeconds: number = 3) {
|
||||||
open = true
|
open = true
|
||||||
|
console.trace("Showing gpshelperelement")
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
open = false
|
open = false
|
||||||
}, timeoutSeconds * 1000)
|
}, timeoutSeconds * 1000)
|
||||||
|
@ -30,13 +32,13 @@
|
||||||
if (gpsState.gpsAvailable.data && gpsState.allowMoving.data) {
|
if (gpsState.gpsAvailable.data && gpsState.allowMoving.data) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
showFor(5)
|
showFor(3)
|
||||||
})
|
})
|
||||||
let explanation = gpsState.gpsStateExplanation
|
let explanation = gpsState.gpsStateExplanation.stabilized(50)
|
||||||
onDestroy(
|
onDestroy(
|
||||||
explanation.stabilized(50).addCallbackD((expl) => {
|
explanation.addCallback((expl) => {
|
||||||
if (expl) {
|
if (expl) {
|
||||||
showFor(5)
|
showFor(3)
|
||||||
} else {
|
} else {
|
||||||
open = false
|
open = false
|
||||||
}
|
}
|
||||||
|
@ -46,7 +48,6 @@
|
||||||
|
|
||||||
<Popover
|
<Popover
|
||||||
reference={undefined}
|
reference={undefined}
|
||||||
trigger="null"
|
|
||||||
placement="left"
|
placement="left"
|
||||||
transition={(e) => fade(e, { duration: 150 })}
|
transition={(e) => fade(e, { duration: 150 })}
|
||||||
bind:open
|
bind:open
|
||||||
|
|
|
@ -6,26 +6,26 @@
|
||||||
let open = false
|
let open = false
|
||||||
export let state: { osmConnection: OsmConnection }
|
export let state: { osmConnection: OsmConnection }
|
||||||
let userdetails = state.osmConnection.userDetails
|
let userdetails = state.osmConnection.userDetails
|
||||||
|
let username = userdetails.mapD(ud => ud.name)
|
||||||
userdetails.addCallbackAndRunD((ud) => {
|
username.addCallbackAndRunD((ud) => {
|
||||||
if (ud) {
|
if (ud) {
|
||||||
open = true
|
open = true
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
open = false
|
open = false
|
||||||
}, 5000)
|
}, 3000)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Popover
|
<Popover
|
||||||
class="z-50 mt-4"
|
class="mt-4 hidden sm:block"
|
||||||
defaultClass="py-2 px-3 w-fit "
|
defaultClass="py-2 px-3 w-fit "
|
||||||
trigger="null"
|
trigger="null"
|
||||||
placement="bottom"
|
placement="bottom"
|
||||||
transition={(e) => fade(e, { duration: 150 })}
|
transition={(e) => fade(e, { duration: 150 })}
|
||||||
bind:open
|
bind:open
|
||||||
>
|
>
|
||||||
{#if $userdetails !== undefined}
|
{#if $username !== undefined}
|
||||||
<div style="width: max-content" class="flex items-center">
|
<div style="width: max-content" class="flex items-center">
|
||||||
{#if $userdetails.img}
|
{#if $userdetails.img}
|
||||||
<img src={$userdetails.img} alt="avatar" class="mr-4 h-8 w-8 rounded-full" />
|
<img src={$userdetails.img} alt="avatar" class="mr-4 h-8 w-8 rounded-full" />
|
||||||
|
@ -33,7 +33,7 @@
|
||||||
<div>
|
<div>
|
||||||
<div>Welcome back</div>
|
<div>Welcome back</div>
|
||||||
<div class="normal-background" style="width: max-content">
|
<div class="normal-background" style="width: max-content">
|
||||||
<b>{$userdetails?.name}</b>
|
<b>{$username}</b>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -323,7 +323,7 @@
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<GpsElementHelper reference="#gps-control-button" {state} {mapIsDragged} />
|
<GpsElementHelper {state} {mapIsDragged} />
|
||||||
</If>
|
</If>
|
||||||
<If condition={state.mapProperties.showScale}>
|
<If condition={state.mapProperties.showScale}>
|
||||||
<div class="h-6">
|
<div class="h-6">
|
||||||
|
@ -372,12 +372,6 @@
|
||||||
</MapControlButton>
|
</MapControlButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if $debug && $hash}
|
|
||||||
<div class="alert">
|
|
||||||
{$hash}
|
|
||||||
</div>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
<If condition={state.featureSwitches.featureSwitchSearch}>
|
<If condition={state.featureSwitches.featureSwitchSearch}>
|
||||||
<div class="flex flex-grow items-center justify-end">
|
<div class="flex flex-grow items-center justify-end">
|
||||||
<div class="w-full sm:w-64">
|
<div class="w-full sm:w-64">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue