From 0c3e5866d38cd24edd838f12781d3b5753211859 Mon Sep 17 00:00:00 2001 From: Josua Frank Date: Mon, 18 Nov 2024 22:19:34 +0100 Subject: [PATCH 1/5] first work --- .env.example | 3 +- components/layout/LoginButton.vue | 108 ++++++++++++++++++ components/templates/TileList.vue | 10 +- .../templates/number/FavoriteButton.vue | 6 +- composables/usePocketBase.ts | 8 ++ i18n/locales/de-DE.json | 2 + i18n/locales/en-US.json | 2 + layouts/default.vue | 3 +- nuxt.config.ts | 1 + package-lock.json | 9 +- package.json | 1 + pages/templates/index.vue | 6 +- plugins/favorite-tiles.ts | 12 ++ public/images/logo.png | Bin 0 -> 362731 bytes stores/user.ts | 13 +++ 15 files changed, 171 insertions(+), 13 deletions(-) create mode 100644 components/layout/LoginButton.vue create mode 100644 composables/usePocketBase.ts create mode 100644 plugins/favorite-tiles.ts create mode 100644 public/images/logo.png create mode 100644 stores/user.ts diff --git a/.env.example b/.env.example index b013327..6d7b0e9 100644 --- a/.env.example +++ b/.env.example @@ -2,4 +2,5 @@ # npx onedrive-link NUXT_EXCEL_POLL_URL=https://api.onedrive.com/v1.0/shares//root/content NUXT_PUBLIC_PIXELHOBBY_TILE_ID=35007450218648 -NUXT_EXCEL_POLL_INTERVAL_MS=86400000 \ No newline at end of file +NUXT_EXCEL_POLL_INTERVAL_MS=86400000 +NUXT_PUBLIC_POCKETBASE_URL=https://some-pocketbase.com \ No newline at end of file diff --git a/components/layout/LoginButton.vue b/components/layout/LoginButton.vue new file mode 100644 index 0000000..0403744 --- /dev/null +++ b/components/layout/LoginButton.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/components/templates/TileList.vue b/components/templates/TileList.vue index 7badc6b..b066d32 100644 --- a/components/templates/TileList.vue +++ b/components/templates/TileList.vue @@ -60,7 +60,7 @@ @click.stop="toggleTileFavorite(tile)" > ("/api/v1/progress"); const props = defineProps({ @@ -135,9 +135,9 @@ const tiles = ref([]); if (props.filter === "favorites") { onMounted(() => { watch( - favoriteTileStore, + favoriteTilesStore, () => { - tiles.value = favoriteTileStore.favoriteTiles + tiles.value = favoriteTilesStore.favoriteTiles .concat() // basically copies the array .sort(function (tileA, tileB) { return tileA - tileB; @@ -155,7 +155,7 @@ if (props.filter === "favorites") { } function toggleTileFavorite(number: number) { - favoriteTileStore.toggleFavoriteTile(number); + favoriteTilesStore.toggleFavoriteTile(number); } function openTile(number: number) { diff --git a/components/templates/number/FavoriteButton.vue b/components/templates/number/FavoriteButton.vue index be77d32..037cdf7 100644 --- a/components/templates/number/FavoriteButton.vue +++ b/components/templates/number/FavoriteButton.vue @@ -2,7 +2,7 @@ +