Implement day navigation gestures with Swiper.js

This commit is contained in:
2022-09-11 20:40:08 +02:00
parent 8d9bcee279
commit 4346aa23c5
19 changed files with 2966 additions and 2342 deletions

4195
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -9,11 +9,11 @@
},
"dependencies": {
"dayjs": "^1.11.3",
"swiper": "^8.3.2",
"vite-plugin-git-revision": "^0.1.9",
"vue": "^3.2.37",
"vue-i18n": "^9.2.2",
"vue-router": "^4.0.15",
"vue3-touch-events": "^4.1.0"
"vue-router": "^4.0.15"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.1.0",

266
server/package-lock.json generated
View File

@ -21,12 +21,12 @@
}
},
"node_modules/@prisma/client": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.2.1.tgz",
"integrity": "sha512-PZBkY60+k5oix+e6IUfl3ub8TbRLNsPLdfWrdy2eh80WcHTaT+/UfvXf/B7gXedH7FRtbPFHZXk1hZenJiJZFQ==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.3.1.tgz",
"integrity": "sha512-FA0/d1VMJNWqzU7WVWTNWJ+lGOLR9JUBnF73GdIPAEVo/6dWk4gHx0EmgeU+SMv4MZoxgOeTBJF2azhg7x0hMw==",
"hasInstallScript": true,
"dependencies": {
"@prisma/engines-version": "4.2.0-33.2920a97877e12e055c1333079b8d19cee7f33826"
"@prisma/engines-version": "4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b"
},
"engines": {
"node": ">=14.17"
@ -41,16 +41,16 @@
}
},
"node_modules/@prisma/engines": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.2.1.tgz",
"integrity": "sha512-0KqBwREUOjBiHwITsQzw2DWfLHjntvbqzGRawj4sBMnIiL5CXwyDUKeHOwXzKMtNr1rEjxEsypM14g0CzLRK3g==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.3.1.tgz",
"integrity": "sha512-4JF/uMaEDAPdcdZNOrnzE3BvrbGpjgV0FcPT3EVoi6I86fWkloqqxBt+KcK/+fIRR0Pxj66uGR9wVH8U1Y13JA==",
"devOptional": true,
"hasInstallScript": true
},
"node_modules/@prisma/engines-version": {
"version": "4.2.0-33.2920a97877e12e055c1333079b8d19cee7f33826",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.2.0-33.2920a97877e12e055c1333079b8d19cee7f33826.tgz",
"integrity": "sha512-tktkqdiwqE4QhmE088boPt+FwPj1Jub/zk+5F6sEfcRHzO5yz9jyMD5HFVtiwxZPLx/8Xg9ElnuTi8E5lWVQFQ=="
"version": "4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b.tgz",
"integrity": "sha512-8yWpXkQRmiSfsi2Wb/ZS5D3RFbeu/btL9Pm/gdF4phB0Lo5KGsDFMxFMgaD64mwED2nHc8ZaEJg/+4Jymb9Znw=="
},
"node_modules/accepts": {
"version": "1.3.8",
@ -67,12 +67,12 @@
"node_modules/array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
},
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"node_modules/axios": {
"version": "0.27.2",
@ -132,9 +132,9 @@
}
},
"node_modules/cheerio": {
"version": "1.0.0-rc.11",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.11.tgz",
"integrity": "sha512-bQwNaDIBKID5ts/DsdhxrjqFXYfLw4ste+wMKqWA8DyKcS4qwsPP4Bk8ZNaTJjvpiX/qW3BT4sU7d6Bh5i+dag==",
"version": "1.0.0-rc.12",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz",
"integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==",
"dependencies": {
"cheerio-select": "^2.1.0",
"dom-serializer": "^2.0.0",
@ -142,8 +142,7 @@
"domutils": "^3.0.1",
"htmlparser2": "^8.0.1",
"parse5": "^7.0.0",
"parse5-htmlparser2-tree-adapter": "^7.0.0",
"tslib": "^2.4.0"
"parse5-htmlparser2-tree-adapter": "^7.0.0"
},
"engines": {
"node": ">= 6"
@ -199,9 +198,9 @@
}
},
"node_modules/cookie": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
"integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
"integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==",
"engines": {
"node": ">= 0.6"
}
@ -218,18 +217,10 @@
"node": ">= 0.8.0"
}
},
"node_modules/cookie-parser/node_modules/cookie": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
"integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
},
"node_modules/cors": {
"version": "2.8.5",
@ -280,7 +271,7 @@
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"engines": {
"node": ">=0.4.0"
}
@ -356,20 +347,20 @@
"node_modules/ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
},
"node_modules/encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=",
"integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==",
"engines": {
"node": ">= 0.8"
}
},
"node_modules/entities": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz",
"integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg==",
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz",
"integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==",
"engines": {
"node": ">=0.12"
},
@ -380,12 +371,12 @@
"node_modules/escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
},
"node_modules/etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=",
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
"engines": {
"node": ">= 0.6"
}
@ -431,6 +422,14 @@
"node": ">= 0.10.0"
}
},
"node_modules/express/node_modules/cookie": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
"integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/finalhandler": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
@ -449,9 +448,9 @@
}
},
"node_modules/follow-redirects": {
"version": "1.14.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz",
"integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==",
"version": "1.15.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz",
"integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA==",
"funding": [
{
"type": "individual",
@ -491,7 +490,7 @@
"node_modules/fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=",
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==",
"engines": {
"node": ">= 0.6"
}
@ -502,13 +501,13 @@
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"node_modules/get-intrinsic": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz",
"integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==",
"dependencies": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1"
"has-symbols": "^1.0.3"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
@ -596,7 +595,7 @@
"node_modules/media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=",
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==",
"engines": {
"node": ">= 0.6"
}
@ -604,12 +603,12 @@
"node_modules/merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
"integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
},
"node_modules/methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=",
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
"engines": {
"node": ">= 0.6"
}
@ -647,7 +646,7 @@
"node_modules/ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
},
"node_modules/negotiator": {
"version": "0.6.3",
@ -671,15 +670,15 @@
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/object-inspect": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz",
"integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==",
"version": "1.12.2",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
"integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
@ -696,11 +695,11 @@
}
},
"node_modules/parse5": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz",
"integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==",
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.1.tgz",
"integrity": "sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg==",
"dependencies": {
"entities": "^4.3.0"
"entities": "^4.4.0"
},
"funding": {
"url": "https://github.com/inikulin/parse5?sponsor=1"
@ -729,16 +728,16 @@
"node_modules/path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
},
"node_modules/prisma": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.2.1.tgz",
"integrity": "sha512-HuYqnTDgH8atjPGtYmY0Ql9XrrJnfW7daG1PtAJRW0E6gJxc50lY3vrIDn0yjMR3TvRlypjTcspQX8DT+xD4Sg==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.3.1.tgz",
"integrity": "sha512-90xo06wtqil76Xsi3mNpc4Js3SdDRR5g4qb9h+4VWY4Y8iImJY6xc3PX+C9xxTSt1lr0Q89A0MLkJjd8ax6KiQ==",
"devOptional": true,
"hasInstallScript": true,
"dependencies": {
"@prisma/engines": "4.2.1"
"@prisma/engines": "4.3.1"
},
"bin": {
"prisma": "build/index.js",
@ -896,11 +895,6 @@
"node": ">=0.6"
}
},
"node_modules/tslib": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
},
"node_modules/type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@ -916,7 +910,7 @@
"node_modules/unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=",
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
"engines": {
"node": ">= 0.8"
}
@ -924,7 +918,7 @@
"node_modules/utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=",
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
"engines": {
"node": ">= 0.4.0"
}
@ -932,7 +926,7 @@
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=",
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
"engines": {
"node": ">= 0.8"
}
@ -940,23 +934,23 @@
},
"dependencies": {
"@prisma/client": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.2.1.tgz",
"integrity": "sha512-PZBkY60+k5oix+e6IUfl3ub8TbRLNsPLdfWrdy2eh80WcHTaT+/UfvXf/B7gXedH7FRtbPFHZXk1hZenJiJZFQ==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-4.3.1.tgz",
"integrity": "sha512-FA0/d1VMJNWqzU7WVWTNWJ+lGOLR9JUBnF73GdIPAEVo/6dWk4gHx0EmgeU+SMv4MZoxgOeTBJF2azhg7x0hMw==",
"requires": {
"@prisma/engines-version": "4.2.0-33.2920a97877e12e055c1333079b8d19cee7f33826"
"@prisma/engines-version": "4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b"
}
},
"@prisma/engines": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.2.1.tgz",
"integrity": "sha512-0KqBwREUOjBiHwITsQzw2DWfLHjntvbqzGRawj4sBMnIiL5CXwyDUKeHOwXzKMtNr1rEjxEsypM14g0CzLRK3g==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-4.3.1.tgz",
"integrity": "sha512-4JF/uMaEDAPdcdZNOrnzE3BvrbGpjgV0FcPT3EVoi6I86fWkloqqxBt+KcK/+fIRR0Pxj66uGR9wVH8U1Y13JA==",
"devOptional": true
},
"@prisma/engines-version": {
"version": "4.2.0-33.2920a97877e12e055c1333079b8d19cee7f33826",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.2.0-33.2920a97877e12e055c1333079b8d19cee7f33826.tgz",
"integrity": "sha512-tktkqdiwqE4QhmE088boPt+FwPj1Jub/zk+5F6sEfcRHzO5yz9jyMD5HFVtiwxZPLx/8Xg9ElnuTi8E5lWVQFQ=="
"version": "4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b",
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b.tgz",
"integrity": "sha512-8yWpXkQRmiSfsi2Wb/ZS5D3RFbeu/btL9Pm/gdF4phB0Lo5KGsDFMxFMgaD64mwED2nHc8ZaEJg/+4Jymb9Znw=="
},
"accepts": {
"version": "1.3.8",
@ -970,12 +964,12 @@
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
},
"asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"axios": {
"version": "0.27.2",
@ -1025,9 +1019,9 @@
}
},
"cheerio": {
"version": "1.0.0-rc.11",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.11.tgz",
"integrity": "sha512-bQwNaDIBKID5ts/DsdhxrjqFXYfLw4ste+wMKqWA8DyKcS4qwsPP4Bk8ZNaTJjvpiX/qW3BT4sU7d6Bh5i+dag==",
"version": "1.0.0-rc.12",
"resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0-rc.12.tgz",
"integrity": "sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==",
"requires": {
"cheerio-select": "^2.1.0",
"dom-serializer": "^2.0.0",
@ -1035,8 +1029,7 @@
"domutils": "^3.0.1",
"htmlparser2": "^8.0.1",
"parse5": "^7.0.0",
"parse5-htmlparser2-tree-adapter": "^7.0.0",
"tslib": "^2.4.0"
"parse5-htmlparser2-tree-adapter": "^7.0.0"
}
},
"cheerio-select": {
@ -1074,9 +1067,9 @@
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
},
"cookie": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
"integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw=="
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
"integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA=="
},
"cookie-parser": {
"version": "1.4.6",
@ -1085,19 +1078,12 @@
"requires": {
"cookie": "0.4.1",
"cookie-signature": "1.0.6"
},
"dependencies": {
"cookie": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz",
"integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA=="
}
}
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ=="
},
"cors": {
"version": "2.8.5",
@ -1136,7 +1122,7 @@
"delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="
},
"depd": {
"version": "2.0.0",
@ -1184,27 +1170,27 @@
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
"integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="
},
"encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
"integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w=="
},
"entities": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-4.3.0.tgz",
"integrity": "sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg=="
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/entities/-/entities-4.4.0.tgz",
"integrity": "sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA=="
},
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
"integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="
},
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
"integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="
},
"express": {
"version": "4.18.1",
@ -1242,6 +1228,13 @@
"type-is": "~1.6.18",
"utils-merge": "1.0.1",
"vary": "~1.1.2"
},
"dependencies": {
"cookie": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
"integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw=="
}
}
},
"finalhandler": {
@ -1259,9 +1252,9 @@
}
},
"follow-redirects": {
"version": "1.14.9",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz",
"integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w=="
"version": "1.15.1",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz",
"integrity": "sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA=="
},
"form-data": {
"version": "4.0.0",
@ -1281,7 +1274,7 @@
"fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
"integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="
},
"function-bind": {
"version": "1.1.1",
@ -1289,13 +1282,13 @@
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
},
"get-intrinsic": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz",
"integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==",
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz",
"integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==",
"requires": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1"
"has-symbols": "^1.0.3"
}
},
"has": {
@ -1355,17 +1348,17 @@
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
"integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="
},
"merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
"integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w=="
},
"methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w=="
},
"mime": {
"version": "1.6.0",
@ -1388,7 +1381,7 @@
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
},
"negotiator": {
"version": "0.6.3",
@ -1406,12 +1399,12 @@
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="
},
"object-inspect": {
"version": "1.12.0",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz",
"integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g=="
"version": "1.12.2",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
"integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ=="
},
"on-finished": {
"version": "2.4.1",
@ -1422,11 +1415,11 @@
}
},
"parse5": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.0.0.tgz",
"integrity": "sha512-y/t8IXSPWTuRZqXc0ajH/UwDj4mnqLEbSttNbThcFhGrZuOyoyvNBO85PBp2jQa55wY9d07PBNjsK8ZP3K5U6g==",
"version": "7.1.1",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.1.tgz",
"integrity": "sha512-kwpuwzB+px5WUg9pyK0IcK/shltJN5/OVhQagxhCQNtT9Y9QRZqNY2e1cmbu/paRh5LMnz/oVTVLBpjFmMZhSg==",
"requires": {
"entities": "^4.3.0"
"entities": "^4.4.0"
}
},
"parse5-htmlparser2-tree-adapter": {
@ -1446,15 +1439,15 @@
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ=="
},
"prisma": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.2.1.tgz",
"integrity": "sha512-HuYqnTDgH8atjPGtYmY0Ql9XrrJnfW7daG1PtAJRW0E6gJxc50lY3vrIDn0yjMR3TvRlypjTcspQX8DT+xD4Sg==",
"version": "4.3.1",
"resolved": "https://registry.npmjs.org/prisma/-/prisma-4.3.1.tgz",
"integrity": "sha512-90xo06wtqil76Xsi3mNpc4Js3SdDRR5g4qb9h+4VWY4Y8iImJY6xc3PX+C9xxTSt1lr0Q89A0MLkJjd8ax6KiQ==",
"devOptional": true,
"requires": {
"@prisma/engines": "4.2.1"
"@prisma/engines": "4.3.1"
}
},
"proxy-addr": {
@ -1563,11 +1556,6 @@
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
},
"tslib": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
},
"type-is": {
"version": "1.6.18",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
@ -1580,17 +1568,17 @@
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
"integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="
},
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="
}
}
}

View File

@ -5,7 +5,6 @@ import BottomNavbar from "./components/bottom-navbar.vue";
import DateSelector from "./components/date-selector.vue";
import LoadingElement from "./components/loading-element.vue";
import { loading } from "./store";
import { previousDay, nextDay } from "./util";
import { computed } from "vue";
const route = useRoute();
@ -15,19 +14,13 @@ const isDataView = computed(() => {
routeName.value != "title.settings" && routeName.value != "title.login"
);
});
function swipeHandler(direction) {
if (!isDataView.value) return;
if (direction == "left") nextDay();
else if (direction == "right") previousDay();
}
</script>
<template>
<div class="app">
<TitleBar />
<DateSelector v-show="isDataView" />
<div class="center" v-touch:swipe="swipeHandler">
<div class="center">
<main>
<LoadingElement :active="loading" v-show="isDataView" />
<RouterView />
@ -57,18 +50,17 @@ body {
.app {
display: grid;
grid-template-rows: auto auto 1fr;
height: 100vh;
}
.center {
display: flex;
justify-content: center;
overflow-y: auto;
overflow: overlay;
}
main {
width: 100%;
max-width: 900px;
overflow: hidden;
}
</style>

View File

@ -48,6 +48,11 @@ body {
overflow: hidden;
}
#app,
.app {
height: 100%;
}
::-webkit-scrollbar {
width: 4px;
}

View File

@ -43,6 +43,7 @@ import { RouterLink } from "vue-router";
grid-auto-flow: column;
padding: 0px 20px;
max-width: 800px;
z-index: 100;
}
.entry {

View File

@ -1,8 +1,7 @@
<script setup>
import { selectedDate, selectedDay } from "../store";
import { selectedDate, selectedDay, changeDay, changeDate } from "../store";
import ArrowIcon from "./icons/arrow-icon.vue";
import dayjs from "dayjs";
import { changeDate, previousDay, nextDay } from "../util";
const dayNames = [
"days.sunday",
@ -17,12 +16,15 @@ const dayNames = [
<template>
<div class="selector">
<ArrowIcon @click="previousDay" />
<span class="day" @click="changeDate(dayjs())">
<ArrowIcon @click="() => (changeDay -= 1)" />
<span class="day" @click="changeDate = dayjs().toDate()">
{{ $t(dayNames[selectedDay + 1]) }},
{{ dayjs(selectedDate).format("DD.MM.YYYY") }}
</span>
<ArrowIcon style="transform: rotate(180deg)" @click="nextDay" />
<ArrowIcon
style="transform: rotate(180deg)"
@click="() => (changeDay += 1)"
/>
</div>
</template>

View File

@ -0,0 +1,112 @@
<script setup>
import { selectedDate, changeDate, changeDay } from "../store";
import { Swiper, SwiperSlide } from "swiper/vue";
import { Virtual } from "swiper";
import { ref, watch } from "vue";
defineProps({
element: {
required: true,
},
});
// Get swiper element
const swiperModules = ref([Virtual]);
const swiperElement = ref();
function setSwiper(swiper) {
swiperElement.value = swiper;
}
// Load current, previous and next day
const loadedDates = ref([
new Date(selectedDate.value.getTime() - 86400000),
new Date(selectedDate.value.getTime()),
new Date(selectedDate.value.getTime() + 86400000),
]);
// Load left or right date on slide change
function slideChange(swiper) {
selectedDate.value = loadedDates.value[swiper.activeIndex];
const activeSlide = swiper.activeIndex;
if (activeSlide == loadedDates.value.length - 1) {
const lastDate = loadedDates.value[loadedDates.value.length - 1];
loadedDates.value.push(calculateDate(lastDate, 1));
}
}
function slideChangeEnd(swiper) {
const activeSlide = swiper.activeIndex;
if (activeSlide == 0) {
const lastDate = loadedDates.value[0];
loadedDates.value = [calculateDate(lastDate, -1), ...loadedDates.value];
swiper.slideTo(activeSlide + 1, 0);
}
}
// Helper functions
function calculateDate(date, offset) {
return new Date(date.getTime() + 86400000 * offset);
}
function calculateSlide(date) {
return loadedDates.value.findIndex((e) => e.getTime() == date.getTime());
}
function slideToDate(date) {
const slide = calculateSlide(date);
if (slide != -1) swiperElement.value.slideTo(slide);
else {
loadedDates.value = [calculateDate(date, -1), date, calculateDate(date, 1)];
swiperElement.value.slideTo(1, 0);
}
selectedDate.value = date;
}
// Watch for slide change instructions
watch(changeDay, (change) => {
if (change == 0) return;
slideToDate(calculateDate(selectedDate.value, change));
changeDay.value = 0;
});
watch(changeDate, (date) => {
slideToDate(new Date(date.setUTCHours(0, 0, 0, 0)));
});
</script>
<template>
<swiper
:modules="swiperModules"
:slides-per-view="1"
:space-between="50"
:initial-slide="1"
:virtual="true"
@slide-change-transition-end="slideChangeEnd"
@slide-change="slideChange"
@swiper="setSwiper"
>
<swiper-slide
v-for="(date, index) in loadedDates"
:key="index"
:virtualIndex="index"
>
<div class="content">
<component :is="element" :date="date" />
</div>
</swiper-slide>
</swiper>
</template>
<style>
@import "swiper/css";
</style>
<style scoped>
.swiper {
padding: 10px;
z-index: 0;
height: 100%;
}
.content {
height: calc(100% - 100px);
overflow-y: auto;
padding-bottom: 100px;
}
</style>

View File

@ -0,0 +1,117 @@
<script setup>
import { historyOfDate } from "../store";
import { getSubstitutionText } from "../util";
import { computed } from "vue";
import dayjs from "dayjs";
const props = defineProps({
date: {
required: true,
},
});
const history = computed(() => {
return historyOfDate.value[props.date.setUTCHours(0, 0, 0, 0)];
});
function getChar(type) {
switch (type) {
case "change":
return "~";
case "addition":
return "+";
case "deletion":
return "-";
}
}
function getColor(type) {
switch (type) {
case "change":
return "background-color: var(--substitution-background-change)";
case "addition":
return "background-color: var(--substitution-background-addition);";
case "deletion":
return "background-color: var(--substitution-background-deletion);";
}
}
</script>
<template>
<div class="history">
<template v-for="event in history" :key="event">
<div class="change" :style="getColor(event.type)">
<span class="hour">{{ event.lesson }}{{ getChar(event.type) }}</span>
<div class="infos">
<span class="text" v-if="event.type == 'change'">
<template v-for="(change, key) in event.change" :key="key">
<p>
{{ key }}:&nbsp;
<s>{{ change.before }}</s>
&nbsp;{{ change.after }}
</p>
</template>
</span>
<span class="text" v-else
>{{
$t(getSubstitutionText(event.change), {
subject: event.change.subject,
class: event.change.class.join(", "),
teacher: event.change.change.teacher || event.change.teacher,
room: event.change.change.room,
})
}}<span class="notes" v-if="event.change.notes">
{{ $t("timetable.notes") }} {{ event.change.notes }}
</span>
</span>
<span class="notes">
{{ dayjs(event.updatedAt).format("DD.MM.YYYY, HH:mm") }}
</span>
</div>
</div>
</template>
</div>
</template>
<style scoped>
.change {
display: grid;
min-height: 35px;
border-radius: 11px;
margin-bottom: 10px;
padding: 10px 10px;
grid-template-columns: min-content auto;
gap: 5px;
}
.hour {
font-size: 30px;
display: flex;
align-items: center;
letter-spacing: 5px;
}
.infos {
display: flex;
justify-content: center;
flex-direction: column;
}
.text {
font-size: 18px;
display: flex;
align-items: center;
word-wrap: break-word;
flex-direction: column;
align-items: flex-start;
}
p {
margin: 0px;
}
.notes {
font-size: 13px;
font-weight: 100;
}
</style>

View File

@ -41,6 +41,7 @@ defineProps({
width: max-content;
height: max-content;
max-width: 100%;
z-index: 10;
}
.content {

View File

@ -0,0 +1,73 @@
<script setup>
import { substitutionsForDate } from "../store";
import { getSubstitutionText, getSubstitutionColor } from "../util";
import { computed } from "vue";
const props = defineProps({
date: {
required: true,
},
});
const substitutions = computed(() => {
return substitutionsForDate.value[props.date.setUTCHours(0, 0, 0, 0)];
});
</script>
<template>
<template v-for="substitution in substitutions" :key="substitution">
<div class="substitution" :style="getSubstitutionColor(substitution)">
<span class="hour">{{ substitution.lesson }}</span>
<div class="infos">
<span class="text">{{
$t(getSubstitutionText(substitution), {
subject: substitution.change.subject,
class: substitution.class.join(", "),
teacher: substitution.change.teacher || substitution.teacher,
room: substitution.change.room,
})
}}</span>
<span class="notes" v-if="substitution.notes">
{{ $t("timetable.notes") }} {{ substitution.notes }}
</span>
</div>
</div>
</template>
</template>
<style scoped>
.substitution {
display: grid;
background-color: var(--substitution-background-unchanged);
min-height: 50px;
border-radius: 11px;
margin-bottom: 10px;
padding: 10px 15px;
grid-template-columns: max-content auto;
gap: 15px;
}
.hour {
font-size: 30px;
display: flex;
align-items: center;
}
.infos {
display: flex;
justify-content: center;
flex-direction: column;
}
.text {
font-size: 18px;
display: flex;
align-items: center;
word-wrap: break-word;
}
.notes {
font-size: 13px;
font-weight: 100;
}
</style>

View File

@ -0,0 +1,153 @@
<script setup>
import { timetable, parsedTimetable, substitutions } from "../store";
import { getSubstitutionColor } from "../util";
import { computed } from "vue";
const props = defineProps({
date: {
required: true,
},
});
// Link the timetable with the substitutions
const linkedTimetable = computed(() => {
const currentDay = parsedTimetable.value[props.date.getDay() - 1];
if (!currentDay) return [];
const newDay = currentDay.map((e, index) => {
const newElement = { ...e };
// Find a substitution mathing this lesson
newElement.substitution = substitutions.value.find((entry) => {
const entryDay = new Date(entry.date).getTime();
return (
entry.lesson == index + 1 &&
entryDay == props.date.getTime() &&
(entry.teacher == e.teacher || !entry.teacher || !e.teacher)
);
});
return newElement;
});
return newDay;
});
function isChanged(lesson, key) {
const substitution = lesson.substitution;
if (!(substitution && substitution.change)) return false;
const changedKeys = Object.keys(substitution.change);
if (!changedKeys.includes(key)) return false;
return lesson[key] != substitution.change[key];
}
function getNotes(substitution) {
if (!(substitution && substitution.notes)) return;
return substitution.notes;
}
function isCancelled(substitution) {
if (!substitution) return false;
return substitution.type == "cancellation";
}
</script>
<template>
<div class="container">
<div class="trust-warning" v-if="!timetable.trusted">
<b>{{ $t("timetable.warning") }}</b>
{{ $t("timetable.trustWarning", { source: timetable.source }) }}
</div>
</div>
<div class="listContainer">
<template v-for="(lesson, index) in linkedTimetable" :key="index">
<div class="lesson" :style="getSubstitutionColor(lesson.substitution)">
<span class="hour">{{ index + 1 }}</span>
<div class="infos">
<!-- Subject changed -->
<span class="subject" v-if="isChanged(lesson, 'subject')">
<s>{{ lesson.subject }}</s> {{ lesson.substitution.change.subject }}
</span>
<!-- Cancellation -->
<span class="subject" v-else-if="isCancelled(lesson.substitution)">
<s>{{ lesson.subject }}</s>
</span>
<span class="subject" v-else>
{{ lesson.subject }}
</span>
<div class="info">
<!-- Teacher changed -->
<span class="info" v-if="isChanged(lesson, 'teacher')">
<s>{{ lesson.teacher }}</s>
{{ lesson.substitution.change.teacher }}</span
>
<span class="info" v-else> {{ lesson.teacher }}</span>
<!-- Room changed -->
<span class="info" v-if="isChanged(lesson, 'room')"
>, <s>{{ lesson.room }}</s> {{ lesson.substitution.change.room }}
</span>
<span class="info" v-else-if="lesson.room"
>, {{ lesson.room }}</span
>
<!-- Show notes if available -->
<span class="info" v-if="getNotes(lesson.substitution)"
>, {{ $t("timetable.notes") }} {{ getNotes(lesson.substitution) }}
</span>
</div>
</div>
</div>
</template>
</div>
</template>
<style scoped>
.container {
display: flex;
padding: 0px 10px;
justify-content: center;
}
.trust-warning {
border: 1px solid var(--timetable-trust-warning-border);
background-color: var(--timetable-trust-warning-background);
border-radius: 4px;
padding: 3px 10px;
margin-bottom: 15px;
width: max-content;
}
.listContainer {
display: flex;
flex-direction: column;
gap: 10px;
width: 100%;
}
.lesson {
display: grid;
background-color: var(--substitution-background-unchanged);
min-height: 50px;
border-radius: 11px;
padding: 15px;
grid-template-columns: max-content auto;
gap: 15px;
}
.hour {
font-size: 30px;
display: flex;
align-items: center;
}
.infos {
display: flex;
justify-content: center;
flex-direction: column;
}
.infos .subject {
font-weight: bold;
font-size: 18px;
}
.infos .info {
font-weight: 200;
font-size: 14px;
}
</style>

View File

@ -5,7 +5,6 @@ import { registerSW } from "virtual:pwa-register";
import { createI18n } from "vue-i18n";
import { strings } from "./strings";
import { language } from "./store";
import Vue3TouchEvents from "vue3-touch-events";
const i18n = createI18n({
locale: language.value,
@ -17,7 +16,6 @@ const app = createApp(App);
app.use(router);
app.use(i18n);
app.use(Vue3TouchEvents);
app.mount("#app");

View File

@ -24,6 +24,12 @@ watch(language, (newValue) => {
location.reload();
});
// Set this to a positive or negative integer
// to change selectedDate by this number
export const changeDay = ref(0);
// Set this to jump to a specific date
export const changeDate = ref(new Date());
export const selectedDate = ref(new Date(new Date().setUTCHours(0, 0, 0, 0)));
export const selectedDay = computed(() => selectedDate.value.getDay() - 1);
// Jump to next Monday if it is weekend
@ -32,6 +38,14 @@ if (selectedDay.value == 5)
if (selectedDay.value == -1)
selectedDate.value = new Date(selectedDate.value.getTime() + 86400000);
// Load new data if date changes
watch(selectedDate, async () => {
loading.value = true;
await fetchSubstitutions();
await fetchHistory();
loading.value = false;
});
export const timetable = ref({ trusted: true });
export const substitutions = ref([]);
export const history = ref([]);

View File

@ -29,23 +29,3 @@ export function getSubstitutionColor(substitution) {
return "background-color: var(--substitution-background-cancellation);";
}
}
export function nextDay() {
var newDate = dayjs(selectedDate.value).add(1, "day");
// Skip weekend
if (newDate.day() == 6) newDate = newDate.add(2, "day");
changeDate(newDate);
}
export function previousDay() {
var newDate = dayjs(selectedDate.value).subtract(1, "day");
// Skip weekend
if (newDate.day() == 0) newDate = newDate.subtract(2, "day");
changeDate(newDate);
}
export async function changeDate(newDate) {
selectedDate.value = new Date(newDate.toDate().setUTCHours(0, 0, 0, 0));
loading.value = true;
await fetchSubstitutions();
await fetchHistory();
loading.value = false;
}

View File

@ -1,115 +1,16 @@
<script setup>
import { historyOfDate, selectedDate } from "../store";
import { getSubstitutionText } from "../util";
import { computed } from "vue";
import dayjs from "dayjs";
const history = computed(() => {
return historyOfDate.value[selectedDate.value.setUTCHours(0, 0, 0, 0)];
});
function getChar(type) {
switch (type) {
case "change":
return "~";
case "addition":
return "+";
case "deletion":
return "-";
}
}
function getColor(type) {
switch (type) {
case "change":
return "background-color: var(--substitution-background-change)";
case "addition":
return "background-color: var(--substitution-background-addition);";
case "deletion":
return "background-color: var(--substitution-background-deletion);";
}
}
import DayCarousel from "../components/day-carousel.vue";
import HistoryList from "../components/history-list.vue";
</script>
<template>
<div class="history">
<template v-for="event in history" :key="event">
<div class="change" :style="getColor(event.type)">
<span class="hour">{{ event.lesson }}{{ getChar(event.type) }}</span>
<div class="infos">
<span class="text" v-if="event.type == 'change'">
<template v-for="(change, key) in event.change" :key="key">
<p>
{{ key }}:&nbsp;
<s>{{ change.before }}</s>
&nbsp;{{ change.after }}
</p>
</template>
</span>
<span class="text" v-else
>{{
$t(getSubstitutionText(event.change), {
subject: event.change.subject,
class: event.change.class.join(", "),
teacher: event.change.change.teacher || event.change.teacher,
room: event.change.change.room,
})
}}<span class="notes" v-if="event.change.notes">
{{ $t("timetable.notes") }} {{ event.change.notes }}
</span>
</span>
<span class="notes">
{{ dayjs(event.updatedAt).format("DD.MM.YYYY, HH:mm") }}
</span>
</div>
</div>
</template>
<DayCarousel :element="HistoryList" />
</div>
</template>
<style scoped>
.history {
padding: 0px 10px 80px 10px;
}
.change {
display: grid;
min-height: 35px;
border-radius: 11px;
margin-bottom: 10px;
padding: 10px 10px;
grid-template-columns: min-content auto;
gap: 5px;
}
.hour {
font-size: 30px;
display: flex;
align-items: center;
letter-spacing: 5px;
}
.infos {
display: flex;
justify-content: center;
flex-direction: column;
}
.text {
font-size: 18px;
display: flex;
align-items: center;
word-wrap: break-word;
flex-direction: column;
align-items: flex-start;
}
p {
margin: 0px;
}
.notes {
font-size: 13px;
font-weight: 100;
height: 100%;
}
</style>

View File

@ -65,6 +65,9 @@ const gitHash = GITVERSION;
<style scoped>
.settings {
padding: 15px 10px 80px 10px;
height: calc(100% - 100px);
overflow-y: auto;
padding-bottom: 90px;
}
h2 {

View File

@ -1,73 +1,16 @@
<script setup>
import { substitutionsForDate, selectedDate } from "../store";
import { getSubstitutionText, getSubstitutionColor } from "../util";
import { computed } from "vue";
const substitutions = computed(() => {
return substitutionsForDate.value[selectedDate.value.setUTCHours(0, 0, 0, 0)];
});
import DayCarousel from "../components/day-carousel.vue";
import SubstitutionList from "../components/substitution-list.vue";
</script>
<template>
<div class="substitutions">
<template v-for="substitution in substitutions" :key="substitution">
<div class="substitution" :style="getSubstitutionColor(substitution)">
<span class="hour">{{ substitution.lesson }}</span>
<div class="infos">
<span class="text">{{
$t(getSubstitutionText(substitution), {
subject: substitution.change.subject,
class: substitution.class.join(", "),
teacher: substitution.change.teacher || substitution.teacher,
room: substitution.change.room,
})
}}</span>
<span class="notes" v-if="substitution.notes">
{{ $t("timetable.notes") }} {{ substitution.notes }}
</span>
</div>
</div>
</template>
<DayCarousel :element="SubstitutionList" />
</div>
</template>
<style scoped>
.substitutions {
padding: 0px 10px 80px 10px;
}
.substitution {
display: grid;
background-color: var(--substitution-background-unchanged);
min-height: 50px;
border-radius: 11px;
margin-bottom: 10px;
padding: 10px 15px;
grid-template-columns: max-content auto;
gap: 15px;
}
.hour {
font-size: 30px;
display: flex;
align-items: center;
}
.infos {
display: flex;
justify-content: center;
flex-direction: column;
}
.text {
font-size: 18px;
display: flex;
align-items: center;
word-wrap: break-word;
}
.notes {
font-size: 13px;
font-weight: 100;
height: 100%;
}
</style>

View File

@ -1,56 +1,10 @@
<script setup>
import {
timetable,
parsedTimetable,
classFilter,
classList,
substitutions,
selectedDate,
selectedDay,
} from "../store";
import { getSubstitutionColor } from "../util";
import { computed } from "vue";
import TimetableSetup from "../components/initial-setup.vue";
// Link the timetable with the substitutions
const linkedTimetable = computed(() => {
const currentDay = parsedTimetable.value[selectedDay.value];
if (!currentDay) return [];
const newDay = currentDay.map((e, index) => {
const newElement = { ...e };
// Find a substitution mathing this lesson
newElement.substitution = substitutions.value.find((entry) => {
const entryDay = new Date(entry.date).getTime();
return (
entry.lesson == index + 1 &&
entryDay == selectedDate.value.getTime() &&
(entry.teacher == e.teacher || !entry.teacher || !e.teacher)
);
});
return newElement;
});
return newDay;
});
function isChanged(lesson, key) {
const substitution = lesson.substitution;
if (!(substitution && substitution.change)) return false;
const changedKeys = Object.keys(substitution.change);
if (!changedKeys.includes(key)) return false;
return lesson[key] != substitution.change[key];
}
function getNotes(substitution) {
if (!(substitution && substitution.notes)) return;
return substitution.notes;
}
function isCancelled(substitution) {
if (!substitution) return false;
return substitution.type == "cancellation";
}
import { classList, classFilter } from "../store";
import DayCarousel from "../components/day-carousel.vue";
import TimetableList from "../components/timetable-list.vue";
</script>
<template>
<TimetableSetup
v-show="classFilter == 'none'"
@ -58,100 +12,12 @@ function isCancelled(substitution) {
v-model="classFilter"
/>
<div class="timetable">
<div class="container">
<div class="trust-warning" v-if="!timetable.trusted">
<b>{{ $t("timetable.warning") }}</b>
{{ $t("timetable.trustWarning", { source: timetable.source }) }}
</div>
</div>
<template v-for="(lesson, index) in linkedTimetable" :key="index">
<div class="lesson" :style="getSubstitutionColor(lesson.substitution)">
<span class="hour">{{ index + 1 }}</span>
<div class="infos">
<!-- Subject changed -->
<span class="subject" v-if="isChanged(lesson, 'subject')">
<s>{{ lesson.subject }}</s> {{ lesson.substitution.change.subject }}
</span>
<!-- Cancellation -->
<span class="subject" v-else-if="isCancelled(lesson.substitution)">
<s>{{ lesson.subject }}</s>
</span>
<span class="subject" v-else>
{{ lesson.subject }}
</span>
<div class="info">
<!-- Teacher changed -->
<span class="info" v-if="isChanged(lesson, 'teacher')">
<s>{{ lesson.teacher }}</s>
{{ lesson.substitution.change.teacher }}</span
>
<span class="info" v-else> {{ lesson.teacher }}</span>
<!-- Room changed -->
<span class="info" v-if="isChanged(lesson, 'room')"
>, <s>{{ lesson.room }}</s> {{ lesson.substitution.change.room }}
</span>
<span class="info" v-else-if="lesson.room"
>, {{ lesson.room }}</span
>
<!-- Show notes if available -->
<span class="info" v-if="getNotes(lesson.substitution)"
>, {{ $t("timetable.notes") }} {{ getNotes(lesson.substitution) }}
</span>
</div>
</div>
</div>
</template>
<DayCarousel :element="TimetableList" />
</div>
</template>
<style scoped>
.timetable {
padding: 0px 10px 80px 10px;
}
.container {
display: flex;
justify-content: center;
}
.trust-warning {
border: 1px solid var(--timetable-trust-warning-border);
background-color: var(--timetable-trust-warning-background);
border-radius: 4px;
padding: 3px 10px;
margin: 5px 0px;
width: max-content;
}
.lesson {
display: grid;
background-color: var(--substitution-background-unchanged);
min-height: 50px;
border-radius: 11px;
margin: 10px 0px;
padding: 15px;
grid-template-columns: max-content auto;
gap: 15px;
}
.hour {
font-size: 30px;
display: flex;
align-items: center;
}
.infos {
display: flex;
justify-content: center;
flex-direction: column;
}
.infos .subject {
font-weight: bold;
font-size: 18px;
}
.infos .info {
font-weight: 200;
font-size: 14px;
height: 100%;
}
</style>