2024-09-24 19:51:28 +02:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import type { ProjectShallow } from '~/types'
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
group: {
|
|
|
|
title: string
|
|
|
|
projects: ProjectShallow[]
|
|
|
|
}
|
|
|
|
}>()
|
|
|
|
|
|
|
|
const { switcher } = storeToRefs(useData())
|
|
|
|
|
|
|
|
const groupCollapsed = ref(false)
|
|
|
|
|
2024-09-27 12:14:49 +02:00
|
|
|
const shownProjectsCount = ref(10)
|
2024-09-24 19:51:28 +02:00
|
|
|
|
|
|
|
const shownProjects = computed(() => props.group.projects.slice(0, shownProjectsCount.value))
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div w-full>
|
|
|
|
<div
|
|
|
|
flex
|
|
|
|
items-center
|
|
|
|
gap-x-12px
|
|
|
|
w-full
|
|
|
|
mb="-8px lg:8px"
|
|
|
|
>
|
|
|
|
<h2
|
|
|
|
text="app-white 16px lg:24px"
|
|
|
|
font-700
|
|
|
|
leading="24px lg:32px"
|
|
|
|
whitespace-nowrap
|
|
|
|
>
|
|
|
|
{{ group.projects.length }} {{ group.title }}
|
|
|
|
</h2>
|
|
|
|
<div
|
|
|
|
h-2px
|
|
|
|
w-full
|
|
|
|
bg-app-text-grey
|
|
|
|
/>
|
|
|
|
<button
|
|
|
|
type="button"
|
2024-09-27 12:14:49 +02:00
|
|
|
:class="[groupCollapsed ? 'i-ic-baseline-arrow-drop-down' : 'i-ic-baseline-arrow-drop-up']"
|
2024-09-24 19:51:28 +02:00
|
|
|
text="app-text-grey 24px"
|
|
|
|
@click="groupCollapsed = !groupCollapsed"
|
|
|
|
/>
|
|
|
|
</div>
|
2024-10-03 15:59:25 +02:00
|
|
|
<ClientOnly>
|
|
|
|
<ProjectGridGroupSort
|
|
|
|
v-if="!groupCollapsed"
|
|
|
|
:hidden-columns="group.title === 'Social & Communications' ? ['technology'] : []"
|
|
|
|
/>
|
|
|
|
<template #fallback>
|
|
|
|
<div
|
|
|
|
h-48px
|
|
|
|
w-full
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</ClientOnly>
|
2024-09-24 19:51:28 +02:00
|
|
|
<div
|
|
|
|
v-if="!groupCollapsed"
|
|
|
|
grid
|
|
|
|
:class="switcher ? 'grid-cols-1 lg:grid-cols-1' : 'xl:grid-cols-3 lg:grid-cols-3 sm:grid-cols-2 grid-cols-1'"
|
|
|
|
gap-16px
|
|
|
|
text-white
|
|
|
|
w-full
|
|
|
|
mt="-16px lg:0"
|
|
|
|
mb-8px
|
|
|
|
>
|
|
|
|
<ClientOnly>
|
|
|
|
<Card
|
|
|
|
v-for="project in group.projects.slice(0, shownProjectsCount)"
|
|
|
|
:key="project.id"
|
2024-10-03 15:59:25 +02:00
|
|
|
:hidden-columns="group.title === 'Social & Communications' ? ['technology'] : []"
|
2024-09-24 19:51:28 +02:00
|
|
|
:project="project"
|
|
|
|
/>
|
2024-09-25 12:38:51 +02:00
|
|
|
|
2024-09-24 19:51:28 +02:00
|
|
|
<template #fallback>
|
2024-09-25 12:38:51 +02:00
|
|
|
<CardSkeletor
|
|
|
|
v-for="i in 6"
|
|
|
|
:key="i"
|
|
|
|
/>
|
2024-09-24 19:51:28 +02:00
|
|
|
</template>
|
|
|
|
</ClientOnly>
|
|
|
|
</div>
|
|
|
|
<ClientOnly>
|
|
|
|
<button
|
|
|
|
v-if="group.projects.length > shownProjects.length && !groupCollapsed"
|
|
|
|
type="button"
|
|
|
|
text="12px lg:14px"
|
|
|
|
leading="24px lg:32px"
|
|
|
|
font-bold
|
2024-10-03 15:59:25 +02:00
|
|
|
mt-24px
|
|
|
|
px-16px
|
|
|
|
py-4px
|
2024-09-24 19:51:28 +02:00
|
|
|
text-app-text-grey
|
2024-10-03 15:59:25 +02:00
|
|
|
border="2px white/50"
|
2024-09-24 19:51:28 +02:00
|
|
|
@click="shownProjectsCount += 15"
|
|
|
|
>
|
|
|
|
LOAD MORE
|
|
|
|
</button>
|
|
|
|
</ClientOnly>
|
|
|
|
</div>
|
|
|
|
</template>
|