diff --git a/resources/css/app.css b/resources/css/app.css index 31cfab9..afffcf4 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -25,7 +25,6 @@ @import './components/brochures-grid.css'; @import './components/card-grid-container.css'; @import './components/filters-toolbar.css'; -@import './components/post-infos-capsule.css'; @import '../../template-components/cards/card-news.css'; @import '../../template-components/cards/card-frequent_question.css'; @@ -34,6 +33,7 @@ @import '../../template-components/posts-components/chapter-header.css'; @import '../../template-components/heading-box.css'; @import '../../template-components/news-heading-box.css'; +@import '../../template-components/post-infos-capsule.css'; /* ########### LAYOUT ############ */ @import './layout/header.css'; diff --git a/resources/css/editor-content/color-taxonomy-scheme.css b/resources/css/editor-content/color-taxonomy-scheme.css index d869382..7937a29 100644 --- a/resources/css/editor-content/color-taxonomy-scheme.css +++ b/resources/css/editor-content/color-taxonomy-scheme.css @@ -60,7 +60,9 @@ body.akoestiek, @apply text-acoustique-coproprietes; } } - time { + .post-infos-capsule__share, + .post-infos-capsule__publication-date, + .post-infos-capsule__modification-date { @apply text-acoustique-coproprietes; } } @@ -165,7 +167,9 @@ body.energie, @apply text-energies-urbanisme; } } - time { + .post-infos-capsule__share, + .post-infos-capsule__publication-date, + .post-infos-capsule__modification-date { @apply text-energies-urbanisme; } } @@ -272,7 +276,9 @@ body.isolation, @apply text-isolation-quotidien; } } - time { + .post-infos-capsule__share, + .post-infos-capsule__publication-date, + .post-infos-capsule__modification-date { @apply text-isolation-quotidien; } } @@ -370,7 +376,9 @@ body.erfgoed, @apply text-patrimoine-renovation; } } - time { + .post-infos-capsule__share, + .post-infos-capsule__publication-date, + .post-infos-capsule__modification-date { @apply text-patrimoine-renovation; } } @@ -468,7 +476,9 @@ body.circulaire-renovatie, @apply text-location-renovation-circulaire; } } - time { + .post-infos-capsule__share, + .post-infos-capsule__publication-date, + .post-infos-capsule__modification-date { @apply text-location-renovation-circulaire; } } diff --git a/template-components/post-infos-capsule.css b/template-components/post-infos-capsule.css new file mode 100644 index 0000000..0768e97 --- /dev/null +++ b/template-components/post-infos-capsule.css @@ -0,0 +1,51 @@ +.post-infos-capsule { + @apply flex flex-wrap justify-start gap-x-8 gap-y-5; + &__share, + &__publication-date, + &__modification-date { + @apply bg-white text-primary + rounded-full + px-4 + sm:px-6 + py-2 + w-fit + h-auto + flex justify-center + items-center + font-medium; + } + &__share { + @apply gap-1 md:gap-2; + .share-button { + @apply bg-primary w-8 h-8 rounded-full p-4 relative; + transition: transform 0.3s ease-in-out; + &:before { + @apply absolute w-3 h-3 bg-contain bg-center bg-no-repeat; + width: 25px; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + content: ''; + } + &:hover { + transform: scale(1.05); + filter: brightness(1.4); + } + } + .share-button--facebook { + &:before { + background-image: url('../resources/img/graphic-assets/icone-social-facebook.svg'); + } + } + .share-button--twitter-x { + &:before { + background-image: url('../resources/img/graphic-assets/icone-social-twitter-x.svg'); + } + } + .share-button--linkedin { + &:before { + background-image: url('../resources/img/graphic-assets/icone-social-linkedin.svg'); + } + } + } +} diff --git a/template-components/post-infos-capsule.php b/template-components/post-infos-capsule.php index e93ec52..a233bb7 100644 --- a/template-components/post-infos-capsule.php +++ b/template-components/post-infos-capsule.php @@ -3,21 +3,21 @@ $postID = $args['postID']; $published = $args['published'] ?? null; $modified = $args['modified'] ?? null; +if (!function_exists('build_share_urls')) { + function build_share_urls($postID) + { + $postUrl = get_permalink($postID); + $postTitle = get_the_title($postID); + $facebookUrl = 'https://www.facebook.com/sharer.php?u=' . $postUrl; + $twitterUrl = 'https://www.facebook.com/sharer.php?u=' . $postUrl; + $linkedInUrl = 'https://www.linkedin.com/feed/?shareActive=true&text=' . $postTitle . ' ' . $postUrl; - -function build_share_urls($postID) -{ - $postUrl = get_permalink($postID); - $postTitle = get_the_title($postID); - $facebookUrl = 'https://www.facebook.com/sharer.php?u=' . $postUrl; - $twitterUrl = 'https://www.facebook.com/sharer.php?u=' . $postUrl; - $linkedInUrl = 'https://www.linkedin.com/feed/?shareActive=true&text=' . $postTitle . ' ' . $postUrl; - - return array( - 'facebook' => $facebookUrl, - 'twitter-x' => $twitterUrl, - 'linkedin' => $linkedInUrl - ); + return array( + 'facebook' => $facebookUrl, + 'twitter-x' => $twitterUrl, + 'linkedin' => $linkedInUrl + ); + } } $shareUrls = build_share_urls($postID); @@ -27,7 +27,9 @@ $shareUrls = build_share_urls($postID);
- Partager sur + $shareUrl) : ?>
- + +
\ No newline at end of file