dynamize inspirations header
This commit is contained in:
parent
0afb0dfe54
commit
fceacaeed6
4 changed files with 28 additions and 12 deletions
|
|
@ -10,7 +10,7 @@ Date: 2024-04-24
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
New: false
|
New: true
|
||||||
|
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
$collections = $page->children()->map(function ($child) {
|
$collections = $page->children()->map(function ($child) {
|
||||||
return [
|
return [
|
||||||
'title' => $child->title()->value(),
|
'title' => $child->title()->value(),
|
||||||
|
'new' => $child->new()->value() === "true" ? true : false,
|
||||||
|
'date' => $child->date()->toDate('Y-m-d'),
|
||||||
'url' => $child->url(),
|
'url' => $child->url(),
|
||||||
'modified' => $child->modified('Y-m-d'),
|
'modified' => $child->modified('Y-m-d'),
|
||||||
'status' => $child->status(),
|
'status' => $child->status(),
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,41 @@
|
||||||
<template>
|
<template>
|
||||||
<header
|
<header
|
||||||
class="flex | text-center"
|
class="flex | text-center"
|
||||||
style="
|
:style="'--image: url(\'' + collection.cover + '\');'"
|
||||||
--image: url('https://plus.unsplash.com/premium_photo-1675626791716-7f74187592f1?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
<!-- $inspiration->cover()->url() -->
|
<!-- $inspiration->cover()->url() -->
|
||||||
<h2 class="inspiration__title | font-serif | text-lg | new">
|
<h2
|
||||||
Shape of Nature
|
class="inspiration__title | font-serif | text-lg"
|
||||||
|
:class="{ new: collection.new }"
|
||||||
|
>
|
||||||
|
{{ collection.title }}
|
||||||
</h2>
|
</h2>
|
||||||
<!-- $inspiration->title() + class="new" if $inspiration->new()->isTrue() -->
|
<!-- $inspiration->title() + class="new" if $inspiration->new()->isTrue() -->
|
||||||
<time class="inspiration__date | font-medium | text-sm" datatime="2024-04"
|
<time
|
||||||
>Avril 2024</time
|
class="inspiration__date | font-medium | text-sm"
|
||||||
|
datatime="2024-04"
|
||||||
|
>{{ frenchFormattedDate }}</time
|
||||||
>
|
>
|
||||||
<!-- $inspiration->date() -->
|
<!-- $inspiration->date() -->
|
||||||
<p class="inspiration__description">
|
<p class="inspiration__description">
|
||||||
Lectus adipiscing nulla quis odio in aliquam. Adipiscing libero in
|
{{ collection.description }}
|
||||||
consequat porta mauris hendrerit malesuada viverra turpis.
|
|
||||||
</p>
|
</p>
|
||||||
<!-- $inspiration->description() -->
|
|
||||||
</header>
|
</header>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import dayjs from "dayjs";
|
||||||
|
import "dayjs/locale/fr";
|
||||||
|
|
||||||
|
const { collection } = defineProps({
|
||||||
|
collection: Object,
|
||||||
|
});
|
||||||
|
|
||||||
|
dayjs.locale("fr");
|
||||||
|
|
||||||
|
const frenchFormattedDate = dayjs(collection.date).format("MMMM YYYY");
|
||||||
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.inspiration > header {
|
.inspiration > header {
|
||||||
--direction: column;
|
--direction: column;
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
<!-- TabPanel -->
|
<!-- TabPanel -->
|
||||||
<section class="inspiration">
|
<section class="inspiration">
|
||||||
<Header />
|
<Header :collection="currentCollection" />
|
||||||
<div class="grid masonry">
|
<div class="grid masonry">
|
||||||
<template v-for="(item, index) in currentCollection.media">
|
<template v-for="(item, index) in currentCollection.media">
|
||||||
<figure class="flex" :style="'--rows: ' + (index % 2 ? 2 : 3)">
|
<figure class="flex" :style="'--rows: ' + (index % 2 ? 2 : 3)">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue