-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
770 additions
and
823 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<script lang="ts"> | ||
import { t } from '$lib/stores/settings'; | ||
import { t } from '$lib/stores/settings.svelte'; | ||
import { page } from '$app/stores'; | ||
import { browser, version } from '$app/environment'; | ||
import type { MenuItem } from '$lib/types'; | ||
import { swiper } from '$lib/stores/swiper'; | ||
import { uiStore } from '$lib/stores/swiper.svelte'; | ||
import { base } from '$app/paths'; | ||
const items: MenuItem[] = [ | ||
|
@@ -16,40 +16,39 @@ | |
function shareApp() { | ||
navigator.share({ | ||
title: 'Wattastisch', | ||
text: $t('teilenText'), | ||
text: t('teilenText'), | ||
url: '', | ||
}); | ||
} | ||
</script> | ||
|
||
<div id="menu"> | ||
<div id="menu-header"> | ||
<div id="app-logo" /> | ||
<div id="app-logo"></div> | ||
<div id="app-title">Wattastisch</div> | ||
</div> | ||
<div id="menu-content"> | ||
{#each items as item} | ||
<a | ||
class="menu-item" | ||
href={base + item.path} | ||
on:click={() => $swiper?.slideTo(1)} | ||
onclick={() => uiStore.swiper?.slideTo(1)} | ||
class:active={$page.url.pathname === item.path} | ||
> | ||
<div class="icon menu-square-icon">{item.icon}</div> | ||
<div class="menu-square-label">{$t(item.name)}</div> | ||
<div class="menu-square-label">{t(item.name)}</div> | ||
</a> | ||
{/each} | ||
{#if browser && navigator} | ||
<button class="menu-item" on:click={shareApp}> | ||
<button class="menu-item" onclick={shareApp}> | ||
<div class="icon menu-square-icon">share</div> | ||
<div class="menu-square-label">{$t('teilen')}</div> | ||
<div class="menu-square-label">{t('teilen')}</div> | ||
</button> | ||
{/if} | ||
</div> | ||
<div id="menu-footer"> | ||
<div>Version {version}</div> | ||
<div>Maximilian Rialto</div> | ||
<div>[email protected]</div> | ||
<div>Max Rialto</div> | ||
</div> | ||
</div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { Match } from '$lib/types'; | ||
import { getValueFromLocalStorage, setValueToLocalStorage } from '$lib/utils'; | ||
|
||
const HISTORY_KEY = 'matchHistory'; | ||
|
||
class HistoryStore { | ||
private _history = $state(getValueFromLocalStorage<Match[]>(HISTORY_KEY, [])); | ||
|
||
get history() { | ||
return this._history; | ||
} | ||
|
||
reset() { | ||
this._history = []; | ||
setValueToLocalStorage(HISTORY_KEY, []); | ||
} | ||
|
||
addMatch(match: Match) { | ||
const historyMatch = this._history.find(m => m.id === match.id); | ||
if (!historyMatch) { | ||
this._history = [match, ...this._history]; | ||
setValueToLocalStorage(HISTORY_KEY, this._history); | ||
} | ||
} | ||
} | ||
|
||
export const historyStore = new HistoryStore(); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.