diff --git a/frontend/app.vue b/frontend/app.vue index 7cd4dbe..dd43ce5 100644 --- a/frontend/app.vue +++ b/frontend/app.vue @@ -14,7 +14,7 @@ import { VueQueryDevtools } from "@tanstack/vue-query-devtools"; diff --git a/frontend/assets/css/animations.css b/frontend/assets/css/animations.css new file mode 100644 index 0000000..9749855 --- /dev/null +++ b/frontend/assets/css/animations.css @@ -0,0 +1,84 @@ +/* + Zoom animation +*/ + +.zoom-leave-active, +.zoom-enter-active { + transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; +} + +.zoom-enter-to, +.zoom-leave-from { + opacity: 1; + transform: scale(1) translateY(0px); +} + +.zoom-enter-from, +.zoom-leave-to { + opacity: 0; + transform: scale(0.95) translateY(15px); +} + +/* + Fade animation +*/ + +.fade-leave-active, +.fade-enter-active { + transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; +} + +.fade-enter-to, +.fade-leave-from { + opacity: 1; + transform: scale(1); +} + +.fade-enter-from, +.fade-leave-to { + opacity: 0; + transform: scale(0.95); +} + +/* + FadeDown animation +*/ + +.fade-down-leave-active, +.fade-down-enter-active { + transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; +} + +.fade-down-enter-to, +.fade-down-leave-from { + opacity: 1; + transform: translateY(0px) scale(1); +} + +.fade-down-enter-from, +.fade-down-leave-to { + opacity: 0; + transform: translateY(10px) scale(0.95); +} + +/* + FadeRightToLeft animation +*/ + +.fade-right-to-left-leave-active, +.fade-right-to-left-enter-active { + transform-origin: bottom right; + transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out; +} + +.fade-right-to-left-enter-to, +.fade-right-to-left-leave-from { + opacity: 1; + transform: translateX(0px) scale(1); +} + +.fade-right-to-left-enter-from, +.fade-right-to-left-leave-to { + opacity: 0; + transform: translateX(30px) scale(0.95); +} \ No newline at end of file diff --git a/frontend/assets/css/tailwind.css b/frontend/assets/css/tailwind.css index 1ce8cae..b2745e7 100644 --- a/frontend/assets/css/tailwind.css +++ b/frontend/assets/css/tailwind.css @@ -1,5 +1,6 @@ @import "tailwindcss"; +@import "./animations.css"; @import "./other.utils.css"; @import "./typo.utils.css"; @import "./button.comp.css"; diff --git a/frontend/components/global/CategoryCard.vue b/frontend/components/global/CategoryCard.vue index f62fa67..33be331 100644 --- a/frontend/components/global/CategoryCard.vue +++ b/frontend/components/global/CategoryCard.vue @@ -2,31 +2,47 @@ // types +import { useImageColor } from "~/composables/useImageColor"; + type Props = { + id: number, category: string; count: number; description: string; picture: string; + darkLayer?: boolean; } // props -defineProps(); +const props = defineProps(); +const { id } = toRefs(props); + +// state + +const { colorObject } = useImageColor(`#category-image-${id.value}`);