59 lines
1.7 KiB
Svelte
59 lines
1.7 KiB
Svelte
<script lang="ts">
|
|
import ColorPicker from "$lib/components/ColorPicker.svelte";
|
|
import { addSuccessToast } from "$lib/components/store";
|
|
import Toasts from "$lib/components/Toasts.svelte";
|
|
import { selectedDate } from "$lib/stores/dateStore";
|
|
|
|
let { data } = $props();
|
|
let selectedColor = $state("#ff0000");
|
|
|
|
function testNotification() {
|
|
console.log("Tested!");
|
|
addSuccessToast("Test string", false);
|
|
}
|
|
|
|
async function test2() {
|
|
addSuccessToast("Test string", false);
|
|
const resp = await fetch("https://api.fin.qowevisa.click/api/ping");
|
|
// const resp = await fetch("http://localhost:3000/api/ping");
|
|
if (resp.ok) {
|
|
console.log(await resp.json());
|
|
}
|
|
}
|
|
|
|
async function test3() {
|
|
console.log(data);
|
|
}
|
|
|
|
function handleColorChange(event: CustomEvent) {
|
|
selectedColor = event.detail;
|
|
}
|
|
</script>
|
|
|
|
<Toasts />
|
|
<p>{data.message.message}</p>
|
|
<div class="flex justify-center items-center min-h-screen bg-gray-100">
|
|
<button
|
|
onclick={testNotification}
|
|
class="w-1/6 bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 rounded-md focus:outline-none focus:ring focus:ring-blue-300"
|
|
>
|
|
Click Me!
|
|
</button>
|
|
<button
|
|
onclick={test2}
|
|
class="w-1/6 bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 rounded-md focus:outline-none focus:ring focus:ring-blue-300"
|
|
>
|
|
Click Me2!
|
|
</button>
|
|
<button
|
|
onclick={test3}
|
|
class="w-1/6 bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 rounded-md focus:outline-none focus:ring focus:ring-blue-300"
|
|
>
|
|
Click Me3!
|
|
</button>
|
|
<ColorPicker on:change={handleColorChange} borderRadius="50%" />
|
|
<p>Selected color: {selectedColor}</p>
|
|
<h1>Selected Date</h1>
|
|
<p>The date you selected in the navbar is: {$selectedDate}</p>
|
|
</div>
|