diff --git a/app/components/ImageCard.vue b/app/components/ImageCard.vue new file mode 100644 index 0000000..0fd2f5a --- /dev/null +++ b/app/components/ImageCard.vue @@ -0,0 +1,25 @@ + + + + + diff --git a/app/components/index/Roadmap/RoadmapStack.vue b/app/components/index/Roadmap/RoadmapStack.vue index 2dd59eb..b6d2ebf 100644 --- a/app/components/index/Roadmap/RoadmapStack.vue +++ b/app/components/index/Roadmap/RoadmapStack.vue @@ -2,8 +2,8 @@ const props = defineProps<{ isReversed: boolean; imgSource: string; - header: string; - body: string; + title: string; + description: string; }>(); const flexDir = ref(props.isReversed ? "row-reverse" : "row"); @@ -16,8 +16,8 @@ const flexDir = ref(props.isReversed ? "row-reverse" : "row"); >
- -

{{ props.body }}

+ +

{{ props.description }}

diff --git a/app/components/index/RoadmapSection.vue b/app/components/index/RoadmapSection.vue index e32c8d1..dbd374c 100644 --- a/app/components/index/RoadmapSection.vue +++ b/app/components/index/RoadmapSection.vue @@ -1,10 +1,11 @@ - diff --git a/app/components/visuals/GeneratedStars.vue b/app/components/visuals/GeneratedStars.vue index 1571c62..c80961d 100644 --- a/app/components/visuals/GeneratedStars.vue +++ b/app/components/visuals/GeneratedStars.vue @@ -1,24 +1,53 @@ - + + diff --git a/app/composables/fetch/useFetchRoadmap.ts b/app/composables/fetch/useFetchRoadmap.ts index 9f87dbb..ac13e7a 100644 --- a/app/composables/fetch/useFetchRoadmap.ts +++ b/app/composables/fetch/useFetchRoadmap.ts @@ -1,10 +1,15 @@ import type { Database } from "~/types/database.types"; +/** + * Use to fetch data via ascending order at roadmap page. + * + * @returns {any[]} data - Data from the table based on the schema. + */ export async function useFetchRoadmap() { const client = useSupabaseClient(); const { data, error } = await client - .from("index_roadmap") + .from("roadmap") .select(`*, images (id, image_url, unique_id)`) .order("index", { ascending: true }); @@ -12,3 +17,28 @@ export async function useFetchRoadmap() { return data; } + + +/** + * Use to fetch data in the home page. + * + * @param {string} range - Range of items that can be fetched + * + * @returns {any[]} data - Data from the table based on the schema. + * + * @example + * const foo = useFetchRoadmapRange("4") + */ +export async function useFetchRoadmapRange(range: string) { + const client = useSupabaseClient(); + + const { data, error } = await client + .from("roadmap") + .select(`*, images (id, image_url, unique_id)`) + .lte("index", range) + .order("index", { ascending: true }); + + if (error) throw error; + + return data; +} diff --git a/app/composables/index.ts b/app/composables/index.ts index fae8fec..9a63c75 100644 --- a/app/composables/index.ts +++ b/app/composables/index.ts @@ -1,6 +1,6 @@ export { useFetchImage, useFetchImageWithDate } from "./fetch/useFetchImage"; export { useFetchDimDate } from "./fetch/useFetchDimDate"; -export { useFetchRoadmap } from "./fetch/useFetchRoadmap"; +export { useFetchRoadmap, useFetchRoadmapRange } from "./fetch/useFetchRoadmap"; export { useFetchMemories } from "./fetch/useFetchMemories"; export { useInsertDatePlan } from "./insert/useInsertDatePlan"; diff --git a/app/layouts/login.vue b/app/layouts/login.vue index efbf8ff..9566162 100644 --- a/app/layouts/login.vue +++ b/app/layouts/login.vue @@ -1,5 +1,5 @@ diff --git a/app/pages/gallery.vue b/app/pages/gallery.vue index 834c1bd..ff1e905 100644 --- a/app/pages/gallery.vue +++ b/app/pages/gallery.vue @@ -6,6 +6,7 @@ definePageMeta({