mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
commit
777c3e4c9c
33 changed files with 489 additions and 6152 deletions
5607
package-lock.json
generated
5607
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -16,8 +16,8 @@
|
|||
"@playwright/test": "^1.24.2",
|
||||
"@rgossiaux/svelte-headlessui": "1.0.2",
|
||||
"@rgossiaux/svelte-heroicons": "^0.1.2",
|
||||
"@sveltejs/adapter-auto": "1.0.0-next.64",
|
||||
"@sveltejs/kit": "1.0.0-next.405",
|
||||
"@sveltejs/adapter-auto": "1.0.0-next.65",
|
||||
"@sveltejs/kit": "1.0.0-next.431",
|
||||
"@types/cookie": "^0.5.1",
|
||||
"@types/node": "^18.6.4",
|
||||
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
||||
|
|
|
|||
317
pnpm-lock.yaml
317
pnpm-lock.yaml
|
|
@ -8,8 +8,8 @@ specifiers:
|
|||
'@playwright/test': ^1.24.2
|
||||
'@rgossiaux/svelte-headlessui': 1.0.2
|
||||
'@rgossiaux/svelte-heroicons': ^0.1.2
|
||||
'@sveltejs/adapter-auto': 1.0.0-next.64
|
||||
'@sveltejs/kit': 1.0.0-next.405
|
||||
'@sveltejs/adapter-auto': 1.0.0-next.65
|
||||
'@sveltejs/kit': 1.0.0-next.431
|
||||
'@types/cookie': ^0.5.1
|
||||
'@types/feather-icons': ^4.7.0
|
||||
'@types/node': ^18.6.4
|
||||
|
|
@ -48,8 +48,8 @@ devDependencies:
|
|||
'@playwright/test': 1.24.2
|
||||
'@rgossiaux/svelte-headlessui': 1.0.2_svelte@3.49.0
|
||||
'@rgossiaux/svelte-heroicons': 0.1.2_svelte@3.49.0
|
||||
'@sveltejs/adapter-auto': 1.0.0-next.64
|
||||
'@sveltejs/kit': 1.0.0-next.405_svelte@3.49.0+vite@3.0.4
|
||||
'@sveltejs/adapter-auto': 1.0.0-next.65
|
||||
'@sveltejs/kit': 1.0.0-next.431_svelte@3.49.0+vite@3.0.4
|
||||
'@types/cookie': 0.5.1
|
||||
'@types/node': 18.6.4
|
||||
'@typescript-eslint/eslint-plugin': 5.32.0_iosr3hrei2tubxveewluhu5lhy
|
||||
|
|
@ -76,6 +76,15 @@ packages:
|
|||
resolution: {integrity: sha512-B1/plF62pt+H2IJHvApK8fdOJAVsvojvacuac8x8s+JIyqbropMyqNqHTKLm3YD8ZFLGwYeFTudU+PQ7vGvBdA==}
|
||||
dev: true
|
||||
|
||||
/@esbuild/linux-loong64/0.14.54:
|
||||
resolution: {integrity: sha512-bZBrLAIX1kpWelV0XemxBZllyRmM6vgFQQG2GdNb+r3Fkp0FOh1NJSvekXDs7jq70k4euu1cryLMfU+mTXlEpw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/@eslint/eslintrc/1.3.0:
|
||||
resolution: {integrity: sha512-UWW0TMTmk2d7hLcWD1/e2g5HDM/HQ3csaLSqXCfqwh4uNDuNqlaKWXmEsL4Cs41Z0KnILNvwbHAah3C2yt06kw==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
|
|
@ -206,6 +215,10 @@ packages:
|
|||
playwright-core: 1.24.2
|
||||
dev: true
|
||||
|
||||
/@polka/url/1.0.0-next.21:
|
||||
resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==}
|
||||
dev: true
|
||||
|
||||
/@rgossiaux/svelte-headlessui/1.0.2_svelte@3.49.0:
|
||||
resolution: {integrity: sha512-sauopYTSivhzXe1kAvgawkhyYJcQlK8Li3p0d2OtcCIVprOzdbard5lbqWB4xHDv83zAobt2mR08oizO2poHLQ==}
|
||||
peerDependencies:
|
||||
|
|
@ -230,12 +243,12 @@ packages:
|
|||
picomatch: 2.3.1
|
||||
dev: true
|
||||
|
||||
/@sveltejs/adapter-auto/1.0.0-next.64:
|
||||
resolution: {integrity: sha512-Q8DwcS6wl1GovzS9JJzaD/WL/Lfk1ur4nAF1HtmsUvZDpsPBVDqnK2AhYU4G3oFNiuHstrjAogMy5th8ptSFGw==}
|
||||
/@sveltejs/adapter-auto/1.0.0-next.65:
|
||||
resolution: {integrity: sha512-wYEcOeuCrswcmeOdmbaq+WxTp7vWN1fG1yPvmdzqe2LoUchOw6FQb6X/fR8miX6L8MXQXJteA0ntqE3FKqaBsw==}
|
||||
dependencies:
|
||||
'@sveltejs/adapter-cloudflare': 1.0.0-next.31
|
||||
'@sveltejs/adapter-netlify': 1.0.0-next.71
|
||||
'@sveltejs/adapter-vercel': 1.0.0-next.66
|
||||
'@sveltejs/adapter-vercel': 1.0.0-next.67
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
- supports-color
|
||||
|
|
@ -245,7 +258,7 @@ packages:
|
|||
resolution: {integrity: sha512-HhEFZP72GJ8AZGgFECKIiayDcLaAWi65pI0AnBfiNhCifYSlH/mPNWNVD4AWRDnXnH6XU+FLwhGDnIDwytTyYg==}
|
||||
dependencies:
|
||||
'@cloudflare/workers-types': 3.14.1
|
||||
esbuild: 0.14.50
|
||||
esbuild: 0.14.54
|
||||
worktop: 0.8.0-next.14
|
||||
dev: true
|
||||
|
||||
|
|
@ -253,23 +266,23 @@ packages:
|
|||
resolution: {integrity: sha512-la1CGtWO1xul1L3zEoFAoc4EX2uxZjrZcOMS3tkKB8drxhbQsNbnTE6fmSSMFiZXhxaikczrBgQwqIaDkLTmZg==}
|
||||
dependencies:
|
||||
'@iarna/toml': 2.2.5
|
||||
esbuild: 0.14.50
|
||||
esbuild: 0.14.54
|
||||
set-cookie-parser: 2.5.1
|
||||
tiny-glob: 0.2.9
|
||||
dev: true
|
||||
|
||||
/@sveltejs/adapter-vercel/1.0.0-next.66:
|
||||
resolution: {integrity: sha512-s3Hcxu9nCG/rR3C3cFbdQGjTa5W4K2kRcc6S5Xefx7itbrw+4v3KpO8ZPB6qM55XDwVxuG7260NMHVI6MUGmSA==}
|
||||
/@sveltejs/adapter-vercel/1.0.0-next.67:
|
||||
resolution: {integrity: sha512-xg85d/vlivbTaZu70zmaPNkrY1YZhDrcxljuwVWO0LCzA4DACIA7CnXI9klUiXM5SPpsB8BhY6dS8sW5cDYWzw==}
|
||||
dependencies:
|
||||
'@vercel/nft': 0.21.0
|
||||
esbuild: 0.14.50
|
||||
esbuild: 0.14.54
|
||||
transitivePeerDependencies:
|
||||
- encoding
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@sveltejs/kit/1.0.0-next.405_svelte@3.49.0+vite@3.0.4:
|
||||
resolution: {integrity: sha512-jHSa74F7k+hC+0fof75g/xm/+1M5sM66Qt6v8eLLMSgjkp36Lb5xOioBhbl6w0NYoE5xysLsBWuu+yHytfvCBA==}
|
||||
/@sveltejs/kit/1.0.0-next.431_svelte@3.49.0+vite@3.0.4:
|
||||
resolution: {integrity: sha512-kK3FCw0cBB/nqjgV8G9W5ctDxemQpkqxidsKVr3aEXSExm4mdM3MYgNf6y2OuvOH9zLD+/t6DAxQQC/RPxuz8Q==}
|
||||
engines: {node: '>=16.9'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
|
|
@ -277,19 +290,27 @@ packages:
|
|||
svelte: ^3.44.0
|
||||
vite: ^3.0.0
|
||||
dependencies:
|
||||
'@sveltejs/vite-plugin-svelte': 1.0.1_svelte@3.49.0+vite@3.0.4
|
||||
chokidar: 3.5.3
|
||||
'@sveltejs/vite-plugin-svelte': 1.0.2_svelte@3.49.0+vite@3.0.4
|
||||
cookie: 0.5.0
|
||||
devalue: 2.0.1
|
||||
kleur: 4.1.5
|
||||
magic-string: 0.26.2
|
||||
mime: 3.0.0
|
||||
node-fetch: 3.2.10
|
||||
sade: 1.8.1
|
||||
set-cookie-parser: 2.5.1
|
||||
sirv: 2.0.2
|
||||
svelte: 3.49.0
|
||||
tiny-glob: 0.2.9
|
||||
undici: 5.10.0
|
||||
vite: 3.0.4_sass@1.54.3
|
||||
transitivePeerDependencies:
|
||||
- diff-match-patch
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@sveltejs/vite-plugin-svelte/1.0.1_svelte@3.49.0+vite@3.0.4:
|
||||
resolution: {integrity: sha512-PorCgUounn0VXcpeJu+hOweZODKmGuLHsLomwqSj+p26IwjjGffmYQfVHtiTWq+NqaUuuHWWG7vPge6UFw4Aeg==}
|
||||
/@sveltejs/vite-plugin-svelte/1.0.2_svelte@3.49.0+vite@3.0.4:
|
||||
resolution: {integrity: sha512-8tTVbNuraeDchBaArNbwaZLpO0feM7BRSdZU5yeM4Clasx2p1p1CYBoWh+VgxZlxiark49HXummkHqKztbl8lA==}
|
||||
engines: {node: ^14.18.0 || >= 16}
|
||||
peerDependencies:
|
||||
diff-match-patch: ^1.0.5
|
||||
|
|
@ -671,7 +692,6 @@ packages:
|
|||
/cookie/0.5.0:
|
||||
resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==}
|
||||
engines: {node: '>= 0.6'}
|
||||
dev: false
|
||||
|
||||
/core-js/3.24.0:
|
||||
resolution: {integrity: sha512-IeOyT8A6iK37Ep4kZDD423mpi6JfPRoPUdQwEWYiGolvn4o6j2diaRzNfDfpTdu3a5qMbrGUzKUpYpRY8jXCkQ==}
|
||||
|
|
@ -687,6 +707,11 @@ packages:
|
|||
which: 2.0.2
|
||||
dev: true
|
||||
|
||||
/data-uri-to-buffer/4.0.0:
|
||||
resolution: {integrity: sha512-Vr3mLBA8qWmcuschSLAOogKgQ/Jwxulv3RNE4FXnYWRGujzrRWQI4m12fQqRkwX06C0KanhLr4hK+GydchZsaA==}
|
||||
engines: {node: '>= 12'}
|
||||
dev: true
|
||||
|
||||
/debug/4.3.4:
|
||||
resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==}
|
||||
engines: {node: '>=6.0'}
|
||||
|
|
@ -722,6 +747,10 @@ packages:
|
|||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/devalue/2.0.1:
|
||||
resolution: {integrity: sha512-I2TiqT5iWBEyB8GRfTDP0hiLZ0YeDJZ+upDxjBfOC2lebO5LezQMv7QvIUTzdb64jQyAKLf1AHADtGN+jw6v8Q==}
|
||||
dev: true
|
||||
|
||||
/dir-glob/3.0.1:
|
||||
resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==}
|
||||
engines: {node: '>=8'}
|
||||
|
|
@ -744,15 +773,6 @@ packages:
|
|||
resolution: {integrity: sha1-oIzd6EzNvzTQJ6FFG8kdS80ophM=}
|
||||
dev: true
|
||||
|
||||
/esbuild-android-64/0.14.50:
|
||||
resolution: {integrity: sha512-H7iUEm7gUJHzidsBlFPGF6FTExazcgXL/46xxLo6i6bMtPim6ZmXyTccS8yOMpy6HAC6dPZ/JCQqrkkin69n6Q==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-android-64/0.14.51:
|
||||
resolution: {integrity: sha512-6FOuKTHnC86dtrKDmdSj2CkcKF8PnqkaIXqvgydqfJmqBazCPdw+relrMlhGjkvVdiiGV70rpdnyFmA65ekBCQ==}
|
||||
engines: {node: '>=12'}
|
||||
|
|
@ -762,10 +782,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-android-arm64/0.14.50:
|
||||
resolution: {integrity: sha512-NFaoqEwa+OYfoYVpQWDMdKII7wZZkAjtJFo1WdnBeCYlYikvUhTnf2aPwPu5qEAw/ie1NYK0yn3cafwP+kP+OQ==}
|
||||
/esbuild-android-64/0.14.54:
|
||||
resolution: {integrity: sha512-Tz2++Aqqz0rJ7kYBfz+iqyE3QMycD4vk7LBRyWaAVFgFtQ/O8EJOnVmTOiDWYZ/uYzB4kvP+bqejYdVKzE5lAQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -780,11 +800,11 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-darwin-64/0.14.50:
|
||||
resolution: {integrity: sha512-gDQsCvGnZiJv9cfdO48QqxkRV8oKAXgR2CGp7TdIpccwFdJMHf8hyIJhMW/05b/HJjET/26Us27Jx91BFfEVSA==}
|
||||
/esbuild-android-arm64/0.14.54:
|
||||
resolution: {integrity: sha512-F9E+/QDi9sSkLaClO8SOV6etqPd+5DgJje1F9lOWoNncDdOBL2YF59IhsWATSt0TLZbYCf3pNlTHvVV5VfHdvg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
|
@ -798,10 +818,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-darwin-arm64/0.14.50:
|
||||
resolution: {integrity: sha512-36nNs5OjKIb/Q50Sgp8+rYW/PqirRiFN0NFc9hEvgPzNJxeJedktXwzfJSln4EcRFRh5Vz4IlqFRScp+aiBBzA==}
|
||||
/esbuild-darwin-64/0.14.54:
|
||||
resolution: {integrity: sha512-jtdKWV3nBviOd5v4hOpkVmpxsBy90CGzebpbO9beiqUYVMBtSc0AL9zGftFuBon7PNDcdvNCEuQqw2x0wP9yug==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -816,11 +836,11 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-freebsd-64/0.14.50:
|
||||
resolution: {integrity: sha512-/1pHHCUem8e/R86/uR+4v5diI2CtBdiWKiqGuPa9b/0x3Nwdh5AOH7lj+8823C6uX1e0ufwkSLkS+aFZiBCWxA==}
|
||||
/esbuild-darwin-arm64/0.14.54:
|
||||
resolution: {integrity: sha512-OPafJHD2oUPyvJMrsCvDGkRrVCar5aVyHfWGQzY1dWnzErjrDuSETxwA2HSsyg2jORLY8yBfzc1MIpUkXlctmw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
|
@ -834,10 +854,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-freebsd-arm64/0.14.50:
|
||||
resolution: {integrity: sha512-iKwUVMQztnPZe5pUYHdMkRc9aSpvoV1mkuHlCoPtxZA3V+Kg/ptpzkcSY+fKd0kuom+l6Rc93k0UPVkP7xoqrw==}
|
||||
/esbuild-freebsd-64/0.14.54:
|
||||
resolution: {integrity: sha512-OKwd4gmwHqOTp4mOGZKe/XUlbDJ4Q9TjX0hMPIDBUWWu/kwhBAudJdBoxnjNf9ocIB6GN6CPowYpR/hRCbSYAg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -852,11 +872,11 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-32/0.14.50:
|
||||
resolution: {integrity: sha512-sWUwvf3uz7dFOpLzYuih+WQ7dRycrBWHCdoXJ4I4XdMxEHCECd8b7a9N9u7FzT6XR2gHPk9EzvchQUtiEMRwqw==}
|
||||
/esbuild-freebsd-arm64/0.14.54:
|
||||
resolution: {integrity: sha512-sFwueGr7OvIFiQT6WeG0jRLjkjdqWWSrfbVwZp8iMP+8UHEHRBvlaxL6IuKNDwAozNUmbb8nIMXa7oAOARGs1Q==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
|
@ -870,10 +890,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-64/0.14.50:
|
||||
resolution: {integrity: sha512-u0PQxPhaeI629t4Y3EEcQ0wmWG+tC/LpP2K7yDFvwuPq0jSQ8SIN+ARNYfRjGW15O2we3XJvklbGV0wRuUCPig==}
|
||||
/esbuild-linux-32/0.14.54:
|
||||
resolution: {integrity: sha512-1ZuY+JDI//WmklKlBgJnglpUL1owm2OX+8E1syCD6UAxcMM/XoWd76OHSjl/0MR0LisSAXDqgjT3uJqT67O3qw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -888,10 +908,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-arm/0.14.50:
|
||||
resolution: {integrity: sha512-VALZq13bhmFJYFE/mLEb+9A0w5vo8z+YDVOWeaf9vOTrSC31RohRIwtxXBnVJ7YKLYfEMzcgFYf+OFln3Y0cWg==}
|
||||
/esbuild-linux-64/0.14.54:
|
||||
resolution: {integrity: sha512-EgjAgH5HwTbtNsTqQOXWApBaPVdDn7XcK+/PtJwZLT1UmpLoznPd8c5CxqsH2dQK3j05YsB3L17T8vE7cp4cCg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -906,10 +926,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-arm64/0.14.50:
|
||||
resolution: {integrity: sha512-ZyfoNgsTftD7Rp5S7La5auomKdNeB3Ck+kSKXC4pp96VnHyYGjHHXWIlcbH8i+efRn9brszo1/Thl1qn8RqmhQ==}
|
||||
/esbuild-linux-arm/0.14.54:
|
||||
resolution: {integrity: sha512-qqz/SjemQhVMTnvcLGoLOdFpCYbz4v4fUo+TfsWG+1aOu70/80RV6bgNpR2JCrppV2moUQkww+6bWxXRL9YMGw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -924,10 +944,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-mips64le/0.14.50:
|
||||
resolution: {integrity: sha512-ygo31Vxn/WrmjKCHkBoutOlFG5yM9J2UhzHb0oWD9O61dGg+Hzjz9hjf5cmM7FBhAzdpOdEWHIrVOg2YAi6rTw==}
|
||||
/esbuild-linux-arm64/0.14.54:
|
||||
resolution: {integrity: sha512-WL71L+0Rwv+Gv/HTmxTEmpv0UgmxYa5ftZILVi2QmZBgX3q7+tDeOQNqGtdXSdsL8TQi1vIaVFHUPDe0O0kdig==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [mips64el]
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -942,10 +962,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-ppc64le/0.14.50:
|
||||
resolution: {integrity: sha512-xWCKU5UaiTUT6Wz/O7GKP9KWdfbsb7vhfgQzRfX4ahh5NZV4ozZ4+SdzYG8WxetsLy84UzLX3Pi++xpVn1OkFQ==}
|
||||
/esbuild-linux-mips64le/0.14.54:
|
||||
resolution: {integrity: sha512-qTHGQB8D1etd0u1+sB6p0ikLKRVuCWhYQhAHRPkO+OF3I/iSlTKNNS0Lh2Oc0g0UFGguaFZZiPJdJey3AGpAlw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ppc64]
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -960,10 +980,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-riscv64/0.14.50:
|
||||
resolution: {integrity: sha512-0+dsneSEihZTopoO9B6Z6K4j3uI7EdxBP7YSF5rTwUgCID+wHD3vM1gGT0m+pjCW+NOacU9kH/WE9N686FHAJg==}
|
||||
/esbuild-linux-ppc64le/0.14.54:
|
||||
resolution: {integrity: sha512-j3OMlzHiqwZBDPRCDFKcx595XVfOfOnv68Ax3U4UKZ3MTYQB5Yz3X1mn5GnodEVYzhtZgxEBidLWeIs8FDSfrQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [riscv64]
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -978,10 +998,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-linux-s390x/0.14.50:
|
||||
resolution: {integrity: sha512-tVjqcu8o0P9H4StwbIhL1sQYm5mWATlodKB6dpEZFkcyTI8kfIGWiWcrGmkNGH2i1kBUOsdlBafPxR3nzp3TDA==}
|
||||
/esbuild-linux-riscv64/0.14.54:
|
||||
resolution: {integrity: sha512-y7Vt7Wl9dkOGZjxQZnDAqqn+XOqFD7IMWiewY5SPlNlzMX39ocPQlOaoxvT4FllA5viyV26/QzHtvTjVNOxHZg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [s390x]
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -996,11 +1016,11 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-netbsd-64/0.14.50:
|
||||
resolution: {integrity: sha512-0R/glfqAQ2q6MHDf7YJw/TulibugjizBxyPvZIcorH0Mb7vSimdHy0XF5uCba5CKt+r4wjax1mvO9lZ4jiAhEg==}
|
||||
/esbuild-linux-s390x/0.14.54:
|
||||
resolution: {integrity: sha512-zaHpW9dziAsi7lRcyV4r8dhfG1qBidQWUXweUjnw+lliChJqQr+6XD71K41oEIC3Mx1KStovEmlzm+MkGZHnHA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
|
@ -1014,11 +1034,11 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-openbsd-64/0.14.50:
|
||||
resolution: {integrity: sha512-7PAtmrR5mDOFubXIkuxYQ4bdNS6XCK8AIIHUiZxq1kL8cFIH5731jPcXQ4JNy/wbj1C9sZ8rzD8BIM80Tqk29w==}
|
||||
/esbuild-netbsd-64/0.14.54:
|
||||
resolution: {integrity: sha512-PR01lmIMnfJTgeU9VJTDY9ZerDWVFIUzAtJuDHwwceppW7cQWjBBqP48NdeRtoP04/AtO9a7w3viI+PIDr6d+w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
os: [netbsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
|
@ -1032,11 +1052,11 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-sunos-64/0.14.50:
|
||||
resolution: {integrity: sha512-gBxNY/wyptvD7PkHIYcq7se6SQEXcSC8Y7mE0FJB+CGgssEWf6vBPfTTZ2b6BWKnmaP6P6qb7s/KRIV5T2PxsQ==}
|
||||
/esbuild-openbsd-64/0.14.54:
|
||||
resolution: {integrity: sha512-Qyk7ikT2o7Wu76UsvvDS5q0amJvmRzDyVlL0qf5VLsLchjCa1+IAvd8kTBgUxD7VBUUVgItLkk609ZHUc1oCaw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
os: [openbsd]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
|
@ -1050,11 +1070,11 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-windows-32/0.14.50:
|
||||
resolution: {integrity: sha512-MOOe6J9cqe/iW1qbIVYSAqzJFh0p2LBLhVUIWdMVnNUNjvg2/4QNX4oT4IzgDeldU+Bym9/Tn6+DxvUHJXL5Zw==}
|
||||
/esbuild-sunos-64/0.14.54:
|
||||
resolution: {integrity: sha512-28GZ24KmMSeKi5ueWzMcco6EBHStL3B6ubM7M51RmPwXQGLe0teBGJocmWhgwccA1GeFXqxzILIxXpHbl9Q/Kw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
optional: true
|
||||
|
|
@ -1068,10 +1088,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-windows-64/0.14.50:
|
||||
resolution: {integrity: sha512-r/qE5Ex3w1jjGv/JlpPoWB365ldkppUlnizhMxJgojp907ZF1PgLTuW207kgzZcSCXyquL9qJkMsY+MRtaZ5yQ==}
|
||||
/esbuild-windows-32/0.14.54:
|
||||
resolution: {integrity: sha512-T+rdZW19ql9MjS7pixmZYVObd9G7kcaZo+sETqNH4RCkuuYSuv9AGHUVnPoP9hhuE1WM1ZimHz1CIBHBboLU7w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -1086,10 +1106,10 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild-windows-arm64/0.14.50:
|
||||
resolution: {integrity: sha512-EMS4lQnsIe12ZyAinOINx7eq2mjpDdhGZZWDwPZE/yUTN9cnc2Ze/xUTYIAyaJqrqQda3LnDpADKpvLvol6ENQ==}
|
||||
/esbuild-windows-64/0.14.54:
|
||||
resolution: {integrity: sha512-AoHTRBUuYwXtZhjXZbA1pGfTo8cJo3vZIcWGLiUcTNgHpJJMC1rVA44ZereBHMJtotyN71S8Qw0npiCIkW96cQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
dev: true
|
||||
|
|
@ -1104,33 +1124,14 @@ packages:
|
|||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild/0.14.50:
|
||||
resolution: {integrity: sha512-SbC3k35Ih2IC6trhbMYW7hYeGdjPKf9atTKwBUHqMCYFZZ9z8zhuvfnZihsnJypl74FjiAKjBRqFkBkAd0rS/w==}
|
||||
/esbuild-windows-arm64/0.14.54:
|
||||
resolution: {integrity: sha512-M0kuUvXhot1zOISQGXwWn6YtS+Y/1RT9WrVIOywZnJHo3jCDyewAc79aKNQWFCQm+xNHVTq9h8dZKvygoXQQRg==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
requiresBuild: true
|
||||
optionalDependencies:
|
||||
esbuild-android-64: 0.14.50
|
||||
esbuild-android-arm64: 0.14.50
|
||||
esbuild-darwin-64: 0.14.50
|
||||
esbuild-darwin-arm64: 0.14.50
|
||||
esbuild-freebsd-64: 0.14.50
|
||||
esbuild-freebsd-arm64: 0.14.50
|
||||
esbuild-linux-32: 0.14.50
|
||||
esbuild-linux-64: 0.14.50
|
||||
esbuild-linux-arm: 0.14.50
|
||||
esbuild-linux-arm64: 0.14.50
|
||||
esbuild-linux-mips64le: 0.14.50
|
||||
esbuild-linux-ppc64le: 0.14.50
|
||||
esbuild-linux-riscv64: 0.14.50
|
||||
esbuild-linux-s390x: 0.14.50
|
||||
esbuild-netbsd-64: 0.14.50
|
||||
esbuild-openbsd-64: 0.14.50
|
||||
esbuild-sunos-64: 0.14.50
|
||||
esbuild-windows-32: 0.14.50
|
||||
esbuild-windows-64: 0.14.50
|
||||
esbuild-windows-arm64: 0.14.50
|
||||
dev: true
|
||||
optional: true
|
||||
|
||||
/esbuild/0.14.51:
|
||||
resolution: {integrity: sha512-+CvnDitD7Q5sT7F+FM65sWkF8wJRf+j9fPcprxYV4j+ohmzVj2W7caUqH2s5kCaCJAfcAICjSlKhDCcvDpU7nw==}
|
||||
|
|
@ -1160,6 +1161,35 @@ packages:
|
|||
esbuild-windows-arm64: 0.14.51
|
||||
dev: true
|
||||
|
||||
/esbuild/0.14.54:
|
||||
resolution: {integrity: sha512-Cy9llcy8DvET5uznocPyqL3BFRrFXSVqbgpMJ9Wz8oVjZlh/zUSNbPRbov0VX7VxN2JH1Oa0uNxZ7eLRb62pJA==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
requiresBuild: true
|
||||
optionalDependencies:
|
||||
'@esbuild/linux-loong64': 0.14.54
|
||||
esbuild-android-64: 0.14.54
|
||||
esbuild-android-arm64: 0.14.54
|
||||
esbuild-darwin-64: 0.14.54
|
||||
esbuild-darwin-arm64: 0.14.54
|
||||
esbuild-freebsd-64: 0.14.54
|
||||
esbuild-freebsd-arm64: 0.14.54
|
||||
esbuild-linux-32: 0.14.54
|
||||
esbuild-linux-64: 0.14.54
|
||||
esbuild-linux-arm: 0.14.54
|
||||
esbuild-linux-arm64: 0.14.54
|
||||
esbuild-linux-mips64le: 0.14.54
|
||||
esbuild-linux-ppc64le: 0.14.54
|
||||
esbuild-linux-riscv64: 0.14.54
|
||||
esbuild-linux-s390x: 0.14.54
|
||||
esbuild-netbsd-64: 0.14.54
|
||||
esbuild-openbsd-64: 0.14.54
|
||||
esbuild-sunos-64: 0.14.54
|
||||
esbuild-windows-32: 0.14.54
|
||||
esbuild-windows-64: 0.14.54
|
||||
esbuild-windows-arm64: 0.14.54
|
||||
dev: true
|
||||
|
||||
/escape-string-regexp/4.0.0:
|
||||
resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==}
|
||||
engines: {node: '>=10'}
|
||||
|
|
@ -1350,6 +1380,14 @@ packages:
|
|||
core-js: 3.24.0
|
||||
dev: false
|
||||
|
||||
/fetch-blob/3.2.0:
|
||||
resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==}
|
||||
engines: {node: ^12.20 || >= 14.13}
|
||||
dependencies:
|
||||
node-domexception: 1.0.0
|
||||
web-streams-polyfill: 3.2.1
|
||||
dev: true
|
||||
|
||||
/file-entry-cache/6.0.1:
|
||||
resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==}
|
||||
engines: {node: ^10.12.0 || >=12.0.0}
|
||||
|
|
@ -1392,6 +1430,13 @@ packages:
|
|||
resolution: {integrity: sha512-0sQoMh9s0BYsm+12Huy/rkKxVu4R1+r96YX5cG44rHV0pQ6iC3Q+mkoMFaGWObMFYQxCVT+ssG1ksneA2MI9KQ==}
|
||||
dev: true
|
||||
|
||||
/formdata-polyfill/4.0.10:
|
||||
resolution: {integrity: sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==}
|
||||
engines: {node: '>=12.20.0'}
|
||||
dependencies:
|
||||
fetch-blob: 3.2.0
|
||||
dev: true
|
||||
|
||||
/fs-minipass/2.1.0:
|
||||
resolution: {integrity: sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==}
|
||||
engines: {node: '>= 8'}
|
||||
|
|
@ -1679,6 +1724,12 @@ packages:
|
|||
picomatch: 2.3.1
|
||||
dev: true
|
||||
|
||||
/mime/3.0.0:
|
||||
resolution: {integrity: sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/min-indent/1.0.1:
|
||||
resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==}
|
||||
engines: {node: '>=4'}
|
||||
|
|
@ -1746,6 +1797,11 @@ packages:
|
|||
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
|
||||
dev: true
|
||||
|
||||
/node-domexception/1.0.0:
|
||||
resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==}
|
||||
engines: {node: '>=10.5.0'}
|
||||
dev: true
|
||||
|
||||
/node-fetch/2.6.7:
|
||||
resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==}
|
||||
engines: {node: 4.x || >=6.0.0}
|
||||
|
|
@ -1758,6 +1814,15 @@ packages:
|
|||
whatwg-url: 5.0.0
|
||||
dev: true
|
||||
|
||||
/node-fetch/3.2.10:
|
||||
resolution: {integrity: sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==}
|
||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||
dependencies:
|
||||
data-uri-to-buffer: 4.0.0
|
||||
fetch-blob: 3.2.0
|
||||
formdata-polyfill: 4.0.10
|
||||
dev: true
|
||||
|
||||
/node-gyp-build/4.5.0:
|
||||
resolution: {integrity: sha512-2iGbaQBV+ITgCz76ZEjmhUKAKVf7xfY1sRl4UiKQspfZMH2h06SyhNsnSVy50cwkFQDGLyif6m/6uFXHkOZ6rg==}
|
||||
hasBin: true
|
||||
|
|
@ -2058,6 +2123,15 @@ packages:
|
|||
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
|
||||
dev: true
|
||||
|
||||
/sirv/2.0.2:
|
||||
resolution: {integrity: sha512-4Qog6aE29nIjAOKe/wowFTxOdmbEZKb+3tsLljaBRzJwtqto0BChD2zzH0LhgCSXiI+V7X+Y45v14wBZQ1TK3w==}
|
||||
engines: {node: '>= 10'}
|
||||
dependencies:
|
||||
'@polka/url': 1.0.0-next.21
|
||||
mrmime: 1.0.1
|
||||
totalist: 3.0.0
|
||||
dev: true
|
||||
|
||||
/slash/3.0.0:
|
||||
resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==}
|
||||
engines: {node: '>=8'}
|
||||
|
|
@ -2252,6 +2326,11 @@ packages:
|
|||
is-number: 7.0.0
|
||||
dev: true
|
||||
|
||||
/totalist/3.0.0:
|
||||
resolution: {integrity: sha512-eM+pCBxXO/njtF7vdFsHuqb+ElbxqtI4r5EAvk6grfAFyJ6IvWlSkfZ5T9ozC6xWw3Fj1fGoSmrl0gUs46JVIw==}
|
||||
engines: {node: '>=6'}
|
||||
dev: true
|
||||
|
||||
/tr46/0.0.3:
|
||||
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
|
||||
dev: true
|
||||
|
|
@ -2292,6 +2371,11 @@ packages:
|
|||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/undici/5.10.0:
|
||||
resolution: {integrity: sha512-c8HsD3IbwmjjbLvoZuRI26TZic+TSEe8FPMLLOkN1AfYRhdjnKBU6yL+IwcSCbdZiX4e5t0lfMDLDCqj4Sq70g==}
|
||||
engines: {node: '>=12.18'}
|
||||
dev: true
|
||||
|
||||
/uri-js/4.4.1:
|
||||
resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==}
|
||||
dependencies:
|
||||
|
|
@ -2334,6 +2418,11 @@ packages:
|
|||
fsevents: 2.3.2
|
||||
dev: true
|
||||
|
||||
/web-streams-polyfill/3.2.1:
|
||||
resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==}
|
||||
engines: {node: '>= 8'}
|
||||
dev: true
|
||||
|
||||
/webidl-conversions/3.0.1:
|
||||
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
|
||||
dev: true
|
||||
|
|
|
|||
|
|
@ -1,16 +1,15 @@
|
|||
import cookie from 'cookie';
|
||||
import { v4 as uuid } from '@lukeed/uuid';
|
||||
import type { Handle } from '@sveltejs/kit';
|
||||
import * as cookie from 'cookie';
|
||||
|
||||
export const handle: Handle = async ({ event, resolve }) => {
|
||||
const cookies = cookie.parse(event.request.headers.get('cookie') || '');
|
||||
event.locals.userid = cookies.userid || uuid();
|
||||
event.locals.userid = cookies['userid'] || crypto.randomUUID();
|
||||
|
||||
const response = await resolve(event);
|
||||
|
||||
if (!cookies.userid) {
|
||||
if (!cookies['userid']) {
|
||||
// if this is the first time the user has visited this app,
|
||||
// set a cookie so that we recognize them when they return
|
||||
// set a cookie so that we recognise them when they return
|
||||
response.headers.set(
|
||||
'set-cookie',
|
||||
cookie.serialize('userid', event.locals.userid, {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@
|
|||
import { collectionStore } from '$lib/stores/collectionStore';
|
||||
import { addToCollection, removeFromCollection } from '$lib/util/manipulateCollection';
|
||||
|
||||
export let game: GameType;
|
||||
export let game: GameType | SavedGameType;
|
||||
export let minimal: boolean = false;
|
||||
export let detailed: boolean = false;
|
||||
$: existsInCollection = $collectionStore.find((item: SavedGameType) => item.id === game.id);
|
||||
</script>
|
||||
|
|
@ -18,32 +19,38 @@
|
|||
</a>
|
||||
</div>
|
||||
|
||||
<div class="game-details">
|
||||
<p>{game.year_published}</p>
|
||||
<p>{game.players} {game.max_players === 1 ? 'player' : 'players'}</p>
|
||||
<p>{game.playtime} minutes</p>
|
||||
<p>Minimum Age: {game.min_age}</p>
|
||||
<a href={`/game/${game.id}`}>View Game</a>
|
||||
{#if detailed}
|
||||
<div class="description">{@html game.description}</div>
|
||||
{/if}
|
||||
</div>
|
||||
{#if !minimal}
|
||||
<div class="game-details">
|
||||
<p>{game.year_published}</p>
|
||||
<p>{game.players} {game.max_players === 1 ? 'player' : 'players'}</p>
|
||||
<p>{game.playtime} minutes</p>
|
||||
<p>Minimum Age: {game.min_age}</p>
|
||||
<a href={`/game/${game.id}`}>View Game</a>
|
||||
{#if detailed}
|
||||
<div class="description">{@html game.description}</div>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
{#if existsInCollection}
|
||||
<button aria-label="Remove from collection" class="btn" type="button" on:click={() => removeFromCollection(game)}
|
||||
<button
|
||||
aria-label="Remove from collection"
|
||||
class="btn"
|
||||
type="button"
|
||||
on:click={() => removeFromCollection(game)}
|
||||
>Remove <MinusCircleIcon width="24" height="24" /></button
|
||||
>
|
||||
{:else}
|
||||
<button aria-label="Add to collection" class="btn" type="button" on:click={() => addToCollection(game)}
|
||||
<button
|
||||
aria-label="Add to collection"
|
||||
class="btn"
|
||||
type="button"
|
||||
on:click={() => addToCollection(game)}
|
||||
>Add to collection <PlusCircleIcon width="24" height="24" /></button
|
||||
>
|
||||
{/if}
|
||||
</article>
|
||||
|
||||
<style lang="scss">
|
||||
h2 .thumbnail {
|
||||
align-self: start;
|
||||
}
|
||||
|
||||
img {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
|
@ -67,11 +74,11 @@
|
|||
.game-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
|
||||
@media (max-width: 650px) {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
|
||||
gap: var(--spacing-16);
|
||||
padding: var(--spacing-16) var(--spacing-16);
|
||||
transition: all 0.3s;
|
||||
|
|
|
|||
|
|
@ -1,22 +1,18 @@
|
|||
<script lang="ts">
|
||||
import { page } from '$app/stores';
|
||||
import Themes from '$lib/components/preferences/themes.svelte';
|
||||
import Profile from '../preferences/profile.svelte';
|
||||
import logo from './bored-game.png';
|
||||
|
||||
// let theme: CarbonTheme = "white";
|
||||
</script>
|
||||
|
||||
<header>
|
||||
<div class="corner">
|
||||
<a href="/">
|
||||
<a href="/" title="Home">
|
||||
<img src={logo} alt="Bored Game Home" />
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<nav>
|
||||
<!-- <div><Themes /></div> -->
|
||||
<div><Profile /></div>
|
||||
<a href="/collection" title="Go to your collection">Your Collection</a>
|
||||
<Profile />
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
|
|
@ -56,50 +52,11 @@
|
|||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 2rem;
|
||||
margin: 1rem;
|
||||
--background: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
svg {
|
||||
width: 2em;
|
||||
height: 3em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
path {
|
||||
fill: var(--background);
|
||||
}
|
||||
|
||||
ul {
|
||||
position: relative;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
height: 3em;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
list-style: none;
|
||||
background: var(--background);
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
li {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
li.active::before {
|
||||
--size: 6px;
|
||||
content: '';
|
||||
width: 0;
|
||||
height: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: calc(50% - var(--size));
|
||||
border: var(--size) solid transparent;
|
||||
border-top: var(--size) solid var(--accent-color);
|
||||
}
|
||||
|
||||
nav a {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
|
|
@ -107,7 +64,7 @@
|
|||
padding: 0 1em;
|
||||
color: var(--heading-color);
|
||||
font-weight: 700;
|
||||
font-size: 0.8rem;
|
||||
/* font-size: 0.8rem; */
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.1em;
|
||||
text-decoration: none;
|
||||
|
|
@ -115,6 +72,7 @@
|
|||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
color: var(--accent-color);
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,23 +1,6 @@
|
|||
<script lang="ts">
|
||||
import { browser } from '$app/env';
|
||||
import { collectionStore } from '$root/lib/stores/collectionStore';
|
||||
import { ToastType } from '$root/lib/types';
|
||||
import { SaveIcon, TrashIcon } from '@rgossiaux/svelte-heroicons/outline';
|
||||
import { toast } from '../toast/toast';
|
||||
|
||||
function saveCollection() {
|
||||
console.log('Saving collection');
|
||||
console.log('collectionStore', $collectionStore);
|
||||
if (!browser) return;
|
||||
localStorage.collection = JSON.stringify($collectionStore);
|
||||
toast.send('Saved collection', { duration: 3000, type: ToastType.INFO });
|
||||
}
|
||||
|
||||
function clearCollection() {
|
||||
if (!browser) return;
|
||||
localStorage.collection = [];
|
||||
toast.send('Cleared collection', { duration: 3000, type: ToastType.INFO });
|
||||
}
|
||||
import { clearCollection, saveCollection } from '$root/lib/util/manipulateCollection';
|
||||
</script>
|
||||
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -50,11 +50,6 @@
|
|||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.panel-contents {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
|
|
|
|||
|
|
@ -1,24 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { boredState } from '$lib/stores/boredState';
|
||||
import { gameStore } from '$lib/stores/gameSearchStore';
|
||||
|
||||
// async function handleSubmit(event: SubmitEvent) {
|
||||
// // submitting = true;
|
||||
// boredState.set({ loading: true });
|
||||
// const form = event.target as HTMLFormElement;
|
||||
// console.log('form', form);
|
||||
// const response = await fetch('/api/games', {
|
||||
// method: 'POST',
|
||||
// headers: { accept: 'application/json' },
|
||||
// body: new FormData(form)
|
||||
// });
|
||||
// const responseData = await response.json();
|
||||
// // submitting = false;
|
||||
// boredState.set({ loading: false });
|
||||
// gameStore.removeAll();
|
||||
// gameStore.addAll(responseData?.games);
|
||||
// // games = responseData?.games;
|
||||
// }
|
||||
|
||||
let submitting = $boredState?.loading;
|
||||
let minAge = 1;
|
||||
|
|
@ -85,14 +66,6 @@
|
|||
|
||||
<!-- </form> -->
|
||||
<style lang="scss">
|
||||
button {
|
||||
border-radius: 10px;
|
||||
margin: 0.5rem;
|
||||
padding: 1rem;
|
||||
color: var(--clr-input-txt);
|
||||
background-color: var(--color-btn-primary-active);
|
||||
}
|
||||
|
||||
fieldset {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
|
|
|
|||
|
|
@ -1,18 +1,12 @@
|
|||
<script lang="ts">
|
||||
import { fade } from "svelte/transition";
|
||||
import {
|
||||
Disclosure,
|
||||
DisclosureButton,
|
||||
DisclosurePanel,
|
||||
} from "@rgossiaux/svelte-headlessui";
|
||||
import { ChevronRightIcon } from "@rgossiaux/svelte-heroicons/solid";
|
||||
import { fade } from 'svelte/transition';
|
||||
import { Disclosure, DisclosureButton, DisclosurePanel } from '@rgossiaux/svelte-headlessui';
|
||||
import { ChevronRightIcon } from '@rgossiaux/svelte-heroicons/solid';
|
||||
import { boredState } from '$lib/stores/boredState';
|
||||
import { gameStore } from '$lib/stores/gameSearchStore';
|
||||
import AdvancedSearch from '$lib/components/search/advancedSearch/index.svelte';
|
||||
|
||||
export let showButton: boolean = false;
|
||||
export let advancedSearch: boolean = false;
|
||||
console.log('showButton', showButton);
|
||||
|
||||
let submitting = $boredState?.loading;
|
||||
let name = '';
|
||||
|
|
@ -37,7 +31,12 @@
|
|||
<Disclosure let:open>
|
||||
<DisclosureButton class="disclosure-button">
|
||||
<span>Advanced Search?</span>
|
||||
<ChevronRightIcon class="icon disclosure-icon" style={open ? "transform: rotate(90deg); transition: transform 0.5s ease;" : "transform: rotate(0deg); transition: transform 0.5s ease;"} />
|
||||
<ChevronRightIcon
|
||||
class="icon disclosure-icon"
|
||||
style={open
|
||||
? 'transform: rotate(90deg); transition: transform 0.5s ease;'
|
||||
: 'transform: rotate(0deg); transition: transform 0.5s ease;'}
|
||||
/>
|
||||
</DisclosureButton>
|
||||
|
||||
{#if open}
|
||||
|
|
@ -56,7 +55,6 @@
|
|||
<button class="btn" type="submit" disabled={submitting}>Submit</button>
|
||||
{/if}
|
||||
|
||||
|
||||
<!-- </form> -->
|
||||
<style lang="scss">
|
||||
.search {
|
||||
|
|
@ -70,9 +68,6 @@
|
|||
place-items: center;
|
||||
}
|
||||
|
||||
h1 {
|
||||
width: 100%;
|
||||
}
|
||||
button {
|
||||
padding: 1rem;
|
||||
margin: 1.5rem 0;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
{#if transition.type === 'stagger'}
|
||||
<div
|
||||
class="stagger"
|
||||
style:animation-duration="{transition.duration * 300}ms"
|
||||
style:animation-duration="{transition.duration || 1 * 300}ms"
|
||||
style:animation-delay="{transition.delay}ms"
|
||||
>
|
||||
<slot />
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ export type ToastData = {
|
|||
export type SavedGameType = {
|
||||
id: string;
|
||||
name: string;
|
||||
thumb_url: string;
|
||||
}
|
||||
|
||||
export type GameType = {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
import { collectionStore } from '$lib/stores/collectionStore';
|
||||
import { toast } from '$lib/components/toast/toast';
|
||||
import { ToastType, type GameType, type SavedGameType } from '$lib/types';
|
||||
import { browser } from '$app/env';
|
||||
|
||||
function convertToSavedGame(game: GameType): SavedGameType {
|
||||
return {
|
||||
id: game.id,
|
||||
name: game.name,
|
||||
thumb_url: game.thumb_url,
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -18,3 +20,17 @@ export function removeFromCollection(game: GameType) {
|
|||
collectionStore.remove(game.id);
|
||||
toast.send("Removed from collection", { duration: 3000, type: ToastType.INFO });
|
||||
}
|
||||
|
||||
export function saveCollection() {
|
||||
console.log('Saving collection');
|
||||
console.log('collectionStore', collectionStore);
|
||||
if (!browser) return;
|
||||
localStorage.collection = JSON.stringify(collectionStore);
|
||||
toast.send('Saved collection', { duration: 3000, type: ToastType.INFO });
|
||||
}
|
||||
|
||||
export function clearCollection() {
|
||||
if (!browser) return;
|
||||
localStorage.collection = [];
|
||||
toast.send('Cleared collection', { duration: 3000, type: ToastType.INFO });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { boardGameApi } from './_api';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
import { boardGameApi } from './api';
|
||||
import { error, type Action } from '@sveltejs/kit';
|
||||
|
||||
export const POST: RequestHandler = async ({ request, locals }) => {
|
||||
export const POST: Action = async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
const minAge = form.get('minAge') || 0;
|
||||
console.log('minAge', minAge);
|
||||
|
|
@ -26,10 +26,9 @@ export const POST: RequestHandler = async ({ request, locals }) => {
|
|||
if (response.status === 404) {
|
||||
// user hasn't created a todo list.
|
||||
// start with an empty array
|
||||
// throw new Error("@migration task: Migrate this return statement (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292699)");
|
||||
return {
|
||||
body: {
|
||||
games: []
|
||||
}
|
||||
games: []
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -37,14 +36,15 @@ export const POST: RequestHandler = async ({ request, locals }) => {
|
|||
const gameResponse = await response.json();
|
||||
const games = gameResponse?.games;
|
||||
console.log('games', games);
|
||||
// throw new Error("@migration task: Migrate this return statement (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292699)");
|
||||
return {
|
||||
body: {
|
||||
games: gameResponse?.games
|
||||
}
|
||||
games: gameResponse?.games
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
status: response.status
|
||||
};
|
||||
// throw new Error("@migration task: Migrate this return statement (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292699)");
|
||||
// return {
|
||||
// status: response.status
|
||||
// };
|
||||
throw error(response.status);
|
||||
};
|
||||
|
|
@ -49,41 +49,6 @@
|
|||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
.loading {
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
z-index: 101;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
gap: 1rem;
|
||||
|
||||
h3 {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.background {
|
||||
background: black;
|
||||
opacity: 0.8;
|
||||
cursor: none;
|
||||
inset: 0;
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
h1 {
|
||||
width: 100%;
|
||||
}
|
||||
button {
|
||||
border-radius: 10px;
|
||||
margin: 0.5rem;
|
||||
padding: 1rem;
|
||||
color: var(--clr-input-txt);
|
||||
background-color: var(--color-btn-primary-active);
|
||||
}
|
||||
|
||||
.games {
|
||||
margin: 2rem 0rem;
|
||||
|
||||
|
|
@ -105,22 +70,6 @@
|
|||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
.game-search {
|
||||
border-radius: 4px;
|
||||
box-shadow: var(--level-2);
|
||||
background: rgba(0, 0, 0, 0.02);
|
||||
border: 2px solid var(--clr-primary);
|
||||
padding: 20px;
|
||||
|
||||
fieldset {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
label {
|
||||
display: grid;
|
||||
margin: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.random-buttons {
|
||||
display: flex;
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
<script context="module">
|
||||
import { browser, dev } from '$app/env';
|
||||
|
||||
// we don't need any JS on this page, though we'll load
|
||||
// it in dev so that we get hot module replacement...
|
||||
export const hydrate = dev;
|
||||
|
||||
// ...but if the client-side router is already loaded
|
||||
// (i.e. we came here from elsewhere in the app), use it
|
||||
export const router = browser;
|
||||
|
||||
// since there's no dynamic data here, we can prerender
|
||||
// it so that it gets served as a static asset in prod
|
||||
export const prerender = true;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>About</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class="content">
|
||||
<h1>About this app</h1>
|
||||
|
||||
<p>
|
||||
This is a <a href="https://kit.svelte.dev">SvelteKit</a> app. You can make your own by typing the
|
||||
following into your command line and following the prompts:
|
||||
</p>
|
||||
|
||||
<!-- TODO lose the @next! -->
|
||||
<pre>npm init svelte@next</pre>
|
||||
|
||||
<p>
|
||||
The page you're looking at is purely static HTML, with no client-side interactivity needed.
|
||||
Because of that, we don't need to load any JavaScript. Try viewing the page's source, or opening
|
||||
the devtools network panel and reloading.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <a href="/todos">TODOs</a> page illustrates SvelteKit's data loading and form handling. Try using
|
||||
it with JavaScript disabled!
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.content {
|
||||
width: 100%;
|
||||
max-width: var(--column-width);
|
||||
margin: var(--column-margin-top) auto 0 auto;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -19,6 +19,7 @@ export function boardGameApi(
|
|||
queryParams: Record<string, string>,
|
||||
data?: Record<string, unknown>
|
||||
) {
|
||||
console.log('queryParams', queryParams);
|
||||
queryParams.client_id = import.meta.env.VITE_PUBLIC_CLIENT_ID;
|
||||
const urlQueryParams = new URLSearchParams(queryParams);
|
||||
const url = `${base}/${resource}${urlQueryParams ? `?${urlQueryParams}` : ''}`;
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
import { json as json$1 } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
import type { GameType, SearchQuery } from '$lib/types';
|
||||
import { mapAPIGameToBoredGame } from '$lib/util/gameMapper';
|
||||
|
|
@ -25,9 +26,8 @@ export const POST: RequestHandler = async ({ request }) => {
|
|||
|
||||
const urlQueryParams = new URLSearchParams(newQueryParams);
|
||||
|
||||
const url = `https://api.boardgameatlas.com/api/search${
|
||||
urlQueryParams ? `?${urlQueryParams}` : ''
|
||||
}`;
|
||||
const url = `https://api.boardgameatlas.com/api/search${urlQueryParams ? `?${urlQueryParams}` : ''
|
||||
}`;
|
||||
const response = await fetch(url, {
|
||||
method: 'get',
|
||||
headers: {
|
||||
|
|
@ -38,11 +38,9 @@ export const POST: RequestHandler = async ({ request }) => {
|
|||
if (response.status === 404) {
|
||||
// user hasn't created a todo list.
|
||||
// start with an empty array
|
||||
return {
|
||||
body: {
|
||||
games: []
|
||||
}
|
||||
};
|
||||
return json$1({
|
||||
games: []
|
||||
});
|
||||
}
|
||||
|
||||
if (response.status === 200) {
|
||||
|
|
@ -52,14 +50,11 @@ export const POST: RequestHandler = async ({ request }) => {
|
|||
gameList.forEach((game) => {
|
||||
games.push(mapAPIGameToBoredGame(game));
|
||||
});
|
||||
return {
|
||||
body: {
|
||||
games
|
||||
}
|
||||
};
|
||||
|
||||
return json$1({
|
||||
games
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
status: response.status
|
||||
};
|
||||
return new Response(undefined, { status: response.status });
|
||||
};
|
||||
|
|
@ -1,19 +1,17 @@
|
|||
import { json as json$1 } from '@sveltejs/kit';
|
||||
import { boardGameApi } from '$root/routes/api';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
import { boardGameApi } from '../_api';
|
||||
|
||||
export const GET: RequestHandler = async ({ params }) => {
|
||||
// console.log('params', params);
|
||||
const queryParams = {
|
||||
ids: `${params?.id}`
|
||||
};
|
||||
console.log('queryParams', queryParams);
|
||||
const response = await boardGameApi('get', `search`, queryParams);
|
||||
if (response.status === 404) {
|
||||
return {
|
||||
body: {
|
||||
games: []
|
||||
}
|
||||
};
|
||||
return json$1({
|
||||
games: []
|
||||
});
|
||||
}
|
||||
|
||||
if (response.status === 200) {
|
||||
|
|
@ -21,14 +19,10 @@ export const GET: RequestHandler = async ({ params }) => {
|
|||
// console.log('gameResponse', gameResponse);
|
||||
// const games = gameResponse?.games;
|
||||
console.log('game', gameResponse?.games[0]);
|
||||
return {
|
||||
body: {
|
||||
game: gameResponse?.games[0]
|
||||
}
|
||||
};
|
||||
return json$1({
|
||||
game: gameResponse?.games[0]
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
status: response.status
|
||||
};
|
||||
return new Response(undefined, { status: response.status });
|
||||
};
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
import { boardGameApi } from '$root/routes/_api';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
|
||||
export const GET: RequestHandler = async ({ params }) => {
|
||||
const queryParams = {
|
||||
ids: `${params?.id}`
|
||||
};
|
||||
console.log('queryParams', queryParams);
|
||||
const response = await boardGameApi('get', `search`, queryParams);
|
||||
if (response.status === 404) {
|
||||
return {
|
||||
body: {
|
||||
games: []
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (response.status === 200) {
|
||||
const gameResponse = await response.json();
|
||||
// console.log('gameResponse', gameResponse);
|
||||
// const games = gameResponse?.games;
|
||||
console.log('game', gameResponse?.games[0]);
|
||||
return {
|
||||
body: {
|
||||
game: gameResponse?.games[0]
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
status: response.status
|
||||
};
|
||||
};
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
import { json as json$1 } from '@sveltejs/kit';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
import type { GameType, SearchQuery } from '$lib/types';
|
||||
import { mapAPIGameToBoredGame } from '$lib/util/gameMapper';
|
||||
|
|
@ -77,11 +78,9 @@ export const POST: RequestHandler = async ({ request }) => {
|
|||
if (response.status === 404) {
|
||||
// user hasn't created a todo list.
|
||||
// start with an empty array
|
||||
return {
|
||||
body: {
|
||||
games: []
|
||||
}
|
||||
};
|
||||
return json$1({
|
||||
games: []
|
||||
});
|
||||
}
|
||||
|
||||
if (response.status === 200) {
|
||||
|
|
@ -92,14 +91,10 @@ export const POST: RequestHandler = async ({ request }) => {
|
|||
games.push(mapAPIGameToBoredGame(game));
|
||||
});
|
||||
console.log('games', games);
|
||||
return {
|
||||
body: {
|
||||
games
|
||||
}
|
||||
};
|
||||
return json$1({
|
||||
games
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
status: response.status
|
||||
};
|
||||
return new Response(undefined, { status: response.status });
|
||||
};
|
||||
42
src/routes/collection/+page.svelte
Normal file
42
src/routes/collection/+page.svelte
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<script lang="ts">
|
||||
import Game from '$lib/components/game/index.svelte';
|
||||
import { collectionStore } from '$lib/stores/collectionStore';
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Your Collection | Bored Game</title>
|
||||
</svelte:head>
|
||||
|
||||
<h1>Your Collection</h1>
|
||||
|
||||
<div class="games">
|
||||
<div class="games-list">
|
||||
{#each $collectionStore as game}
|
||||
<Game minimal {game} />
|
||||
{/each}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
h1 {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.games {
|
||||
margin: 2rem 0rem;
|
||||
}
|
||||
|
||||
.games-list {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, minmax(200px, 1fr));
|
||||
gap: 2rem;
|
||||
|
||||
@media (max-width: 800px) {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
@media (max-width: 650px) {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
36
src/routes/game/[id]/+page.server.ts
Normal file
36
src/routes/game/[id]/+page.server.ts
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import { error } from '@sveltejs/kit';
|
||||
import type { PageServerLoad } from './$types'
|
||||
import { boardGameApi } from '../../api';
|
||||
|
||||
type GamePageParams = {
|
||||
params: {
|
||||
id: string;
|
||||
}
|
||||
}
|
||||
|
||||
export const load: PageServerLoad = async ({ params }: GamePageParams) => {
|
||||
console.log('params', params);
|
||||
const queryParams = {
|
||||
ids: `${params?.id}`
|
||||
};
|
||||
console.log('queryParams', queryParams);
|
||||
const response = await boardGameApi('get', `search`, queryParams);
|
||||
if (response.status === 404) {
|
||||
return {
|
||||
game: []
|
||||
};
|
||||
}
|
||||
|
||||
if (response.status === 200) {
|
||||
const gameResponse = await response.json();
|
||||
// console.log('gameResponse', gameResponse);
|
||||
// const games = gameResponse?.games;
|
||||
console.log('game response', gameResponse?.games[0]);
|
||||
return {
|
||||
game: gameResponse?.games[0]
|
||||
};
|
||||
}
|
||||
|
||||
throw error(response.status);
|
||||
// throw new Error("@migration task: Migrate this return statement (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292699)");
|
||||
};
|
||||
|
|
@ -1,12 +1,25 @@
|
|||
<script lang="ts">
|
||||
// throw new Error(
|
||||
// '@migration task: Add data prop (https://github.com/sveltejs/kit/discussions/5774#discussioncomment-3292707)'
|
||||
// );
|
||||
|
||||
import { fade } from 'svelte/transition';
|
||||
import { ExternalLinkIcon, MinusCircleIcon, MinusIcon, PlusCircleIcon, PlusIcon } from '@rgossiaux/svelte-heroicons/outline';
|
||||
import {
|
||||
ExternalLinkIcon,
|
||||
MinusCircleIcon,
|
||||
MinusIcon,
|
||||
PlusCircleIcon,
|
||||
PlusIcon
|
||||
} from '@rgossiaux/svelte-heroicons/outline';
|
||||
import { collectionStore } from '$lib/stores/collectionStore';
|
||||
import type { GameType, SavedGameType } from '$lib/types';
|
||||
import { addToCollection, removeFromCollection } from '$lib/util/manipulateCollection';
|
||||
import type { PageData } from './$types';
|
||||
|
||||
$: existsInCollection = $collectionStore.find((item: SavedGameType) => item.id === game.id);
|
||||
export let game: GameType;
|
||||
export let data: PageData;
|
||||
export let game: GameType = data?.game;
|
||||
console.log('page game', game);
|
||||
let seeMore: boolean = false;
|
||||
console.log(game?.description?.indexOf('</p>'));
|
||||
let firstParagraphEnd = 0;
|
||||
|
|
@ -68,7 +81,7 @@
|
|||
</span>
|
||||
{/if}
|
||||
<button class="btn" type="button" on:click={() => (seeMore = !seeMore)}
|
||||
>See
|
||||
>See
|
||||
{#if !seeMore}
|
||||
More <PlusIcon width="24" height="24" />
|
||||
{:else}
|
||||
|
|
@ -77,6 +90,12 @@
|
|||
</button>
|
||||
{/if}
|
||||
</section>
|
||||
{:else}
|
||||
<section class="description">
|
||||
<span>
|
||||
{@html game?.description}
|
||||
</span>
|
||||
</section>
|
||||
{/if}
|
||||
|
||||
<style lang="scss">
|
||||
55
src/routes/todos/+page.server.ts
Normal file
55
src/routes/todos/+page.server.ts
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
import { error } from '@sveltejs/kit';
|
||||
import { api } from './api';
|
||||
import type { PageServerLoad, Action } from './$types';
|
||||
|
||||
type Todo = {
|
||||
uid: string;
|
||||
created_at: Date;
|
||||
text: string;
|
||||
done: boolean;
|
||||
pending_delete: boolean;
|
||||
};
|
||||
|
||||
export const load: PageServerLoad = async ({ locals }) => {
|
||||
// locals.userid comes from src/hooks.js
|
||||
const response = await api('GET', `todos/${locals.userid}`);
|
||||
|
||||
if (response.status === 404) {
|
||||
// user hasn't created a todo list.
|
||||
// start with an empty array
|
||||
return {
|
||||
todos: [] as Todo[]
|
||||
};
|
||||
}
|
||||
|
||||
if (response.status === 200) {
|
||||
return {
|
||||
todos: (await response.json()) as Todo[]
|
||||
};
|
||||
}
|
||||
|
||||
throw error(response.status);
|
||||
};
|
||||
|
||||
export const POST: Action = async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
|
||||
await api('POST', `todos/${locals.userid}`, {
|
||||
text: form.get('text')
|
||||
});
|
||||
};
|
||||
|
||||
export const PATCH: Action = async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
|
||||
await api('PATCH', `todos/${locals.userid}/${form.get('uid')}`, {
|
||||
text: form.has('text') ? form.get('text') : undefined,
|
||||
done: form.has('done') ? !!form.get('done') : undefined
|
||||
});
|
||||
};
|
||||
|
||||
export const DELETE: Action = async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
|
||||
await api('DELETE', `todos/${locals.userid}/${form.get('uid')}`);
|
||||
};
|
||||
|
|
@ -1,21 +1,15 @@
|
|||
<script lang="ts">
|
||||
import type { PageData } from './$types';
|
||||
import { enhance } from '$lib/form';
|
||||
import { scale } from 'svelte/transition';
|
||||
import { flip } from 'svelte/animate';
|
||||
|
||||
type Todo = {
|
||||
uid: string;
|
||||
created_at: Date;
|
||||
text: string;
|
||||
done: boolean;
|
||||
pending_delete: boolean;
|
||||
};
|
||||
|
||||
export let todos: Todo[];
|
||||
export let data: PageData;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Todos</title>
|
||||
<meta name="description" content="A todo list app" />
|
||||
</svelte:head>
|
||||
|
||||
<div class="todos">
|
||||
|
|
@ -34,7 +28,7 @@
|
|||
<input name="text" aria-label="Add todo" placeholder="+ tap to add a todo" />
|
||||
</form>
|
||||
|
||||
{#each todos as todo (todo.uid)}
|
||||
{#each data.todos as todo (todo.uid)}
|
||||
<div
|
||||
class="todo"
|
||||
class:done={todo.done}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
/*
|
||||
This module is used by the /todos endpoint to
|
||||
make calls to api.svelte.dev, which stores todos
|
||||
for each user. The leading underscore indicates that this is
|
||||
a private module, _not_ an endpoint — visiting /todos/_api
|
||||
will net you a 404 response.
|
||||
|
||||
(The data on the todo app will expire periodically; no
|
||||
guarantees are made. Don't use it to organize your life.)
|
||||
*/
|
||||
|
||||
const base = 'https://api.svelte.dev';
|
||||
|
||||
export function api(method: string, resource: string, data?: Record<string, unknown>) {
|
||||
return fetch(`${base}/${resource}`, {
|
||||
method,
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
body: data && JSON.stringify(data)
|
||||
});
|
||||
}
|
||||
20
src/routes/todos/api.ts
Normal file
20
src/routes/todos/api.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
This module is used by the /todos endpoint to
|
||||
make calls to api.svelte.dev, which stores todos
|
||||
for each user.
|
||||
|
||||
(The data on the todo app will expire periodically; no
|
||||
guarantees are made. Don't use it to organise your life.)
|
||||
*/
|
||||
|
||||
const base = 'https://api.svelte.dev';
|
||||
|
||||
export function api(method: string, resource: string, data?: Record<string, unknown>) {
|
||||
return fetch(`${base}/${resource}`, {
|
||||
method,
|
||||
headers: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
body: data && JSON.stringify(data)
|
||||
});
|
||||
}
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
import { api } from './_api';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
|
||||
export const GET: RequestHandler = async ({ locals }) => {
|
||||
// locals.userid comes from src/hooks.js
|
||||
const response = await api('get', `todos/${locals.userid}`);
|
||||
|
||||
if (response.status === 404) {
|
||||
// user hasn't created a todo list.
|
||||
// start with an empty array
|
||||
return {
|
||||
body: {
|
||||
todos: []
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (response.status === 200) {
|
||||
return {
|
||||
body: {
|
||||
todos: await response.json()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
status: response.status
|
||||
};
|
||||
};
|
||||
|
||||
export const POST: RequestHandler = async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
|
||||
await api('post', `todos/${locals.userid}`, {
|
||||
text: form.get('text')
|
||||
});
|
||||
|
||||
return {};
|
||||
};
|
||||
|
||||
// If the user has JavaScript disabled, the URL will change to
|
||||
// include the method override unless we redirect back to /todos
|
||||
const redirect = {
|
||||
status: 303,
|
||||
headers: {
|
||||
location: '/todos'
|
||||
}
|
||||
};
|
||||
|
||||
export const PATCH: RequestHandler = async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
|
||||
await api('patch', `todos/${locals.userid}/${form.get('uid')}`, {
|
||||
text: form.has('text') ? form.get('text') : undefined,
|
||||
done: form.has('done') ? !!form.get('done') : undefined
|
||||
});
|
||||
|
||||
return redirect;
|
||||
};
|
||||
|
||||
export const DELETE: RequestHandler = async ({ request, locals }) => {
|
||||
const form = await request.formData();
|
||||
|
||||
await api('delete', `todos/${locals.userid}/${form.get('uid')}`);
|
||||
|
||||
return redirect;
|
||||
};
|
||||
Loading…
Reference in a new issue