Fix: style tweaks to link feature

This commit is contained in:
Pieter Vander Vennet 2023-09-16 02:50:01 +02:00
parent eb2a582d49
commit bd71645c04
3 changed files with 28 additions and 10 deletions

View file

@ -407,7 +407,8 @@
"isDeleted": "Deleted",
"nearby": {
"link": "This picture shows the object",
"seeNearby": "Browse and link nearby pictures"
"seeNearby": "Browse and link nearby pictures",
"title": "Nearby streetview imagery"
},
"pleaseLogin": "Please log in to add a picture",
"respectPrivacy": "Do not photograph people nor license plates. Do not upload Google Maps, Google Streetview or other copyrighted sources.",

View file

@ -11,6 +11,8 @@ import type { Feature } from "geojson";
import LayerConfig from "../../Models/ThemeConfig/LayerConfig";
import Loading from "../Base/Loading.svelte";
import AllImageProviders from "../../Logic/ImageProviders/AllImageProviders";
import Tr from "../Base/Tr.svelte";
import Translations from "../i18n/Translations";
export let tags: Store<OsmTags>;
export let state: SpecialVisualizationState;
@ -30,12 +32,23 @@ let images: Store<P4CPicture[]> = imagesProvider.store.map(images => images.slic
</script>
{#if $images.length === 0}
<Loading />
{:else}
<div class="py-2 interactive overflow-x-auto w-full flex space-x-1">
{#each $images as image (image.pictureUrl)}
<LinkableImage {tags} {image} {state} {lon} {lat} {feature} {layer} {linkable} />
{/each}
<div class="interactive rounded-2xl border-interactive p-2">
<div class="flex justify-between">
<h4>
<Tr t={Translations.t.image.nearby.title} />
</h4>
<slot name="corner" />
</div>
{/if}
{#if $images.length === 0}
<Loading />
{:else}
<div class="overflow-x-auto w-full flex space-x-1" style="scroll-snap-type: x proximity">
{#each $images as image (image.pictureUrl)}
<span class="w-fit shrink-0" style="scroll-snap-align: start">
<LinkableImage {tags} {image} {state} {lon} {lat} {feature} {layer} {linkable} />
</span>
{/each}
</div>
{/if}
</div>

View file

@ -9,6 +9,8 @@
import NearbyImages from "./NearbyImages.svelte";
import Svg from "../../Svg";
import ToSvelte from "../Base/ToSvelte.svelte";
import { XCircleIcon } from "@babeard/svelte-heroicons/solid";
import exp from "constants";
export let tags: Store<OsmTags>;
export let state: SpecialVisualizationState;
@ -24,7 +26,9 @@
</script>
{#if expanded}
<NearbyImages {tags} {state} {lon} {lat} {feature} {linkable}/>
<NearbyImages {tags} {state} {lon} {lat} {feature} {linkable}>
<XCircleIcon slot="corner" class="w-6 h-6 cursor-pointer" on:click={() => {expanded = false}}/>
</NearbyImages>
{:else}
<button class="w-full flex items-center" on:click={() => { expanded = true; }}>
<ToSvelte construct={ Svg.camera_plus_svg().SetClass("block w-8 h-8 p-1 mr-2 ")}/>