diff --git a/package.json b/package.json index 6682153..be4d5f1 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@astrojs/tailwind": "^5.1.4", "@astrojs/vue": "^5.0.4", "@googleapis/sheets": "^9.3.1", + "@headlessui/vue": "^1.7.23", "@iconify-json/material-symbols": "^1.2.12", "@vueuse/core": "^12.3.0", "astro": "^5.1.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ccd638f..8e5b74f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@googleapis/sheets': specifier: ^9.3.1 version: 9.3.1 + '@headlessui/vue': + specifier: ^1.7.23 + version: 1.7.23(vue@3.5.13(typescript@5.7.3)) '@iconify-json/material-symbols': specifier: ^1.2.12 version: 1.2.12 @@ -535,6 +538,12 @@ packages: resolution: {integrity: sha512-nPgzOiDs/FSFhE+dX2KfkmsmkXM3WfXYP06FoW8cXvHshwxHSI3FbXwe5XJYstDAWXP9YA7AMSvmwnuD4OAl2w==} engines: {node: '>=12.0.0'} + '@headlessui/vue@1.7.23': + resolution: {integrity: sha512-JzdCNqurrtuu0YW6QaDtR2PIYCKPUWq28csDyMvN4zmGccmE7lz40Is6hc3LA4HFeCI7sekZ/PQMTNmn9I/4Wg==} + engines: {node: '>=10'} + peerDependencies: + vue: ^3.2.0 + '@iconify-json/material-symbols@1.2.12': resolution: {integrity: sha512-2p2T13Kccy7R2HNbdiVsIcHxjp4s9a+iKlfbtt29hldG1pVNaPIlMALNA9bjdEwPjwsVFe06INCbjCRc68JysQ==} @@ -828,6 +837,14 @@ packages: resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} engines: {node: '>=18'} + '@tanstack/virtual-core@3.11.2': + resolution: {integrity: sha512-vTtpNt7mKCiZ1pwU9hfKPhpdVO2sVzFQsxoVBGtOSHxlrRRzYr8iQ2TlwbAcRYCcEiZ9ECAM8kBzH0v2+VzfKw==} + + '@tanstack/vue-virtual@3.11.2': + resolution: {integrity: sha512-y0b1p1FTlzxcSt/ZdGWY1AZ52ddwSU69pvFRYAELUSdLLxV8QOPe9dyT/KATO43UCb3DAwiyzi96h2IoYstBOQ==} + peerDependencies: + vue: ^2.7.0 || ^3.0.0 + '@types/cookie@0.6.0': resolution: {integrity: sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==} @@ -3104,6 +3121,11 @@ snapshots: - encoding - supports-color + '@headlessui/vue@1.7.23(vue@3.5.13(typescript@5.7.3))': + dependencies: + '@tanstack/vue-virtual': 3.11.2(vue@3.5.13(typescript@5.7.3)) + vue: 3.5.13(typescript@5.7.3) + '@iconify-json/material-symbols@1.2.12': dependencies: '@iconify/types': 2.0.0 @@ -3349,6 +3371,13 @@ snapshots: '@sindresorhus/merge-streams@4.0.0': {} + '@tanstack/virtual-core@3.11.2': {} + + '@tanstack/vue-virtual@3.11.2(vue@3.5.13(typescript@5.7.3))': + dependencies: + '@tanstack/virtual-core': 3.11.2 + vue: 3.5.13(typescript@5.7.3) + '@types/cookie@0.6.0': {} '@types/debug@4.1.12': diff --git a/src/assets/style.css b/src/assets/style.css index 6f84aba..d4cdf6c 100644 --- a/src/assets/style.css +++ b/src/assets/style.css @@ -73,3 +73,14 @@ body { transform: translateX(20%); } } + +:root { + --popper-theme-background-color: theme(colors.gray.800); + --popper-theme-background-color-hover: theme(colors.gray.800); + --popper-theme-text-color: theme(colors.white); + --popper-theme-border-width: 0px; + --popper-theme-border-style: solid; + --popper-theme-border-radius: theme(borderRadius.md); + --popper-theme-padding: theme(spacing.4); + --popper-theme-box-shadow: theme(boxShadow.sm); +} diff --git a/src/components/AnswerButton.vue b/src/components/AnswerButton.vue index a28bdd6..abb786b 100644 --- a/src/components/AnswerButton.vue +++ b/src/components/AnswerButton.vue @@ -1,11 +1,11 @@ + + diff --git a/src/components/Results.vue b/src/components/Results.vue deleted file mode 100644 index 67f829a..0000000 --- a/src/components/Results.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/src/pages/index.astro b/src/pages/index.astro index 7e115a9..9a834bb 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,7 +1,7 @@ --- import { getCollection } from 'astro:content' import Layout from '../layouts/Layout.astro' -import App from '../components/App.vue' +import App from './index.vue' const questions = (await getCollection('questions')).map((q) => q.data) --- diff --git a/src/components/App.vue b/src/pages/index.vue similarity index 94% rename from src/components/App.vue rename to src/pages/index.vue index 462c380..daec42f 100644 --- a/src/components/App.vue +++ b/src/pages/index.vue @@ -1,8 +1,8 @@ + + + + diff --git a/src/components/Weights.vue b/src/views/Weights.vue similarity index 64% rename from src/components/Weights.vue rename to src/views/Weights.vue index cef5c21..2b3b55b 100644 --- a/src/components/Weights.vue +++ b/src/views/Weights.vue @@ -60,13 +60,18 @@ input[type='checkbox'] { } input[type='checkbox']::before { - content: ''; - @apply flex motion-safe:transition-opacity motion-safe:duration-150 opacity-0 absolute inset-0 text-lg rounded-full items-center justify-center text-white bg-gray-800; - background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMTAgMTdIN3EtLjgyNSAwLTEuNDEyLS41ODdUNSAxNXYtMnEwLS44MjUuNTg4LTEuNDEyVDcgMTFoMlY5SDZxLS40MjUgMC0uNzEyLS4yODhUNSA4dC4yODgtLjcxMlQ2IDdoM3EuODI1IDAgMS40MTMuNTg4VDExIDl2MnEwIC44MjUtLjU4NyAxLjQxM1Q5IDEzSDd2MmgzcS40MjUgMCAuNzEzLjI4OFQxMSAxNnQtLjI4OC43MTNUMTAgMTdtNi0zLjMyNWwtMS43NSAyLjlxLS4xMjUuMi0uMzEyLjMxM3QtLjQxMy4xMTJxLS41IDAtLjc2My0uNDM3dC4wMTMtLjg2M0wxNSAxMmwtMi4yMjUtMy43cS0uMjc1LS40MjUtLjAxMi0uODYyVDEzLjUyNSA3cS4yMjUgMCAuNDEzLjExM3QuMzEyLjMxMmwxLjc1IDIuOWwxLjc1LTIuOXEuMTI1LS4yLjMxMy0uMzEyVDE4LjQ3NSA3cS41IDAgLjc2My40Mzh0LS4wMTMuODYyTDE3IDEybDIuMjI1IDMuN3EuMjc1LjQyNS4wMTMuODYzdC0uNzYzLjQzN3EtLjIyNSAwLS40MTMtLjExMnQtLjMxMi0uMzEzeiIvPjwvc3ZnPg=='); + content: 'x2'; + @apply flex motion-safe:transition motion-safe:duration-150 absolute inset-0 rounded-full items-center justify-center text-gray-500 opacity-0; background-size: 100%; } -input[type='checkbox']::before:checked { +input[type='checkbox']:checked::before, +input[type='checkbox']:hover::before, +input[type='checkbox']:focus::before { @apply opacity-100; } + +input[type='checkbox']::before:checked { + @apply text-white bg-gray-800; +}