2023-12-19 18:43:42 +01:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import type { ProjectShallow } from '~/types'
|
|
|
|
|
|
|
|
const props = defineProps<{
|
2024-09-12 08:42:37 +02:00
|
|
|
projects: { title: string, projects: ProjectShallow[] }[]
|
2023-12-19 18:43:42 +01:00
|
|
|
}>()
|
|
|
|
const { switcher } = storeToRefs(useData())
|
|
|
|
|
|
|
|
const displayCount = ref(100)
|
|
|
|
const displayedProjects = computed(() => props.projects.slice(0, displayCount.value))
|
|
|
|
function showMoreProjects() {
|
|
|
|
displayCount.value += 50
|
|
|
|
}
|
2024-09-03 17:13:23 +02:00
|
|
|
|
|
|
|
const cardTitles = ref< { label: string, togglable?: boolean, toggled?: boolean }[]>([
|
|
|
|
{ label: 'Usecase' },
|
|
|
|
{ label: 'Openess', togglable: true },
|
|
|
|
{ label: 'Technology', togglable: true },
|
|
|
|
{ label: 'Privacy', togglable: true },
|
|
|
|
{ label: 'Ecosystem' },
|
|
|
|
{ label: 'Links' },
|
|
|
|
{ label: 'W3PN Score', togglable: true },
|
|
|
|
])
|
2023-12-19 18:43:42 +01:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2024-09-02 15:13:43 +02:00
|
|
|
<div
|
|
|
|
flex
|
|
|
|
flex-col
|
|
|
|
items-start
|
|
|
|
>
|
2024-09-12 08:42:37 +02:00
|
|
|
<template
|
|
|
|
v-for="group in projects"
|
|
|
|
:key="group.title"
|
2024-09-03 17:13:23 +02:00
|
|
|
>
|
|
|
|
<div
|
2024-09-12 08:42:37 +02:00
|
|
|
|
2024-09-03 17:13:23 +02:00
|
|
|
flex
|
|
|
|
items-center
|
2024-09-12 08:42:37 +02:00
|
|
|
gap-x-12px
|
|
|
|
w-full
|
|
|
|
mb="8px lg:16px"
|
|
|
|
mt-22px
|
2024-09-03 17:13:23 +02:00
|
|
|
>
|
2024-09-12 08:42:37 +02:00
|
|
|
<h2
|
|
|
|
text="app-white 16px lg:24px"
|
|
|
|
font-700
|
|
|
|
leading="24px lg:32px"
|
2024-09-03 17:13:23 +02:00
|
|
|
whitespace-nowrap
|
|
|
|
>
|
2024-09-12 08:42:37 +02:00
|
|
|
{{ group.projects.length }} {{ group.title }}
|
|
|
|
</h2>
|
|
|
|
<div
|
|
|
|
h-2px
|
|
|
|
w-full
|
|
|
|
bg-app-text-grey
|
|
|
|
/>
|
2024-09-03 17:13:23 +02:00
|
|
|
<button
|
|
|
|
type="button"
|
2024-09-12 08:42:37 +02:00
|
|
|
i-ic-baseline-arrow-drop-down
|
|
|
|
text="app-text-grey 24px"
|
2024-09-03 17:13:23 +02:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div
|
2024-09-12 08:42:37 +02:00
|
|
|
grid
|
|
|
|
grid-cols="2 lg:10"
|
2024-09-03 17:13:23 +02:00
|
|
|
w-full
|
2024-09-12 08:42:37 +02:00
|
|
|
mb-16px
|
2024-09-03 17:13:23 +02:00
|
|
|
>
|
2024-09-12 08:42:37 +02:00
|
|
|
<div
|
|
|
|
flex
|
|
|
|
items-center
|
|
|
|
gap-4px
|
|
|
|
col-span="1 lg:3"
|
|
|
|
>
|
|
|
|
<p
|
|
|
|
text="12px lg:14px app-text-grey"
|
|
|
|
leading="16px lg:24px"
|
|
|
|
whitespace-nowrap
|
|
|
|
>
|
|
|
|
Project name
|
|
|
|
</p>
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
i-ic-baseline-arrow-drop-down
|
|
|
|
text="app-text-grey 20px"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
flex
|
|
|
|
items-center
|
|
|
|
justify-end
|
|
|
|
gap-4px
|
|
|
|
lg:hidden
|
|
|
|
>
|
|
|
|
<p
|
|
|
|
text="12px lg:14px app-text-grey"
|
|
|
|
leading="16px lg:24px"
|
|
|
|
>
|
|
|
|
Sort by:
|
|
|
|
</p>
|
|
|
|
<p
|
|
|
|
text="12px lg:14px"
|
|
|
|
leading="16px lg:24px"
|
|
|
|
font-700
|
|
|
|
>
|
|
|
|
Score
|
|
|
|
</p>
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
i-ic-baseline-arrow-drop-down
|
|
|
|
text="app-text-grey 20px"
|
|
|
|
/>
|
|
|
|
</div>
|
2024-09-03 17:13:23 +02:00
|
|
|
<div
|
|
|
|
v-for="title in cardTitles"
|
|
|
|
:key="title.label"
|
2024-09-12 08:42:37 +02:00
|
|
|
lg:flex
|
2024-09-03 17:13:23 +02:00
|
|
|
items-center
|
2024-09-12 08:42:37 +02:00
|
|
|
justify-start
|
|
|
|
last:justify-end
|
2024-09-03 17:13:23 +02:00
|
|
|
gap-4px
|
2024-09-12 08:42:37 +02:00
|
|
|
hidden
|
2024-09-03 17:13:23 +02:00
|
|
|
>
|
|
|
|
<p
|
2024-09-12 08:42:37 +02:00
|
|
|
text="12px lg:14px app-text-grey"
|
|
|
|
leading="16px lg:24px"
|
2024-09-03 17:13:23 +02:00
|
|
|
whitespace-nowrap
|
|
|
|
>
|
|
|
|
{{ title.label }}
|
|
|
|
</p>
|
|
|
|
<button
|
|
|
|
v-if="title.togglable"
|
|
|
|
type="button"
|
|
|
|
:class="[title.toggled
|
2024-09-12 08:42:37 +02:00
|
|
|
? 'i-ic-baseline-arrow-drop-up'
|
|
|
|
: 'i-ic-baseline-arrow-drop-down']"
|
|
|
|
text="app-text-grey 20px"
|
2024-09-03 17:13:23 +02:00
|
|
|
@click="title.toggled = !title.toggled"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div
|
2024-09-12 08:42:37 +02:00
|
|
|
v-if="displayedProjects.length"
|
|
|
|
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
|
2024-09-03 17:13:23 +02:00
|
|
|
>
|
2024-09-12 08:42:37 +02:00
|
|
|
<NewCard
|
|
|
|
v-for="project in group.projects"
|
|
|
|
:key="project.id"
|
|
|
|
:project="project"
|
2024-09-03 17:13:23 +02:00
|
|
|
/>
|
|
|
|
</div>
|
2024-09-12 08:42:37 +02:00
|
|
|
<div v-else>
|
|
|
|
<h3>No Projects found...</h3>
|
|
|
|
</div>
|
|
|
|
<button
|
|
|
|
v-if="displayedProjects.length < projects.length"
|
|
|
|
mt-29px
|
|
|
|
text="14px"
|
|
|
|
leading-24px
|
|
|
|
font-700
|
|
|
|
px-12px
|
|
|
|
py-4px
|
|
|
|
border-2px
|
|
|
|
border-app-white
|
|
|
|
@click="showMoreProjects"
|
|
|
|
>
|
|
|
|
Load more projects
|
|
|
|
</button>
|
|
|
|
</template>
|
2023-12-19 18:43:42 +01:00
|
|
|
</div>
|
|
|
|
</template>
|