This commit is contained in:
Kseninia Mikhaylova 2024-06-04 17:48:55 +03:00
parent 8b333bd1ea
commit 83ed3f070a
2 changed files with 51 additions and 2 deletions

33
app.vue
View File

@ -20,6 +20,13 @@ type ApiPagesType = {
content: string content: string
} }
type ApiReviewsType = {
id: number
image: string
text: string
comment: string
}
import '@/assets/main.scss' import '@/assets/main.scss'
const { data: seoData } = await useFetch<ApiKpType>(`${apiBase}/kp/1`) const { data: seoData } = await useFetch<ApiKpType>(`${apiBase}/kp/1`)
@ -34,6 +41,11 @@ useSeoMeta({
const { data: pagesData } = await useFetch<ApiPagesType[]>(`${apiBase}/pages/`) const { data: pagesData } = await useFetch<ApiPagesType[]>(`${apiBase}/pages/`)
const about = (pagesData.value as ApiPagesType[]).find(el => el.slug == 'about') const about = (pagesData.value as ApiPagesType[]).find(el => el.slug == 'about')
const reviews = (pagesData.value as ApiPagesType[]).find(el => el.slug == 'clients')
const { data: reviewsData } = await useFetch<ApiReviewsType[]>(`${apiBase}/review/`)
</script> </script>
<template> <template>
<div> <div>
@ -67,8 +79,25 @@ const about = (pagesData.value as ApiPagesType[]).find(el => el.slug == 'about')
</div> </div>
</div> </div>
</div> </div>
<div class="block bg-slate-500"> <div class="block block-img bg-slate-500">
<NuxtImg src="https://picsum.photos/1920/1080?grayscale" />
</div>
<div class="block bg-white" :id="reviews?.slug">
<div class="container">
<template v-for="item in reviewsData?.slice(0, 3)">
<div class="review">
<div class="review-image">
<NuxtImg :src="item.image" />
</div>
<div class="review-content">
{{ item.comment }}
</div>
<div class="review-title">
{{ item.text }}
</div>
</div>
</template>
</div>
</div> </div>
<NuxtPage /> <NuxtPage />
</div> </div>

View File

@ -31,6 +31,10 @@ a[href^="/#"]:not([class*="btn"]) {
.block { .block {
@apply py-10; @apply py-10;
&-img {
@apply py-0;
}
&-content { &-content {
@apply col-span-6 h-full flex flex-col justify-between prose; @apply col-span-6 h-full flex flex-col justify-between prose;
} }
@ -51,4 +55,20 @@ a[href^="/#"]:not([class*="btn"]) {
&-btn { &-btn {
@apply rounded-full bg-primary hover:bg-primary-400 transition-colors px-10 py-3 inline-block text-lg font-bold shadow-lg; @apply rounded-full bg-primary hover:bg-primary-400 transition-colors px-10 py-3 inline-block text-lg font-bold shadow-lg;
} }
}
.review {
@apply col-span-4 grid grid-cols-4 items-center px-4;
&-image {
@apply rounded-full size-20 bg-slate-300 overflow-hidden col-span-1;
}
&-content {
@apply col-span-3 text-end italic;
}
&-title {
@apply col-span-4 font-bold text-lg text-end mt-4;
}
} }