Refactor modal layout and add visit count to home page and log page

This commit is contained in:
Sean Morley
2024-04-02 21:46:37 +00:00
parent f0894a964f
commit 302a59c86d
3 changed files with 37 additions and 12 deletions

View File

@@ -1,6 +1,8 @@
<script lang="ts">
import { goto } from '$app/navigation';
import campingDrawing from "$lib/assets/camping.svg";
import { visitCount } from '$lib/utils/stores/visitCountStore';
async function navToLog() {
goto('/log');
}
@@ -10,4 +12,16 @@
<article class="prose"><h1 class="mb-4">Welcome. Let's get Exploring!</h1></article>
<img src={campingDrawing} class="w-1/4 mb-4" alt="Logo" />
<button on:click={navToLog} class="btn btn-primary">Open Log</button>
</div>
<div class="stats shadow">
<div class="stat">
<div class="stat-title">Logged Adventures</div>
<div class="stat-value text-center">{$visitCount}</div>
<!-- <div class="stat-desc">21% more than last month</div> -->
</div>
</div>
</div>

View File

@@ -160,7 +160,12 @@
{/if}
{#if adventures.length != 0}
<div class="flex flex-row items-center justify-center mt-16 gap-4 mb-4">
<div class="flex justify-center items-center w-full mt-4">
<article class="prose">
<h2 class="text-center">Actions</h2>
</article>
</div>
<div class="flex flex-row items-center justify-center mt-2 gap-4 mb-4 flex-wrap">
<button class="btn btn-neutral" on:click={async () => { window.location.href = exportData(); }}>
<img src={exportFile} class="inline-block -mt-1" alt="Logo" /> Save as File
</button>