diff --git a/components/featured.php b/components/featured.php index 741a3d4..122fddb 100644 --- a/components/featured.php +++ b/components/featured.php @@ -1,34 +1,39 @@ + + + diff --git a/functions.php b/functions.php index f97610f..a5994f5 100644 --- a/functions.php +++ b/functions.php @@ -26,6 +26,31 @@ * Permet d'afficher les niveaux de post pour les post features */ + /* 2. Niveau support (for featured posts) */ + +register_taxonomy( + 'niveau', + 'post', + array( + 'label' => 'Niveau', + 'labels' => array( + 'name' => 'Niveaux', + 'singular_name' => 'Niveaux', + 'all_items' => 'Tous les niveaux', + 'edit_item' => 'Éditer le niveau', + 'view_item' => 'Voir le niveau', + 'update_item' => 'Mettre à jour le niveau', + 'add_new_item' => 'Ajouter un niveau', + 'new_item_name' => 'Nouveau niveau', + 'search_items' => 'Rechercher parmi les niveaux', + 'popular_items' => 'Niveaux les plus utilisés' + ), + 'hierarchical' => false + ) +); + +register_taxonomy_for_object_type( 'niveau', 'post' ); + // 1.1 - Enregistrement de la taxonomy pour le flag register_taxonomy( 'flag', diff --git a/home.php b/home.php index 29d1edd..5b7b3d7 100644 --- a/home.php +++ b/home.php @@ -9,11 +9,11 @@ echo '

' . get_the_title( $page ) . '

'; echo '
' . $page->post_content . '
'; } - echo '

Dernier article

'; + echo '

À la une

'; include(TEMPLATEPATH . '/components/featured.php'); } ?> -

Publications

+

Publications

diff --git a/scss/_global.scss b/scss/_global.scss index d9ae49f..5fa7d8f 100644 --- a/scss/_global.scss +++ b/scss/_global.scss @@ -4,4 +4,5 @@ @import 'custom/global'; @import 'custom/previews'; +@import 'custom/featured'; @import 'custom/article'; \ No newline at end of file diff --git a/scss/custom/_featured.scss b/scss/custom/_featured.scss new file mode 100644 index 0000000..f2b9191 --- /dev/null +++ b/scss/custom/_featured.scss @@ -0,0 +1,48 @@ +#featured-articles { + display:grid; + grid-template-columns: 1fr; + grid-template-rows: auto; + grid-gap: $lineheight; + padding-bottom: $lineheight; + @include xl() { + grid-template-columns: 1fr 1fr 1fr; + } +} + +.preview-featured { + font-size: 0.8rem; + + .preview-link { + display: block; + padding:0; + border-radius: $card-radius; + overflow: hidden; + .preview-item { + width: 100%; + height: auto; + aspect-ratio: 16 / 9; + background-size:100% auto; + background-position: center center; + transition: background-size .5s; + + &:hover { + background-size: 120% auto; + } + } + } + + .preview-overlay { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: flex-start; + height:100%; + color: white !important; + background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 60%); + padding:$lineheight / 8; + + h2 { + text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); + } + } +} \ No newline at end of file diff --git a/scss/custom/_global.scss b/scss/custom/_global.scss index 7c7ad77..46655f3 100644 --- a/scss/custom/_global.scss +++ b/scss/custom/_global.scss @@ -33,6 +33,10 @@ #page-header { background: $color-primary url('img/background.png'); margin-bottom:1.5rem; + font-size: 0.8rem; + .fa { + font-size: 1rem; + } } header h1 { diff --git a/scss/custom/_previews.scss b/scss/custom/_previews.scss index 1ed4da9..b3234eb 100644 --- a/scss/custom/_previews.scss +++ b/scss/custom/_previews.scss @@ -59,7 +59,7 @@ } } -.preview h2 { +.preview h2, .preview-featured h2 { font-size:1.25rem; line-height: 1.5rem; font-family: $titlefont; diff --git a/style.css b/style.css index de9a977..f712543 100644 --- a/style.css +++ b/style.css @@ -2558,7 +2558,10 @@ th { /* ------------------ HEADERS ------------------- */ #page-header { background: #e33d22 url("img/background.png"); - margin-bottom: 1.5rem; } + margin-bottom: 1.5rem; + font-size: 0.8rem; } + #page-header .fa { + font-size: 1rem; } header h1 { border-style: none !important; @@ -2760,13 +2763,13 @@ footer { aspect-ratio: 16/9; border-radius: 8px; } -.preview h2 { +.preview h2, .preview-featured h2 { font-size: 1.25rem; line-height: 1.5rem; font-family: Teko, sans-serif; font-weight: 800; height: 3rem; } - .preview h2 a { + .preview h2 a, .preview-featured h2 a { background-color: transparent !important; color: #212529; } @@ -2776,6 +2779,43 @@ footer { line-height: 1.25rem; color: rgba(33, 37, 41, 0.8); } +#featured-articles { + display: grid; + grid-template-columns: 1fr; + grid-template-rows: auto; + grid-gap: 1.6rem; + padding-bottom: 1.6rem; } + @media (min-width: 1200px) { + #featured-articles { + grid-template-columns: 1fr 1fr 1fr; } } +.preview-featured { + font-size: 0.8rem; } + .preview-featured .preview-link { + display: block; + padding: 0; + border-radius: 8px; + overflow: hidden; } + .preview-featured .preview-link .preview-item { + width: 100%; + height: auto; + aspect-ratio: 16 / 9; + background-size: 100% auto; + background-position: center center; + transition: background-size .5s; } + .preview-featured .preview-link .preview-item:hover { + background-size: 120% auto; } + .preview-featured .preview-overlay { + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: flex-start; + height: 100%; + color: white !important; + background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 60%); + padding: 0.2rem; } + .preview-featured .preview-overlay h2 { + text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7); } + .article img { max-width: 100%; height: auto;