diff --git a/package.json b/package.json index b1788c6f7dfede486a3dc630b3c12fa2303b1a63..fa89baaddd9f36502fdddc081c78aed72075ba3f 100644 --- a/package.json +++ b/package.json @@ -32,5 +32,10 @@ "vite": "^5.0.3" }, "type": "module", - "packageManager": "pnpm@9.7.0+sha512.dc09430156b427f5ecfc79888899e1c39d2d690f004be70e05230b72cb173d96839587545d09429b55ac3c429c801b4dc3c0e002f653830a420fa2dd4e3cf9cf" + "packageManager": "pnpm@9.7.0+sha512.dc09430156b427f5ecfc79888899e1c39d2d690f004be70e05230b72cb173d96839587545d09429b55ac3c429c801b4dc3c0e002f653830a420fa2dd4e3cf9cf", + "dependencies": { + "formsnap": "^1.0.1", + "sveltekit-superforms": "^2.17.0", + "zod": "^3.23.8" + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0e105c0dd38804c9a6d9f7400df97eb73d422900..d472da5d24c7a8bb5a4b23f9ad5bf7ea155d2f7b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,6 +7,16 @@ settings: importers: .: + dependencies: + formsnap: + specifier: ^1.0.1 + version: 1.0.1(svelte@4.2.18)(sveltekit-superforms@2.17.0(@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18)) + sveltekit-superforms: + specifier: ^2.17.0 + version: 2.17.0(@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18) + zod: + specifier: ^3.23.8 + version: 3.23.8 devDependencies: '@sveltejs/adapter-auto': specifier: ^3.0.0 @@ -73,6 +83,16 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} + '@ark/schema@0.2.0': + resolution: {integrity: sha512-IkNWCSHdjaoemMXpps4uFHEAQzwJPbTAS8K2vcQpk90sa+eNBuPSVyB/81/Qyl1VYW0iX3ceGC5NL/OznQv1jg==} + + '@ark/util@0.1.0': + resolution: {integrity: sha512-qCLYICQoCy3kEKDVwirQp8qvxhY7NJd8BhhoHaj1l3wCFAk9NUbcDsxAkPStZEMdPI/d7NcbGJe8SWZuRG2twQ==} + + '@babel/runtime@7.25.4': + resolution: {integrity: sha512-DSgLeL/FNcpXuzav5wfYvHCGvynXkJbn3Zvc3823AEe9nPwW9IK4UoCSS5yGymmQzN0pCPvivtgS6/8U2kkm1w==} + engines: {node: '>=6.9.0'} + '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} @@ -237,6 +257,19 @@ packages: resolution: {integrity: sha512-BsWiH1yFGjXXS2yvrf5LyuoSIIbPrGUWob917o+BTKuZ7qJdxX8aJLRxs1fS9n6r7vESrq1OUqb68dANcFXuQQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@exodus/schemasafe@1.3.0': + resolution: {integrity: sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==} + + '@gcornut/valibot-json-schema@0.31.0': + resolution: {integrity: sha512-3xGptCurm23e7nuPQkdrE5rEs1FeTPHhAUsBuwwqG4/YeZLwJOoYZv+fmsppUEfo5y9lzUwNQrNqLS/q7HMc7g==} + hasBin: true + + '@hapi/hoek@9.3.0': + resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} + + '@hapi/topo@5.1.0': + resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} + '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} @@ -286,6 +319,10 @@ packages: '@polka/url@1.0.0-next.25': resolution: {integrity: sha512-j7P6Rgr3mmtdkeDGTe0E/aYyWEWVtc5yFXtHCRHs28/jptDEWfaVOc5T7cblqy1XKPPfCxJc/8DwQ5YgLOZOVQ==} + '@poppinss/macroable@1.0.2': + resolution: {integrity: sha512-xhhEcEvhQC8mP5oOr5hbE4CmUgmw/IPV1jhpGg2xSkzoFrt9i8YVqBQt9744EFesi5F7pBheWozg63RUBM/5JA==} + engines: {node: '>=18.16.0'} + '@rollup/rollup-android-arm-eabi@4.21.0': resolution: {integrity: sha512-WTWD8PfoSAJ+qL87lE7votj3syLavxunWhzCnx3XFxFiI/BA/r3X7MUM8dVrH8rb2r4AiO8jJsr3ZjdaftmnfA==} cpu: [arm] @@ -366,6 +403,21 @@ packages: cpu: [x64] os: [win32] + '@sideway/address@4.1.5': + resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} + + '@sideway/formula@3.0.1': + resolution: {integrity: sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==} + + '@sideway/pinpoint@2.0.0': + resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} + + '@sinclair/typebox@0.32.35': + resolution: {integrity: sha512-Ul3YyOTU++to8cgNkttakC0dWvpERr6RYoHO2W47DLbFvrwBDJUY31B1sImH6JZSYc4Kt4PyHtoPNu+vL2r2dA==} + + '@sodaru/yup-to-json-schema@2.0.1': + resolution: {integrity: sha512-lWb0Wiz8KZ9ip/dY1eUqt7fhTPmL24p6Hmv5Fd9pzlzAdw/YNcWZr+tiCT4oZ4Zyxzi9+1X4zv82o7jYvcFxYA==} + '@sveltejs/adapter-auto@3.2.4': resolution: {integrity: sha512-a64AKYbfTUrVwU0xslzv1Jf3M8bj0IwhptaXmhgIkjXspBXhD0od9JiItQHchijpLMGdEDcYBlvqySkEawv6mQ==} peerDependencies: @@ -410,6 +462,9 @@ packages: '@types/pug@2.0.10': resolution: {integrity: sha512-Sk/uYFOBAB7mb74XcpizmH0KOR2Pv3D2Hmrh1Dmy5BmK3MpdSa5kqZcg6EKBdklU0bFXX9gCfzvpnyUehrPIuA==} + '@types/validator@13.12.0': + resolution: {integrity: sha512-nH45Lk7oPIJ1RVOF6JgFI6Dy0QpHEzq4QecZhvguxYPDwT8c93prCMqAtiIttm39voZ+DDR+qkNnMpJmMBRqag==} + '@typescript-eslint/eslint-plugin@8.2.0': resolution: {integrity: sha512-02tJIs655em7fvt9gps/+4k4OsKULYGtLBPJfOsmOq1+3cdClYiF0+d6mHu6qDnTcg88wJBkcPLpQhq7FyDz0A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -467,6 +522,14 @@ packages: resolution: {integrity: sha512-sbgsPMW9yLvS7IhCi8IpuK1oBmtbWUNP+hBdwl/I9nzqVsszGnNGti5r9dUtF5RLivHUFFIdRvLiTsPhzSyJ3Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@vinejs/compiler@2.5.0': + resolution: {integrity: sha512-hg4ekaB5Y2zh+IWzBiC/WCDWrIfpVnKu/ubUvelKlidc/VbulsexoFRw5kJGHZenPVI5YzNnDeTdYSALkTV7jQ==} + engines: {node: '>=18.0.0'} + + '@vinejs/vine@1.8.0': + resolution: {integrity: sha512-Qq3XxbA26jzqS9ICifkqzT399lMQZ2fWtqeV3luI2as+UIK7qDifJFU2Q4W3q3IB5VXoWxgwAZSZEO0em9I/qQ==} + engines: {node: '>=18.16.0'} + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -512,6 +575,9 @@ packages: aria-query@5.3.0: resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} + arktype@2.0.0-beta.0: + resolution: {integrity: sha512-fE3ssMiXjr/bLqFPzlDhRlXngdyHQreu7p7i8+dtcY1CA+f8WrVUcue6JxywhnqEJXPG4HOcIwQcC+q4VfeUMQ==} + array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} @@ -553,6 +619,9 @@ packages: resolution: {integrity: sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==} engines: {node: '>=8.0.0'} + buffer-from@1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} @@ -561,6 +630,10 @@ packages: resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} engines: {node: '>= 6'} + camelcase@8.0.0: + resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} + engines: {node: '>=16'} + caniuse-lite@1.0.30001651: resolution: {integrity: sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==} @@ -606,6 +679,9 @@ packages: engines: {node: '>=4'} hasBin: true + dayjs@1.11.13: + resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==} + debug@4.3.6: resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} engines: {node: '>=6.0'} @@ -658,6 +734,12 @@ packages: es6-promise@3.3.1: resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==} + esbuild-runner@2.2.2: + resolution: {integrity: sha512-fRFVXcmYVmSmtYm2mL8RlUASt2TDkGh3uRcvHFOKNr/T58VrfVeKD9uT9nlgxk96u0LS0ehS/GY7Da/bXWKkhw==} + hasBin: true + peerDependencies: + esbuild: '*' + esbuild@0.21.5: resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==} engines: {node: '>=12'} @@ -788,6 +870,12 @@ packages: resolution: {integrity: sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==} engines: {node: '>=14'} + formsnap@1.0.1: + resolution: {integrity: sha512-TvU9CoLSiacW1c7wXhLiyVpyy/LBfG0CEFDbs3M3jrsxBSrkTpsuhbQ8JYKY3CNCmIhZlgxCH+Vqr7RBF9G53w==} + peerDependencies: + svelte: ^4.0.0 || ^5.0.0-next.1 + sveltekit-superforms: ^2.3.0 + fraction.js@4.3.7: resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} @@ -913,6 +1001,9 @@ packages: resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} hasBin: true + joi@17.13.3: + resolution: {integrity: sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==} + js-yaml@4.1.0: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true @@ -920,12 +1011,19 @@ packages: json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} + json-schema-to-ts@3.1.0: + resolution: {integrity: sha512-UeVN/ery4/JeXI8h4rM8yZPxsH+KqPi/84qFxHfTGHZnWnK9D0UU9ZGYO+6XAaJLqCWMiks+ARuFOKAiSxJCHA==} + engines: {node: '>=16'} + json-schema-traverse@0.4.1: resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} json-stable-stringify-without-jsonify@1.0.1: resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + just-clone@6.2.0: + resolution: {integrity: sha512-1IynUYEc/HAwxhi3WDpIpxJbZpMCvvrrmZVqvj9EhpvbH8lls7HhdhiByjL7DkAaWlLIzpC0Xc/VPvy/UxLNjA==} + keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} @@ -970,6 +1068,9 @@ packages: mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} + memoize-weak@1.0.2: + resolution: {integrity: sha512-gj39xkrjEw7nCn4nJ1M5ms6+MyMlyiGmttzsqAUsAKn6bYKwuTHh/AO3cKPF8IBrTIYTxb0wWXFs3E//Y8VoWQ==} + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} @@ -1019,6 +1120,11 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + nanoid@5.0.7: + resolution: {integrity: sha512-oLxFY2gd2IqnjcYyOXD8XGCftpGtZP2AbHbOkthDkvRywH5ayNtPVy9YlOPcHckXzbLTCHpkb7FB+yuxKV13pQ==} + engines: {node: ^18 || >=20} + hasBin: true + natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -1033,6 +1139,10 @@ packages: resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} engines: {node: '>=0.10.0'} + normalize-url@8.0.1: + resolution: {integrity: sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==} + engines: {node: '>=14.16'} + object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -1239,6 +1349,9 @@ packages: engines: {node: '>=14'} hasBin: true + property-expr@2.0.6: + resolution: {integrity: sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -1253,6 +1366,9 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} + regenerator-runtime@0.14.1: + resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -1321,6 +1437,13 @@ packages: resolution: {integrity: sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==} engines: {node: '>=0.10.0'} + source-map-support@0.5.21: + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} + + source-map@0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -1350,6 +1473,10 @@ packages: engines: {node: '>=16 || 14 >=14.17'} hasBin: true + superstruct@2.0.2: + resolution: {integrity: sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==} + engines: {node: '>=14.0.0'} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -1420,6 +1547,12 @@ packages: resolution: {integrity: sha512-d0FdzYIiAePqRJEb90WlJDkjUEx42xhivxN8muUBmfZnP+tzUgz12DJ2hRJi8sIHCME7jeK1PTMgKPSfTd8JrA==} engines: {node: '>=16'} + sveltekit-superforms@2.17.0: + resolution: {integrity: sha512-QrX8pkcmE0XoeVU42zMhsah4FoDrgtPc/4cZEr38rDlgU+DE0xNc5J0E7z1456sUJNbFjaB0+HZwwAkX0vYqaA==} + peerDependencies: + '@sveltejs/kit': 1.x || 2.x + svelte: 3.x || 4.x || >=5.0.0-next.51 + tailwindcss@3.4.10: resolution: {integrity: sha512-KWZkVPm7yJRhdu4SRSl9d4AK2wM3a50UsvgHZO7xY77NQr2V+fIrEuoDGQcbvswWvFGbS2f6e+jC/6WJm1Dl0w==} engines: {node: '>=14.0.0'} @@ -1435,6 +1568,9 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + tiny-case@1.0.3: + resolution: {integrity: sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==} + tiny-glob@0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} @@ -1442,23 +1578,40 @@ packages: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} + toposort@2.0.2: + resolution: {integrity: sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==} + totalist@3.0.1: resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} engines: {node: '>=6'} + ts-algebra@2.0.0: + resolution: {integrity: sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw==} + ts-api-utils@1.3.0: resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' + ts-deepmerge@7.0.1: + resolution: {integrity: sha512-JBFCmNenZdUCc+TRNCtXVM6N8y/nDQHAcpj5BlwXG/gnogjam1NunulB9ia68mnqYI446giMfpqeBFFkOleh+g==} + engines: {node: '>=14.13.1'} + ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + tslib@2.4.0: + resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} engines: {node: '>= 0.8.0'} + type-fest@2.19.0: + resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} + engines: {node: '>=12.20'} + typescript-eslint@8.2.0: resolution: {integrity: sha512-DmnqaPcML0xYwUzgNbM1XaKXpEb7BShYf2P1tkUmmcl8hyeG7Pj08Er7R9bNy6AufabywzJcOybQAtnD/c9DGw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -1485,6 +1638,16 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + valibot@0.31.1: + resolution: {integrity: sha512-2YYIhPrnVSz/gfT2/iXVTrSj92HwchCt9Cga/6hX4B26iCz9zkIsGTS0HjDYTZfTi1Un0X6aRvhBi1cfqs/i0Q==} + + valibot@0.35.0: + resolution: {integrity: sha512-+i2aCRkReTrd5KBN/dW2BrPOvFnU5LXTV2xjZnjnqUIO8YUx6P2+MgRrkwF2FhkexgyKq/NIZdPdknhHf5A/Ww==} + + validator@13.12.0: + resolution: {integrity: sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==} + engines: {node: '>= 0.10'} + vite@5.4.2: resolution: {integrity: sha512-dDrQTRHp5C1fTFzcSaMxjk6vdpKvT+2/mIdE07Gw2ykehT49O0z/VHS3zZ8iV/Gh8BJJKHWOe5RjaNrW5xf/GA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -1557,6 +1720,17 @@ packages: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + yup@1.4.0: + resolution: {integrity: sha512-wPbgkJRCqIf+OHyiTBQoJiP5PFuAXaWiJK6AmYkzQAh5/c2K9hzSApBZG5wV9KoKSePF7sAxmNSvh/13YHkFDg==} + + zod-to-json-schema@3.23.2: + resolution: {integrity: sha512-uSt90Gzc/tUfyNqxnjlfBs8W6WSGpNBv0rVsNxP/BVSMHMKGdthPYff4xtCHYloJGM0CFxFsb3NbC0eqPhfImw==} + peerDependencies: + zod: ^3.23.3 + + zod@3.23.8: + resolution: {integrity: sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==} + snapshots: '@alloc/quick-lru@5.2.0': {} @@ -1566,6 +1740,19 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 + '@ark/schema@0.2.0': + dependencies: + '@ark/util': 0.1.0 + optional: true + + '@ark/util@0.1.0': + optional: true + + '@babel/runtime@7.25.4': + dependencies: + regenerator-runtime: 0.14.1 + optional: true + '@esbuild/aix-ppc64@0.21.5': optional: true @@ -1668,6 +1855,26 @@ snapshots: '@eslint/object-schema@2.1.4': {} + '@exodus/schemasafe@1.3.0': + optional: true + + '@gcornut/valibot-json-schema@0.31.0': + dependencies: + valibot: 0.31.1 + optionalDependencies: + '@types/json-schema': 7.0.15 + esbuild: 0.21.5 + esbuild-runner: 2.2.2(esbuild@0.21.5) + optional: true + + '@hapi/hoek@9.3.0': + optional: true + + '@hapi/topo@5.1.0': + dependencies: + '@hapi/hoek': 9.3.0 + optional: true + '@humanwhocodes/module-importer@1.0.1': {} '@humanwhocodes/retry@0.3.0': {} @@ -1715,6 +1922,9 @@ snapshots: '@polka/url@1.0.0-next.25': {} + '@poppinss/macroable@1.0.2': + optional: true + '@rollup/rollup-android-arm-eabi@4.21.0': optional: true @@ -1763,6 +1973,23 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.21.0': optional: true + '@sideway/address@4.1.5': + dependencies: + '@hapi/hoek': 9.3.0 + optional: true + + '@sideway/formula@3.0.1': + optional: true + + '@sideway/pinpoint@2.0.0': + optional: true + + '@sinclair/typebox@0.32.35': + optional: true + + '@sodaru/yup-to-json-schema@2.0.1': + optional: true + '@sveltejs/adapter-auto@3.2.4(@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18)(vite@5.4.2))': dependencies: '@sveltejs/kit': 2.5.24(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18)(vite@5.4.2) @@ -1822,6 +2049,9 @@ snapshots: '@types/pug@2.0.10': {} + '@types/validator@13.12.0': + optional: true + '@typescript-eslint/eslint-plugin@8.2.0(@typescript-eslint/parser@8.2.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4)': dependencies: '@eslint-community/regexpp': 4.11.0 @@ -1903,6 +2133,21 @@ snapshots: '@typescript-eslint/types': 8.2.0 eslint-visitor-keys: 3.4.3 + '@vinejs/compiler@2.5.0': + optional: true + + '@vinejs/vine@1.8.0': + dependencies: + '@poppinss/macroable': 1.0.2 + '@types/validator': 13.12.0 + '@vinejs/compiler': 2.5.0 + camelcase: 8.0.0 + dayjs: 1.11.13 + dlv: 1.1.3 + normalize-url: 8.0.1 + validator: 13.12.0 + optional: true + acorn-jsx@5.3.2(acorn@8.12.1): dependencies: acorn: 8.12.1 @@ -1941,6 +2186,12 @@ snapshots: dependencies: dequal: 2.0.3 + arktype@2.0.0-beta.0: + dependencies: + '@ark/schema': 0.2.0 + '@ark/util': 0.1.0 + optional: true + array-union@2.1.0: {} autoprefixer@10.4.20(postcss@8.4.41): @@ -1981,10 +2232,16 @@ snapshots: buffer-crc32@1.0.0: {} + buffer-from@1.1.2: + optional: true + callsites@3.1.0: {} camelcase-css@2.0.1: {} + camelcase@8.0.0: + optional: true + caniuse-lite@1.0.30001651: {} chalk@4.1.2: @@ -2037,6 +2294,9 @@ snapshots: cssesc@3.0.0: {} + dayjs@1.11.13: + optional: true + debug@4.3.6: dependencies: ms: 2.1.2 @@ -2069,6 +2329,13 @@ snapshots: es6-promise@3.3.1: {} + esbuild-runner@2.2.2(esbuild@0.21.5): + dependencies: + esbuild: 0.21.5 + source-map-support: 0.5.21 + tslib: 2.4.0 + optional: true + esbuild@0.21.5: optionalDependencies: '@esbuild/aix-ppc64': 0.21.5 @@ -2255,6 +2522,12 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 + formsnap@1.0.1(svelte@4.2.18)(sveltekit-superforms@2.17.0(@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18)): + dependencies: + nanoid: 5.0.7 + svelte: 4.2.18 + sveltekit-superforms: 2.17.0(@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18) + fraction.js@4.3.7: {} fs.realpath@1.0.0: {} @@ -2369,16 +2642,33 @@ snapshots: jiti@1.21.6: {} + joi@17.13.3: + dependencies: + '@hapi/hoek': 9.3.0 + '@hapi/topo': 5.1.0 + '@sideway/address': 4.1.5 + '@sideway/formula': 3.0.1 + '@sideway/pinpoint': 2.0.0 + optional: true + js-yaml@4.1.0: dependencies: argparse: 2.0.1 json-buffer@3.0.1: {} + json-schema-to-ts@3.1.0: + dependencies: + '@babel/runtime': 7.25.4 + ts-algebra: 2.0.0 + optional: true + json-schema-traverse@0.4.1: {} json-stable-stringify-without-jsonify@1.0.1: {} + just-clone@6.2.0: {} + keyv@4.5.4: dependencies: json-buffer: 3.0.1 @@ -2414,6 +2704,8 @@ snapshots: mdn-data@2.0.30: {} + memoize-weak@1.0.2: {} + merge2@1.4.1: {} micromatch@4.0.7: @@ -2453,6 +2745,8 @@ snapshots: nanoid@3.3.7: {} + nanoid@5.0.7: {} + natural-compare@1.4.0: {} node-releases@2.0.18: {} @@ -2461,6 +2755,9 @@ snapshots: normalize-range@0.1.2: {} + normalize-url@8.0.1: + optional: true + object-assign@4.1.1: {} object-hash@3.0.0: {} @@ -2588,6 +2885,9 @@ snapshots: prettier@3.3.3: {} + property-expr@2.0.6: + optional: true + punycode@2.3.1: {} queue-microtask@1.2.3: {} @@ -2600,6 +2900,9 @@ snapshots: dependencies: picomatch: 2.3.1 + regenerator-runtime@0.14.1: + optional: true + resolve-from@4.0.0: {} resolve@1.22.8: @@ -2680,6 +2983,15 @@ snapshots: source-map-js@1.2.0: {} + source-map-support@0.5.21: + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + optional: true + + source-map@0.6.1: + optional: true + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -2716,6 +3028,9 @@ snapshots: pirates: 4.0.6 ts-interface-checker: 0.1.13 + superstruct@2.0.2: + optional: true + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -2786,6 +3101,29 @@ snapshots: magic-string: 0.30.11 periscopic: 3.1.0 + sveltekit-superforms@2.17.0(@sveltejs/kit@2.5.24(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18): + dependencies: + '@sveltejs/kit': 2.5.24(@sveltejs/vite-plugin-svelte@3.1.1(svelte@4.2.18)(vite@5.4.2))(svelte@4.2.18)(vite@5.4.2) + devalue: 5.0.0 + just-clone: 6.2.0 + memoize-weak: 1.0.2 + svelte: 4.2.18 + ts-deepmerge: 7.0.1 + optionalDependencies: + '@exodus/schemasafe': 1.3.0 + '@gcornut/valibot-json-schema': 0.31.0 + '@sinclair/typebox': 0.32.35 + '@sodaru/yup-to-json-schema': 2.0.1 + '@vinejs/vine': 1.8.0 + arktype: 2.0.0-beta.0 + joi: 17.13.3 + json-schema-to-ts: 3.1.0 + superstruct: 2.0.2 + valibot: 0.35.0 + yup: 1.4.0 + zod: 3.23.8 + zod-to-json-schema: 3.23.2(zod@3.23.8) + tailwindcss@3.4.10: dependencies: '@alloc/quick-lru': 5.2.0 @@ -2823,6 +3161,9 @@ snapshots: dependencies: any-promise: 1.3.0 + tiny-case@1.0.3: + optional: true + tiny-glob@0.2.9: dependencies: globalyzer: 0.1.0 @@ -2832,18 +3173,32 @@ snapshots: dependencies: is-number: 7.0.0 + toposort@2.0.2: + optional: true + totalist@3.0.1: {} + ts-algebra@2.0.0: + optional: true + ts-api-utils@1.3.0(typescript@5.5.4): dependencies: typescript: 5.5.4 + ts-deepmerge@7.0.1: {} + ts-interface-checker@0.1.13: {} + tslib@2.4.0: + optional: true + type-check@0.4.0: dependencies: prelude-ls: 1.2.1 + type-fest@2.19.0: + optional: true + typescript-eslint@8.2.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4): dependencies: '@typescript-eslint/eslint-plugin': 8.2.0(@typescript-eslint/parser@8.2.0(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4))(eslint@9.9.0(jiti@1.21.6))(typescript@5.5.4) @@ -2869,6 +3224,15 @@ snapshots: util-deprecate@1.0.2: {} + valibot@0.31.1: + optional: true + + valibot@0.35.0: + optional: true + + validator@13.12.0: + optional: true + vite@5.4.2: dependencies: esbuild: 0.21.5 @@ -2906,3 +3270,18 @@ snapshots: yaml@2.5.0: {} yocto-queue@0.1.0: {} + + yup@1.4.0: + dependencies: + property-expr: 2.0.6 + tiny-case: 1.0.3 + toposort: 2.0.2 + type-fest: 2.19.0 + optional: true + + zod-to-json-schema@3.23.2(zod@3.23.8): + dependencies: + zod: 3.23.8 + optional: true + + zod@3.23.8: {} diff --git a/src/app.html b/src/app.html index e3461df3eff6b42492ae91ff9d5fb087d96b2242..94ae4211a6fda7d838a5999014895a9a0c793a27 100644 --- a/src/app.html +++ b/src/app.html @@ -4,6 +4,7 @@ <meta charset="utf-8" /> <link rel="icon" href="%sveltekit.assets%/favicon.png" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> + <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Londrina+Solid|Nunito:400,300"> %sveltekit.head% </head> <body data-sveltekit-preload-data="hover" class="h-full"> diff --git a/src/routes/wip/+page.server.ts b/src/routes/wip/+page.server.ts new file mode 100644 index 0000000000000000000000000000000000000000..83cf5a1be15dd4f60dcae45fea7264b47d269f42 --- /dev/null +++ b/src/routes/wip/+page.server.ts @@ -0,0 +1,43 @@ +import { superValidate } from 'sveltekit-superforms'; +import { zod } from 'sveltekit-superforms/adapters'; +import { schema } from './schema'; +import { fail } from '@sveltejs/kit'; + +type Option = { + value: string; + label: string; +}; + +export async function load() { + const form = await superValidate(zod(schema)); + + const options: Option[] = [ + { value: 'bassu', label: 'Bassu' }, + { value: 'kiwi', label: 'Kiwi' }, + { value: 'isaiah', label: 'Isaiah' }, + { value: 'lorocas', label: 'Lorocas' } + ]; + + return { form, options }; +} + +export const actions = { + async results({ request }) { + const form = await superValidate(request, zod(schema)); + console.log(form); + + if (!form.valid) { + return fail(400, { form }); + } + + return { + form, + solution: 'bassu' + }; + }, + + async next() { + const form = await superValidate(zod(schema)); + return { form }; + } +}; diff --git a/src/routes/wip/+page.svelte b/src/routes/wip/+page.svelte index bf6bdf6474309be3619fa1b7d9a8cefdb4cbc5f4..eb338f293c635a56988ef2c227ba12e183e1671d 100644 --- a/src/routes/wip/+page.svelte +++ b/src/routes/wip/+page.svelte @@ -1,65 +1,96 @@ <script lang="ts"> - import './style.css'; + import { Fieldset, Control, Label } from 'formsnap'; + import SuperDebug, { superForm } from 'sveltekit-superforms'; + + export let data; + export let form; + + const form2 = superForm(data.form, { + // On récupère les valeurs après affichage des résultats + resetForm: false + }); + + const { form: formData, enhance } = form2; - const options = ['option 1', 'option 2', 'option 3', 'option 4']; const question = 1; const questionAmount = 10; const score = 35; </script> -<div class="relative mx-auto my-[50px] w-full max-w-[400px]"> - <section class="relative m-auto flex max-w-[500px] flex-col items-center"> - <h1 class="absolute top-[-2rem]">Qui est-ce ?</h1> - <div class="relative w-[250px]"> - <span class="absolute right-[calc(100%_+_0.5rem)] flex flex-col items-end"> - <span class="text-9xl leading-[0.4] text-[#fa9f9b]"> {question} </span> - <span> / {questionAmount} </span> - </span> - <span - class="absolute right-[calc(100%_+_0.5rem)] top-24 whitespace-nowrap pt-4 text-xl text-[#333] before:absolute before:right-0 before:top-0 before:h-1.5 before:w-10 before:bg-[#333] before:content-['']" - > - {score} - <small>pts</small> - </span> - <div - class="relative z-[2] flex h-[250px] w-[250px] items-center justify-center overflow-hidden rounded-2xl border-6 border-[#333] border-[solid] bg-white before:absolute before:z-[-1] before:h-[100px] before:w-[100px] before:rounded-[50%] before:bg-[#c5d5ee] before:opacity-100 before:transition-[0.65s] before:duration-[ease-in-out] before:content-[''] after:absolute after:z-[-1] after:h-[100px] after:w-[100px] after:scale-0 after:rounded-[50%] after:border-[#c5d5ee] after:border-[solid] after:transition-[0.4s] after:duration-[ease-in-out] after:content-['']" - class:poke-image-success={false} - class:poke-image-error={false} - > - <img src={'image'} alt="No cheating" class="h-[150px] w-auto" /> - </div> - <transition-group - tag="div" - name="animate-options" - class:poke-options-answers={false} - class="relative top-[-30px] z-[3] mx-auto my-0 flex w-[170px] flex-col items-center space-y-1 rounded-2xl bg-[#333] px-5 py-0" - > - {#each options as option, index} - <button - data-index={index} - class:selected={false} - class:success={false} - class:error={false} - class="relative max-h-14 w-full min-w-[200px] cursor-pointer overflow-hidden rounded-2xl border-6 border-[#333] border-[solid] bg-[#c5d5ee] p-[0.5em] text-lg transition-[0.45s] [font-family:'Londrina_Solid',monospace] before:absolute before:left-2/4 before:top-2/4 before:z-[-1] before:h-[200px] before:w-[200px] before:-translate-x-2/4 before:-translate-y-2/4 before:scale-0 before:rounded-[50%] before:bg-[#94acbd] before:transition-[0.2s] before:duration-[ease-in-out] before:content-[''] hover:translate-y-[-3px] hover:bg-[#a9c1e6] focus:[outline:none] active:before:-translate-x-2/4 active:before:-translate-y-2/4 active:before:scale-100" - on:click={() => {}}>{option}</button - > - {/each} - </transition-group> - <footer class="space-y-1.5 text-center sm:absolute sm:left-full sm:top-5"> - <button - disabled={false} - class="h-[100px] w-[110px] cursor-pointer rounded-2xl border-transparent bg-[#f32c22] p-[1em] text-2xl text-white transition-[0.35s] duration-300 [font-family:'Londrina_Solid',monospace] focus:border focus:border-dotted focus:border-[#f87f79] focus:[outline:none] enabled:hover:translate-x-0 enabled:hover:bg-[#333] enabled:hover:text-[#f65a52] disabled:cursor-default disabled:text-[#fa9f9b] disabled:opacity-70 sm:-translate-x-2.5 sm:rounded-bl-none sm:rounded-tl-none" - on:click={() => {}}>OK</button +<form method="post" use:enhance> + <div class="relative mx-auto my-[50px] w-full max-w-[400px]"> + <section class="relative m-auto flex max-w-[500px] flex-col items-center"> + <h1 class="absolute top-[-2rem] text-xl">Qui est-ce ?</h1> + <div class="relative w-[250px]"> + <span class="absolute right-[calc(100%_+_0.5rem)] flex flex-col items-end"> + <span class="text-9xl leading-[0.4] text-[#fa9f9b]"> {question} </span> + <span> / {questionAmount} </span> + </span> + <span + class="absolute right-[calc(100%_+_0.5rem)] top-24 whitespace-nowrap pt-4 text-xl text-[#333] before:absolute before:right-0 before:top-0 before:h-1.5 before:w-10 before:bg-[#333] before:content-['']" > - <button - disabled={true} - class="h-[100px] w-[110px] cursor-pointer rounded-2xl border-transparent bg-[#f32c22] p-[1em] text-2xl text-white transition-[0.35s] duration-300 [font-family:'Londrina_Solid',monospace] focus:border focus:border-dotted focus:border-[#f87f79] focus:[outline:none] enabled:hover:translate-x-0 enabled:hover:bg-[#333] enabled:hover:text-[#f65a52] disabled:cursor-default disabled:text-[#fa9f9b] disabled:opacity-70 sm:-translate-x-2.5 sm:rounded-bl-none sm:rounded-tl-none" - on:click={() => {}}>Suivant</button + {score} + <small>pts</small> + </span> + <div + class="relative z-[2] flex h-[250px] w-[250px] items-center justify-center overflow-hidden rounded-2xl border-6 border-[#333] border-[solid] bg-white before:absolute before:z-[-1] before:h-[100px] before:w-[100px] before:rounded-[50%] before:bg-[#c5d5ee] before:opacity-100 before:transition-[0.65s] before:duration-[ease-in-out] before:content-[''] after:absolute after:z-[-1] after:h-[100px] after:w-[100px] after:scale-0 after:rounded-[50%] after:border-[#c5d5ee] after:border-[solid] after:transition-[0.4s] after:duration-[ease-in-out] after:content-['']" > - </footer> - </div> - </section> -</div> + <img src={'/bassu.jpg'} alt="Pas de triche" class="w-auto" /> + </div> + <Fieldset form={form2} name="choice"> + <transition-group + tag="div" + name="animate-options" + class="relative top-[-30px] z-[3] mx-auto my-0 flex w-[170px] flex-col items-center space-y-1 rounded-2xl bg-[#333] px-5 py-0" + > + {#each data.options as option} + <div class="max-h-14 w-full min-w-[200px]"> + <Control let:attrs> + <input + type="radio" + {...attrs} + bind:group={$formData.choice} + value={option.value} + class="peer sr-only" + disabled={form?.solution !== undefined} + data-valid={(form?.solution && option.value === form?.solution) || null} + /> + <Label + tabindex={0} + data-solution={form?.solution || null} + class="focus:border-[#888] relative block cursor-pointer select-none overflow-hidden rounded-2xl border-6 border-[#333] border-[solid] bg-[#c5d5ee] p-[0.5em] text-center text-lg transition-[0.45s] [font-family:'Londrina_Solid',monospace] before:absolute before:left-2/4 before:top-2/4 before:z-[-1] before:h-[200px] before:w-[200px] before:-translate-x-2/4 before:-translate-y-2/4 before:scale-0 before:rounded-[50%] before:bg-[#94acbd] before:transition-[0.2s] before:duration-[ease-in-out] before:content-[''] hover:translate-y-[-3px] hover:bg-[#a9c1e6] focus:[outline:none] active:before:-translate-x-2/4 active:before:-translate-y-2/4 active:before:scale-100 peer-checked:bg-[#94acbd] data-[solution]:cursor-default data-[solution]:text-[#94acbd] peer-checked:data-[solution]:bg-[#ff8b62] peer-checked:data-[solution]:text-inherit peer-data-[valid]:!bg-[#7bd55a] peer-data-[valid]:text-inherit" + > + {option.label} + </Label> + </Control> + </div> + {/each} + </transition-group> + </Fieldset> + <footer class="space-y-1.5 text-center sm:absolute sm:left-full sm:top-5"> + <button + type="submit" + formaction="?/results" + disabled={form?.solution !== undefined} + class="h-[100px] w-[110px] cursor-pointer rounded-2xl border-transparent bg-[#f32c22] p-[1em] text-2xl text-white transition-[0.35s] duration-300 [font-family:'Londrina_Solid',monospace] focus:border focus:border-dotted focus:border-[#f87f79] focus:[outline:none] enabled:hover:translate-x-0 enabled:hover:bg-[#333] enabled:hover:text-[#f65a52] disabled:cursor-default disabled:text-[#fa9f9b] disabled:opacity-70 sm:-translate-x-2.5 sm:rounded-bl-none sm:rounded-tl-none" + > + OK + </button> + <button + type="submit" + formaction="?/next" + disabled={form?.solution === undefined} + class="h-[100px] w-[110px] cursor-pointer rounded-2xl border-transparent bg-[#f32c22] p-[1em] text-2xl text-white transition-[0.35s] duration-300 [font-family:'Londrina_Solid',monospace] focus:border focus:border-dotted focus:border-[#f87f79] focus:[outline:none] enabled:hover:translate-x-0 enabled:hover:bg-[#333] enabled:hover:text-[#f65a52] disabled:cursor-default disabled:text-[#fa9f9b] disabled:opacity-70 sm:-translate-x-2.5 sm:rounded-bl-none sm:rounded-tl-none" + > + Suivant + </button> + </footer> + </div> + </section> + </div> +</form> + +<SuperDebug data={formData} /> <style> :global(body) { diff --git a/src/routes/wip/schema.ts b/src/routes/wip/schema.ts new file mode 100644 index 0000000000000000000000000000000000000000..f551c4aebbe85bfa8eb3e6bcb2319432152ff2c2 --- /dev/null +++ b/src/routes/wip/schema.ts @@ -0,0 +1,5 @@ +import { z } from 'zod'; + +export const schema = z.object({ + choice: z.string(), +}); diff --git a/src/routes/wip/style.css b/src/routes/wip/style.css deleted file mode 100644 index 7909bbbfaddc67ebe432ff0cfb036d57108d3cd5..0000000000000000000000000000000000000000 --- a/src/routes/wip/style.css +++ /dev/null @@ -1,5 +0,0 @@ -/* @import 'https://fonts.googleapis.com/css?family=VT323'; */ -@import 'https://fonts.googleapis.com/css?family=Londrina+Solid|Nunito:400,300'; -* { - box-sizing: border-box; -}