Skip to content

Commit

Permalink
mini update
Browse files Browse the repository at this point in the history
  • Loading branch information
Henahax committed Mar 24, 2024
1 parent 83b3536 commit d9610af
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
6 changes: 3 additions & 3 deletions src/assets/reset.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
]
},
{
"id": "merchants",
"name": "Merchants",
"id": "vendors",
"name": "Vendors",
"index": 1,
"tasks": [
{
Expand Down Expand Up @@ -125,7 +125,7 @@
"name": "Guild Hall",
"interval": "daily",
"icon": "https://wiki.guildwars2.com/images/8/89/Guild_Hall_Obtained.png",
"info": "Harvesting Nodes, Merchants, Bartender Boosts",
"info": "Harvesting Nodes, Vendors, Bartender Boosts",
"link": "https://wiki.guildwars2.com/wiki/Guild_hall#Features",
"default": true
}
Expand Down
4 changes: 2 additions & 2 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
<title>GW2 Tools: Home</title>
</svelte:head>

<div class="container mx-auto flex h-full flex-col items-center justify-center p-4">
<h4 class="h4 p-4">available tools:</h4>
<div class="container mx-auto flex flex-col justify-center p-4">
<h4 class="h4 p-4">Available tools:</h4>
<div
class="container-hover container grid grid-cols-1 grid-rows-1 gap-4 sm:grid-cols-2 md:grid-cols-3"
>
Expand Down
43 changes: 20 additions & 23 deletions src/routes/reset/ResetTask.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,24 @@
import { setCookie } from './functions';
import { dataStore } from './store';
import { popup } from '@skeletonlabs/skeleton';
import type { PopupSettings } from '@skeletonlabs/skeleton';
export let task: any;
const popupHoverDaily: PopupSettings = {
event: 'hover',
target: 'popupHoverDaily',
placement: 'top'
};
const popupHoverWeekly: PopupSettings = {
event: 'hover',
target: 'popupHoverWeekly',
placement: 'top'
};
let checked = task.checked;
let checkboxText = getCheckboxText();
function handleChange(event: Event) {
checked = event.target.checked;
Expand All @@ -20,32 +34,15 @@
}
setCookie('check.' + task.id, checked.toString(), task.interval);
}
function getCheckboxText() {
let text = '';
if (task.interval === 'daily') {
text = 'check for today';
}
if (task.interval === 'weekly') {
text = 'check for this week';
}
return text;
}
</script>

<li
class="flex w-full flex-row gap-4 py-1 {checked
class="flex w-full flex-row py-1 {checked
? 'line-through opacity-50 hover:opacity-50'
: 'opacity-90 hover:opacity-100'}"
>
<label class="flex w-full flex-row items-center">
<input
type="checkbox"
class="checkbox size-6"
title={checkboxText}
bind:checked
on:change={handleChange}
/>
<input type="checkbox" class="checkbox size-6" bind:checked on:change={handleChange} />
<img src={task.icon} alt={task.name} class="mx-2 size-8" />
<div class="flex flex-col">
<div class="text-sm">
Expand All @@ -57,17 +54,17 @@
<div class="flex flex-col justify-center text-right text-sm">
<div class="flex flex-row justify-end gap-1">
{#if task.link}
<a href={task.link} title="more info" class="opacity-50 hover:opacity-100">
<a href={task.link} class="opacity-50 hover:opacity-100">
<i class="fa-regular fa-circle-question"></i>
</a>
{/if}
{#if task.interval == 'daily'}
<div title="resets daily" class="opacity-50">
<div class="opacity-50">
<i class="fa-regular fa-clock"></i>
</div>
{/if}
{#if task.interval == 'weekly'}
<div title="resets weekly" class="opacity-50">
<div class="opacity-50">
<i class="fa-regular fa-calendar"></i>
</div>
{/if}
Expand Down

0 comments on commit d9610af

Please sign in to comment.