From 825f4059fcf217d52c38917b1d20d34d5899f815 Mon Sep 17 00:00:00 2001 From: marzban-dev Date: Tue, 28 Jan 2025 19:50:48 +0330 Subject: [PATCH 01/30] Add animate.css --- frontend/package-lock.json | 7 +++++++ frontend/package.json | 1 + 2 files changed, 8 insertions(+) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 0f47a9a..2fb8544 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -16,6 +16,7 @@ "@vuelidate/validators": "^2.0.4", "@vueuse/integrations": "^12.4.0", "@vueuse/nuxt": "^12.3.0", + "animate.css": "^4.1.1", "axios": "^1.7.9", "fast-average-color": "^9.4.0", "gsap": "^3.12.5", @@ -3685,6 +3686,12 @@ "node": ">= 6.0.0" } }, + "node_modules/animate.css": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/animate.css/-/animate.css-4.1.1.tgz", + "integrity": "sha512-+mRmCTv6SbCmtYJCN4faJMNFVNN5EuCTTprDTAo7YzIGji2KADmakjVA3+8mVDkZ2Bf09vayB35lSQIex2+QaQ==", + "license": "MIT" + }, "node_modules/ansi-colors": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", diff --git a/frontend/package.json b/frontend/package.json index 62449d0..5fada15 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -21,6 +21,7 @@ "@vuelidate/validators": "^2.0.4", "@vueuse/integrations": "^12.4.0", "@vueuse/nuxt": "^12.3.0", + "animate.css": "^4.1.1", "axios": "^1.7.9", "fast-average-color": "^9.4.0", "gsap": "^3.12.5", From 532ad4ebf192d406157b49bc74c70710e23783c7 Mon Sep 17 00:00:00 2001 From: marzban-dev Date: Tue, 28 Jan 2025 19:51:04 +0330 Subject: [PATCH 02/30] Add page transitions --- frontend/nuxt.config.ts | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts index 385145b..92ea721 100644 --- a/frontend/nuxt.config.ts +++ b/frontend/nuxt.config.ts @@ -3,24 +3,34 @@ export default defineNuxtConfig({ compatibilityDate: "2024-11-01", ssr: true, devtools: { enabled: true }, - css: ["~/assets/css/tailwind.css", "swiper/css"], + css: ["~/assets/css/tailwind.css", "swiper/css", "animate.css/animate.min.css"], routeRules: { - "/products": { prerender: false, ssr: false }, + "/products": { prerender: false, ssr: false } + }, + + app: { + pageTransition: { + enterActiveClass: + "animate__animated animate__fadeIn animate__faster", + leaveActiveClass: + "animate__animated animate__fadeOut animate__faster", + mode: "out-in" + } }, postcss: { plugins: { "@tailwindcss/postcss": {}, - autoprefixer: {}, - }, + autoprefixer: {} + } }, components: [ { path: "~/components", - pathPrefix: false, - }, + pathPrefix: false + } ], icon: { @@ -28,9 +38,9 @@ export default defineNuxtConfig({ customCollections: [ { prefix: "ci", - dir: "./public/icons", - }, - ], + dir: "./public/icons" + } + ] }, modules: [ @@ -41,9 +51,9 @@ export default defineNuxtConfig({ "DM Sans": "100..900", Inter: "100..900", download: true, - inject: false, - }, - }, + inject: false + } + } ], "@nuxt/icon", "reka-ui/nuxt", @@ -53,7 +63,7 @@ export default defineNuxtConfig({ runtimeConfig: { public: { - API_BASE_URL: "https://api.heymlz.com", - }, - }, + API_BASE_URL: "https://api.heymlz.com" + } + } }); From d65d3bd907075b13006f257316a98076edccf72c Mon Sep 17 00:00:00 2001 From: marzban-dev Date: Tue, 28 Jan 2025 19:51:29 +0330 Subject: [PATCH 03/30] Update types --- frontend/types/global.d.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/types/global.d.ts b/frontend/types/global.d.ts index 147e603..3100cff 100644 --- a/frontend/types/global.d.ts +++ b/frontend/types/global.d.ts @@ -51,9 +51,21 @@ declare global { meta_title: string; meta_description: string; parent: number; - children: "string"; + "product_count": string, + "subcategorys": SubCategory[] }; + type SubCategory = { + "id": number, + "name": string, + "slug": string, + "icon": string, + "meta_title": string, + "meta_description": string, + "product_count": string, + "show": boolean + } + type Address = { id: number; province: string; From 1355a776fa813b1e5acf19520f8cbdf69cf643f4 Mon Sep 17 00:00:00 2001 From: marzban-dev Date: Tue, 28 Jan 2025 19:54:22 +0330 Subject: [PATCH 04/30] Updated --- frontend/pages/category.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/pages/category.vue b/frontend/pages/category.vue index 218cae3..56ffa91 100644 --- a/frontend/pages/category.vue +++ b/frontend/pages/category.vue @@ -15,17 +15,18 @@ const debouncedSearch = refDebounced(search, 300); const filteredCategories = computed(() => { if (debouncedSearch.value.length > 0) { - return categories.value!.filter((cat) => + return categories.value?.filter((cat) => cat.name.includes(debouncedSearch.value) ); } - return categories.value!; + return categories.value; }); -// lifecycle +// ssr + +await useAsyncData(async () => { -onServerPrefetch(async () => { const response = await suspense(); if (response.isError) { @@ -34,7 +35,8 @@ onServerPrefetch(async () => { statusMessage: `Error in categories page prefetch`, }); } -}); +}) +