diff --git a/resources/css/blocks/reportages-list.css b/resources/css/blocks/reportages-list.css new file mode 100644 index 0000000..66407dd --- /dev/null +++ b/resources/css/blocks/reportages-list.css @@ -0,0 +1,114 @@ +.reportages-list { + &__list { + @apply grid grid-cols-1 md:grid-cols-2 gap-8; + } +} + +/* .block-front-header + .press-ressources { + margin-top: -300px; +} + +.block-front-header:has(+ .press-ressources) { + @apply pb-72; +} */ + +.reportages-grid { + @apply mt-12; + .wp-block-carhop-blocks-content-box { + @apply !w-full !m-0; + .content-box__innerblocks { + @apply p-0; + > * { + @apply w-full max-w-none; + } + } + } + &__inner { + @apply grid gap-8; + grid-template-columns: 1fr; + @screen lg { + grid-template-columns: 250px 3fr; + } + } + aside { + ul.reportages-grid__years-list { + @apply sticky top-0; + + li.reportages-grid__year { + @apply !list-none border border-primary border-solid text-4xl fjalla; + a { + @apply !no-underline block p-6; + } + + &:hover { + @apply bg-carhop-green-700 text-white; + a { + @apply !text-white !no-underline filter-none; + } + } + } + li.reportages-grid__year + li.reportages-grid__year { + @apply mt-4; + } + + @media (max-width: 1024px) { + @apply flex items-center gap-4; + + li.reportages-grid__year { + @apply !mt-0; + } + } + } + } + + &__archives-list { + @apply grid grid-cols-1 gap-8; + .reportages-grid__year-title-wrapper { + @apply relative mb-6; + &:after { + @apply content-[''] block w-full bg-primary absolute; + top: 50%; + height: 1px; + } + h3 { + @apply bg-white w-fit mx-auto px-8 relative z-10 text-lg nunito !font-bold tracking-wide; + } + } + } + &__archives-decade { + .post-card + .post-card { + @apply mt-8; + } + } + + &__title { + @apply my-12; + } + ul.archives-decade-used-types { + @apply flex items-center gap-10; + + li.archives-decade-used-type { + @apply text-primary flex items-center gap-2; + + &::before { + @apply content-[''] block w-8 h-8 bg-no-repeat bg-center bg-contain; + } + + &--audio::before { + background-image: url('../resources/img/icons/carhop-source-audio.svg'); + } + &--video::before { + background-image: url('../resources/img/icons/carhop-source-video.svg'); + } + &--photo::before { + background-image: url('../resources/img/icons/carhop-source-photo.svg'); + } + &--article::before { + background-image: url('../resources/img/icons/carhop-source-ecrits.svg'); + } + } + } +} + +.ressources-tabs-grid { +} diff --git a/template-parts/components/cards/reportages-card.php b/template-parts/components/cards/reportages-card.php new file mode 100644 index 0000000..48d0257 --- /dev/null +++ b/template-parts/components/cards/reportages-card.php @@ -0,0 +1,94 @@ + 'Audio', + 'video' => 'Vidéo', + 'photo' => 'Photo', + 'image' => 'Image', + 'article' => 'Article', +); + +?> + + + +
+ <?php echo $title; ?> +
+ +
+ $current_post_type, + 'current_post_id' => $ID + )); ?> +
+

+ +
+ +
+
+ +
+ + + +
    + +
  • post_title; ?>
  • + + +
  • post_title; ?>
  • + +
+ +
+ + +
    + +
  • name; ?>
  • + +
+ + +
+ + +
    + + +
  • 1 ? 's' : ''); ?>
  • + +
+ +
+ + +
+ +
\ No newline at end of file diff --git a/template-parts/post-types/reportages/reportages-grid.php b/template-parts/post-types/reportages/reportages-grid.php new file mode 100644 index 0000000..448874b --- /dev/null +++ b/template-parts/post-types/reportages/reportages-grid.php @@ -0,0 +1,60 @@ + 'reportages', + 'posts_per_page' => -1, + 'meta_key' => 'year', + 'orderby' => 'meta_value_num', + 'order' => 'ASC', +)); + + +$archives_presse_by_decade = []; + +foreach ($archives_presse as $archive) { + $year = (int) get_field('year', $archive->ID); + $media_types = get_field('media_type', $archive->ID); + + if (!$year) continue; + $decade = floor($year / 10) * 10; + $archives_presse_by_decade[$decade][] = $archive; +} + +$media_types_list = array( + 'audio' => 'Audios', + 'video' => 'Vidéos', + 'photo' => 'Photo', + 'image' => 'Images', + 'article' => 'Articles', +); + +?> + + +
+ + +
+ +
+ + $archives) : ?> +
+
+

+
+ + $archive->ID)); ?> + +
+ +
+
+
\ No newline at end of file