1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-07-23 23:09:37 +02:00

Add links to cards

This commit is contained in:
Sean Morley 2024-08-08 22:12:06 -04:00
parent e51e072722
commit 58d53f784f
2 changed files with 53 additions and 28 deletions

View file

@ -80,7 +80,20 @@
class="card min-w-max lg:w-96 md:w-80 sm:w-60 xs:w-40 bg-primary-content shadow-xl overflow-hidden text-base-content"
>
<div class="card-body">
<h2 class="card-title overflow-ellipsis">{collection.name}</h2>
<div class="flex justify-between">
<button
on:click={() => goto(`/collections/${collection.id}`)}
class="text-2xl font-semibold -mt-2 break-words text-wrap hover:underline"
>
{collection.name}
</button>
</div>
<div class="inline-flex gap-2 mb-2">
<div class="badge badge-neutral">{collection.is_public ? 'Public' : 'Private'}</div>
{#if collection.is_archived}
<div class="badge badge-warning">Archived</div>
{/if}
</div>
<p>{collection.adventures.length} Adventures</p>
{#if collection.start_date && collection.end_date}
<p>
@ -96,12 +109,7 @@
) + 1}{' '}
days
</p>{/if}
<div class="inline-flex gap-2 mb-2">
<div class="badge badge-neutral">{collection.is_public ? 'Public' : 'Private'}</div>
{#if collection.is_archived}
<div class="badge badge-warning">Archived</div>
{/if}
</div>
<div class="card-actions justify-end">
{#if type != 'link'}
<button on:click={() => (isWarningModalOpen = true)} class="btn btn-secondary"

View file

@ -109,25 +109,45 @@
let createModalOpen = false;
</script>
<label class="label cursor-pointer">
<span class="label-text">Visited</span>
<input type="checkbox" bind:checked={showVisited} class="checkbox checkbox-primary" />
</label>
<label class="label cursor-pointer">
<span class="label-text">Planned</span>
<input type="checkbox" bind:checked={showPlanned} class="checkbox checkbox-primary" />
</label>
<h1 class="text-center font-bold text-4xl">Adventure Map</h1>
{#if newMarker.length > 0}
<button type="button" class="btn btn-primary mb-2" on:click={() => (createModalOpen = true)}
>Add New Adventure at Marker</button
>
<button type="button" class="btn btn-neutral mb-2" on:click={clearMarkers}>Clear Marker</button>
{:else}
<button type="button" class="btn btn-primary mb-2" on:click={() => (createModalOpen = true)}
>Add New Adventure</button
>
{/if}
<div class="m-2 flex flex-col items-center justify-center">
<div class="gap-4 border-solid border-2 rounded-lg p-2 mb-4 border-neutral max-w-4xl">
<p class="font-semibold text-center text-xl mb-2">Map Options</p>
<div class="flex flex-wrap items-center justify-center gap-4">
<label class="label cursor-pointer">
<span class="label-text mr-1">Visited</span>
<input type="checkbox" bind:checked={showVisited} class="checkbox checkbox-primary" />
</label>
<label class="label cursor-pointer">
<span class="label-text mr-1">Planned</span>
<input type="checkbox" bind:checked={showPlanned} class="checkbox checkbox-primary" />
</label>
<!-- <div class="divider divider-horizontal"></div> -->
<label for="show-geo">Show Borders</label>
<input
type="checkbox"
id="show-geo"
name="show-geo"
class="checkbox"
bind:checked={showGEO}
/>
<!-- <div class="divider divider-horizontal"></div> -->
{#if newMarker.length > 0}
<button type="button" class="btn btn-primary mb-2" on:click={() => (createModalOpen = true)}
>Add New Adventure at Marker</button
>
<button type="button" class="btn btn-neutral mb-2" on:click={clearMarkers}
>Clear Marker</button
>
{:else}
<button type="button" class="btn btn-primary mb-2" on:click={() => (createModalOpen = true)}
>Add New Adventure</button
>
{/if}
</div>
</div>
</div>
{#if createModalOpen}
<NewAdventure
@ -138,9 +158,6 @@
/>
{/if}
<label for="show-geo">Show Borders?</label>
<input type="checkbox" id="shpw-gep" name="show-geo" class="checkbox" bind:checked={showGEO} />
<MapLibre
style="https://basemaps.cartocdn.com/gl/voyager-gl-style/style.json"
class="relative aspect-[9/16] max-h-[70vh] w-full sm:aspect-video sm:max-h-full"