Compare commits

..

No commits in common. "01a81a3fcca3fddf3686339e1ed6295e7e06691a" and "ad3d784762c8ef8722933567e0b786a0780f0ef0" have entirely different histories.

17 changed files with 28 additions and 145 deletions

File diff suppressed because one or more lines are too long

View File

@ -12,7 +12,6 @@
align-items: center;
gap: 10px;
line-height: normal;
font-weight: 700;
}
.wp-block-carhop-blocks-cta a {
text-decoration: none;

View File

@ -12,7 +12,6 @@
align-items: center;
gap: 10px;
line-height: normal;
font-weight: 700;
}
.wp-block-carhop-blocks-cta a {
text-decoration: none;

View File

@ -1 +1 @@
{"version":3,"file":"cta/style-index.css","mappings":";;;AAAA;EACC;EACA;EAEA;EACA;EACA;EAAA;EACA;EACA;EACA;EACA;EAEA;AADD;AAGC;EACC;AADF;AAIE;EACC;EACA;AAFH;AAIE;;EAEC;AAFH;AAMC;EACC;AAJF;AAMC;EACC;EACA;AAJF;AAMC;EACC;AAJF,C","sources":["webpack://cta/./src/cta/style.scss"],"sourcesContent":[".wp-block-carhop-blocks-cta {\n\tmargin-top: 20px;\n\tcolor: var(--cta-current-color);\n\n\tpadding: 2px;\n\tdisplay: block;\n\twidth: fit-content;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tline-height: normal;\n\n\tfont-weight: 700;\n\n\ta {\n\t\ttext-decoration: none;\n\t}\n\t.icon {\n\t\tsvg {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\t\tsvg path,\n\t\tsvg circle {\n\t\t\tstroke: var(--cta-current-color);\n\t\t}\n\t}\n\n\t&.align--left {\n\t\tmargin-left: 0;\n\t}\n\t&.align--right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\t&.align--center {\n\t\tmargin: 0 auto;\n\t}\n}\n"],"names":[],"sourceRoot":""}
{"version":3,"file":"cta/style-index.css","mappings":";;;AAAA;EACC;EACA;EAEA;EACA;EACA;EAAA;EACA;EACA;EACA;EACA;AAAD;AAEC;EACC;AAAF;AAGE;EACC;EACA;AADH;AAGE;;EAEC;AADH;AAKC;EACC;AAHF;AAKC;EACC;EACA;AAHF;AAKC;EACC;AAHF,C","sources":["webpack://cta/./src/cta/style.scss"],"sourcesContent":[".wp-block-carhop-blocks-cta {\n\tmargin-top: 20px;\n\tcolor: var(--cta-current-color);\n\n\tpadding: 2px;\n\tdisplay: block;\n\twidth: fit-content;\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tline-height: normal;\n\n\ta {\n\t\ttext-decoration: none;\n\t}\n\t.icon {\n\t\tsvg {\n\t\t\twidth: 30px;\n\t\t\theight: 30px;\n\t\t}\n\t\tsvg path,\n\t\tsvg circle {\n\t\t\tstroke: var(--cta-current-color);\n\t\t}\n\t}\n\n\t&.align--left {\n\t\tmargin-left: 0;\n\t}\n\t&.align--right {\n\t\tmargin-right: 0;\n\t\tmargin-left: auto;\n\t}\n\t&.align--center {\n\t\tmargin: 0 auto;\n\t}\n}\n"],"names":[],"sourceRoot":""}

View File

@ -10,8 +10,6 @@
gap: 10px;
line-height: normal;
font-weight: 700;
a {
text-decoration: none;
}

View File

@ -53,19 +53,11 @@ $issue_related_articles = get_field('articles', $last_issue->ID);
<h3 class="block-dernieres-dynamiques__issue-title">
<?php echo $last_issue->post_title; ?>
</h3>
<div class="block-dernieres-dynamiques__issue-parution">
<h4 class="block-dernieres-dynamiques__issue-date title">Parution</h4>
<p class="block-dernieres-dynamiques__issue-date-number">
<?php echo get_the_date('d F Y', $last_issue->ID); ?>
</p>
</div>
<h4 class="block-dernieres-dynamiques__issue-description-title">Édito</h4>
<p class="block-dernieres-dynamiques__issue-description">
<?php echo $last_issue->post_excerpt; ?>
</p>
<div class="block-dernieres-dynamiques__issue-description">
<h4 class="block-dernieres-dynamiques__issue-description-title title">Édito</h4>
<p class="block-dernieres-dynamiques__issue-description">
<?php echo $last_issue->post_excerpt; ?>
</p>
</div>
</div>
<div class="block-dernieres-dynamiques__issue-thumbnail-wrapper">

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '868f7899d9aaee305c25');
<?php return array('dependencies' => array(), 'version' => '4cea8ae32b48c591d8d4');

View File

@ -3,16 +3,18 @@
!*** ./src/dernieres-dynamiques/view.js ***!
\******************************************/
document.addEventListener("DOMContentLoaded", function () {
const currentBlock = document.querySelector(".block-dernieres-dynamiques");
if (!currentBlock) return;
const swiperFraction = currentBlock.querySelector(".swiper-pagination-fraction");
const slides = currentBlock.querySelectorAll(".swiper-slide");
const swiperFraction = document.querySelector(".swiper-pagination-fraction");
const slides = document.querySelectorAll(".swiper-slide");
const slideCount = slides.length;
swiperFraction.textContent = `Article n°1 sur ${slideCount}`;
new Swiper(".dernieres-dynamiques-swiper", {
slidesPerView: 2,
spaceBetween: 30,
loop: true,
pagination: {
el: ".swiper-pagination",
clickable: true
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev"

View File

@ -1 +1 @@
{"version":3,"file":"dernieres-dynamiques/view.js","mappings":";;;;AAAAA,QAAQ,CAACC,gBAAgB,CAAC,kBAAkB,EAAE,YAAY;EACzD,MAAMC,YAAY,GAAGF,QAAQ,CAACG,aAAa,CAAC,6BAA6B,CAAC;EAC1E,IAAI,CAACD,YAAY,EAAE;EAEnB,MAAME,cAAc,GAAGF,YAAY,CAACC,aAAa,CAChD,6BACD,CAAC;EACD,MAAME,MAAM,GAAGH,YAAY,CAACI,gBAAgB,CAAC,eAAe,CAAC;EAC7D,MAAMC,UAAU,GAAGF,MAAM,CAACG,MAAM;EAChCJ,cAAc,CAACK,WAAW,GAAG,mBAAmBF,UAAU,EAAE;EAE5D,IAAIG,MAAM,CAAC,8BAA8B,EAAE;IAC1CC,aAAa,EAAE,CAAC;IAChBC,YAAY,EAAE,EAAE;IAChBC,IAAI,EAAE,IAAI;IACVC,UAAU,EAAE;MACXC,MAAM,EAAE,qBAAqB;MAC7BC,MAAM,EAAE;IACT,CAAC;IACDC,UAAU,EAAE;MACXC,EAAE,EAAE,oBAAoB;MACxBC,SAAS,EAAE,IAAI;MACfC,YAAY,EAAE,SAAAA,CAAUC,KAAK,EAAEC,SAAS,EAAE;QACzC,OAAO,kBAAkBA,SAAS,aAAa;MAChD;IACD,CAAC;IACDC,EAAE,EAAE;MACHC,WAAW,EAAGC,MAAM,IAAK;QACxB,MAAMC,WAAW,GAAGD,MAAM,EAAEpB,MAAM,EAAEG,MAAM;QAC1CJ,cAAc,CAACK,WAAW,GAAG,aAC5BgB,MAAM,CAACE,SAAS,GAAG,CAAC,QACbD,WAAW,EAAE;MACtB;IACD;;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;EACD,CAAC,CAAC;AACH,CAAC,CAAC,C","sources":["webpack://dernieres-dynamiques/./src/dernieres-dynamiques/view.js"],"sourcesContent":["document.addEventListener(\"DOMContentLoaded\", function () {\n\tconst currentBlock = document.querySelector(\".block-dernieres-dynamiques\");\n\tif (!currentBlock) return;\n\n\tconst swiperFraction = currentBlock.querySelector(\n\t\t\".swiper-pagination-fraction\"\n\t);\n\tconst slides = currentBlock.querySelectorAll(\".swiper-slide\");\n\tconst slideCount = slides.length;\n\tswiperFraction.textContent = `Article n°1 sur ${slideCount}`;\n\n\tnew Swiper(\".dernieres-dynamiques-swiper\", {\n\t\tslidesPerView: 2,\n\t\tspaceBetween: 30,\n\t\tloop: true,\n\t\tnavigation: {\n\t\t\tnextEl: \".swiper-button-next\",\n\t\t\tprevEl: \".swiper-button-prev\",\n\t\t},\n\t\tpagination: {\n\t\t\tel: \".swiper-pagination\",\n\t\t\tclickable: true,\n\t\t\trenderBullet: function (index, className) {\n\t\t\t\treturn `<button class=\"${className}\"></button>`;\n\t\t\t},\n\t\t},\n\t\ton: {\n\t\t\tslideChange: (swiper) => {\n\t\t\t\tconst slidesCount = swiper?.slides?.length;\n\t\t\t\tswiperFraction.textContent = `Article n°${\n\t\t\t\t\tswiper.realIndex + 1\n\t\t\t\t} sur ${slidesCount}`;\n\t\t\t},\n\t\t},\n\n\t\t// pagination: [\n\t\t// \t{\n\t\t// \t\tel: \".swiper-pagination\",\n\t\t// \t\ttype: \"bullets\",\n\t\t// \t\tclickable: true,\n\t\t// \t},\n\t\t// \t{\n\t\t// \t\tel: \".swiper-pagination-fraction\",\n\t\t// \t\ttype: \"fraction\",\n\t\t// \t\trenderFraction: function (currentClass, totalClass) {\n\t\t// \t\t\treturn (\n\t\t// \t\t\t\t'<p class=\"swiper-pagination__text\">' +\n\t\t// \t\t\t\t\"<span class='swiper-pagination__text-label'>Article n°</span>\" +\n\t\t// \t\t\t\t'<span class=\"' +\n\t\t// \t\t\t\tcurrentClass +\n\t\t// \t\t\t\t'\"></span>' +\n\t\t// \t\t\t\t\" sur \" +\n\t\t// \t\t\t\t'<span class=\"' +\n\t\t// \t\t\t\ttotalClass +\n\t\t// \t\t\t\t'\"></span>' +\n\t\t// \t\t\t\t\"</p>\"\n\t\t// \t\t\t);\n\t\t// \t\t},\n\t\t// \t},\n\t\t// ],\n\t});\n});\n"],"names":["document","addEventListener","currentBlock","querySelector","swiperFraction","slides","querySelectorAll","slideCount","length","textContent","Swiper","slidesPerView","spaceBetween","loop","navigation","nextEl","prevEl","pagination","el","clickable","renderBullet","index","className","on","slideChange","swiper","slidesCount","realIndex"],"sourceRoot":""}
{"version":3,"file":"dernieres-dynamiques/view.js","mappings":";;;;AAAAA,QAAQ,CAACC,gBAAgB,CAAC,kBAAkB,EAAE,YAAY;EACzD,MAAMC,cAAc,GAAGF,QAAQ,CAACG,aAAa,CAAC,6BAA6B,CAAC;EAC5E,MAAMC,MAAM,GAAGJ,QAAQ,CAACK,gBAAgB,CAAC,eAAe,CAAC;EACzD,MAAMC,UAAU,GAAGF,MAAM,CAACG,MAAM;EAChCL,cAAc,CAACM,WAAW,GAAG,mBAAmBF,UAAU,EAAE;EAE5D,IAAIG,MAAM,CAAC,8BAA8B,EAAE;IAC1CC,aAAa,EAAE,CAAC;IAChBC,YAAY,EAAE,EAAE;IAChBC,IAAI,EAAE,IAAI;IACVC,UAAU,EAAE;MACXC,EAAE,EAAE,oBAAoB;MACxBC,SAAS,EAAE;IACZ,CAAC;IACDC,UAAU,EAAE;MACXC,MAAM,EAAE,qBAAqB;MAC7BC,MAAM,EAAE;IACT,CAAC;IACDL,UAAU,EAAE;MACXC,EAAE,EAAE,oBAAoB;MACxBC,SAAS,EAAE,IAAI;MACfI,YAAY,EAAE,SAAAA,CAAUC,KAAK,EAAEC,SAAS,EAAE;QACzC,OAAO,kBAAkBA,SAAS,aAAa;MAChD;IACD,CAAC;IACDC,EAAE,EAAE;MACHC,WAAW,EAAGC,MAAM,IAAK;QACxB,MAAMC,WAAW,GAAGD,MAAM,EAAEpB,MAAM,EAAEG,MAAM;QAC1CL,cAAc,CAACM,WAAW,GAAG,aAC5BgB,MAAM,CAACE,SAAS,GAAG,CAAC,QACbD,WAAW,EAAE;MACtB;IACD;;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;EACD,CAAC,CAAC;AACH,CAAC,CAAC,C","sources":["webpack://dernieres-dynamiques/./src/dernieres-dynamiques/view.js"],"sourcesContent":["document.addEventListener(\"DOMContentLoaded\", function () {\n\tconst swiperFraction = document.querySelector(\".swiper-pagination-fraction\");\n\tconst slides = document.querySelectorAll(\".swiper-slide\");\n\tconst slideCount = slides.length;\n\tswiperFraction.textContent = `Article n°1 sur ${slideCount}`;\n\n\tnew Swiper(\".dernieres-dynamiques-swiper\", {\n\t\tslidesPerView: 2,\n\t\tspaceBetween: 30,\n\t\tloop: true,\n\t\tpagination: {\n\t\t\tel: \".swiper-pagination\",\n\t\t\tclickable: true,\n\t\t},\n\t\tnavigation: {\n\t\t\tnextEl: \".swiper-button-next\",\n\t\t\tprevEl: \".swiper-button-prev\",\n\t\t},\n\t\tpagination: {\n\t\t\tel: \".swiper-pagination\",\n\t\t\tclickable: true,\n\t\t\trenderBullet: function (index, className) {\n\t\t\t\treturn `<button class=\"${className}\"></button>`;\n\t\t\t},\n\t\t},\n\t\ton: {\n\t\t\tslideChange: (swiper) => {\n\t\t\t\tconst slidesCount = swiper?.slides?.length;\n\t\t\t\tswiperFraction.textContent = `Article n°${\n\t\t\t\t\tswiper.realIndex + 1\n\t\t\t\t} sur ${slidesCount}`;\n\t\t\t},\n\t\t},\n\n\t\t// pagination: [\n\t\t// \t{\n\t\t// \t\tel: \".swiper-pagination\",\n\t\t// \t\ttype: \"bullets\",\n\t\t// \t\tclickable: true,\n\t\t// \t},\n\t\t// \t{\n\t\t// \t\tel: \".swiper-pagination-fraction\",\n\t\t// \t\ttype: \"fraction\",\n\t\t// \t\trenderFraction: function (currentClass, totalClass) {\n\t\t// \t\t\treturn (\n\t\t// \t\t\t\t'<p class=\"swiper-pagination__text\">' +\n\t\t// \t\t\t\t\"<span class='swiper-pagination__text-label'>Article n°</span>\" +\n\t\t// \t\t\t\t'<span class=\"' +\n\t\t// \t\t\t\tcurrentClass +\n\t\t// \t\t\t\t'\"></span>' +\n\t\t// \t\t\t\t\" sur \" +\n\t\t// \t\t\t\t'<span class=\"' +\n\t\t// \t\t\t\ttotalClass +\n\t\t// \t\t\t\t'\"></span>' +\n\t\t// \t\t\t\t\"</p>\"\n\t\t// \t\t\t);\n\t\t// \t\t},\n\t\t// \t},\n\t\t// ],\n\t});\n});\n"],"names":["document","addEventListener","swiperFraction","querySelector","slides","querySelectorAll","slideCount","length","textContent","Swiper","slidesPerView","spaceBetween","loop","pagination","el","clickable","navigation","nextEl","prevEl","renderBullet","index","className","on","slideChange","swiper","slidesCount","realIndex"],"sourceRoot":""}

View File

@ -53,19 +53,11 @@ $issue_related_articles = get_field('articles', $last_issue->ID);
<h3 class="block-dernieres-dynamiques__issue-title">
<?php echo $last_issue->post_title; ?>
</h3>
<div class="block-dernieres-dynamiques__issue-parution">
<h4 class="block-dernieres-dynamiques__issue-date title">Parution</h4>
<p class="block-dernieres-dynamiques__issue-date-number">
<?php echo get_the_date('d F Y', $last_issue->ID); ?>
</p>
</div>
<h4 class="block-dernieres-dynamiques__issue-description-title">Édito</h4>
<p class="block-dernieres-dynamiques__issue-description">
<?php echo $last_issue->post_excerpt; ?>
</p>
<div class="block-dernieres-dynamiques__issue-description">
<h4 class="block-dernieres-dynamiques__issue-description-title title">Édito</h4>
<p class="block-dernieres-dynamiques__issue-description">
<?php echo $last_issue->post_excerpt; ?>
</p>
</div>
</div>
<div class="block-dernieres-dynamiques__issue-thumbnail-wrapper">

View File

@ -1,11 +1,6 @@
document.addEventListener("DOMContentLoaded", function () {
const currentBlock = document.querySelector(".block-dernieres-dynamiques");
if (!currentBlock) return;
const swiperFraction = currentBlock.querySelector(
".swiper-pagination-fraction"
);
const slides = currentBlock.querySelectorAll(".swiper-slide");
const swiperFraction = document.querySelector(".swiper-pagination-fraction");
const slides = document.querySelectorAll(".swiper-slide");
const slideCount = slides.length;
swiperFraction.textContent = `Article n°1 sur ${slideCount}`;
@ -13,6 +8,10 @@ document.addEventListener("DOMContentLoaded", function () {
slidesPerView: 2,
spaceBetween: 30,
loop: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",

View File

@ -22,10 +22,6 @@ $query = new WP_Query(array(
<div class="swiper revues-precedentes-swiper">
<div class="swiper-wrapper">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<?php
$issue_number = get_field('issue_number', get_the_ID());
?>
<article class="card-revue swiper-slide">
<div class="content-meta">
<span class="content-meta__type content-meta__type--revue">Revue</span>
@ -34,25 +30,7 @@ $query = new WP_Query(array(
<h4 class="card-revue__title title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<h5 class="card-revue__edito-title edito-title">Édito</h5>
<div class="card-revue__excerpt">
<?php echo wp_trim_words(get_the_excerpt(), 45, '...'); ?>
</div>
<div class="card-revue__post-details">
<?php if ($issue_number) : ?>
<div class="card-revue__issue-number">
<p class="card-revue__issue-number__label label">Numéro</p>
<p class="card-revue__issue-number__value">
<?php echo get_field('issue_number', get_the_ID()); ?>
</p>
</div>
<?php endif; ?>
<div class="card-revue__parution">
<p class="card-revue__parution__label label">Publication</p>
<time class="card-revue__parution__date">
<?php echo get_the_date('d F Y'); ?>
</time>
</div>
<?php the_excerpt(); ?>
</div>
</div>
@ -70,10 +48,7 @@ $query = new WP_Query(array(
</article>
<?php endwhile; ?>
</div>
<div class="swiper-pagination-fraction"></div>
<div class="swiper-pagination"></div>
<div class="swiper-controls">
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>

View File

@ -1 +1 @@
<?php return array('dependencies' => array(), 'version' => '059d9cab1ce4a910cdb7');
<?php return array('dependencies' => array(), 'version' => '6068b14ae0fb2b6d9070');

View File

@ -3,17 +3,9 @@
!*** ./src/revues-precedentes/view.js ***!
\****************************************/
document.addEventListener("DOMContentLoaded", function () {
const currentBlock = document.querySelector(".block-revues-precedentes");
if (!currentBlock) return;
const swiperFraction = currentBlock.querySelector(".swiper-pagination-fraction");
const slides = currentBlock.querySelectorAll(".swiper-slide");
const slideCount = slides.length;
swiperFraction.textContent = `Article n°1 sur ${slideCount}`;
console.log(slideCount);
new Swiper(".revues-precedentes-swiper", {
slidesPerView: 1,
spaceBetween: 30,
loop: true,
pagination: {
el: ".swiper-pagination",
clickable: true
@ -21,19 +13,6 @@ document.addEventListener("DOMContentLoaded", function () {
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev"
},
pagination: {
el: ".swiper-pagination",
clickable: true,
renderBullet: function (index, className) {
return `<button class="${className}"></button>`;
}
},
on: {
slideChange: swiper => {
const slidesCount = swiper?.slides?.length;
swiperFraction.textContent = `Article n°${swiper.realIndex + 1} sur ${slidesCount}`;
}
}
});
});

View File

@ -1 +1 @@
{"version":3,"file":"revues-precedentes/view.js","mappings":";;;;AAAAA,QAAQ,CAACC,gBAAgB,CAAC,kBAAkB,EAAE,YAAY;EACzD,MAAMC,YAAY,GAAGF,QAAQ,CAACG,aAAa,CAAC,2BAA2B,CAAC;EACxE,IAAI,CAACD,YAAY,EAAE;EAEnB,MAAME,cAAc,GAAGF,YAAY,CAACC,aAAa,CAChD,6BACD,CAAC;EAED,MAAME,MAAM,GAAGH,YAAY,CAACI,gBAAgB,CAAC,eAAe,CAAC;EAC7D,MAAMC,UAAU,GAAGF,MAAM,CAACG,MAAM;EAChCJ,cAAc,CAACK,WAAW,GAAG,mBAAmBF,UAAU,EAAE;EAC5DG,OAAO,CAACC,GAAG,CAACJ,UAAU,CAAC;EACvB,IAAIK,MAAM,CAAC,4BAA4B,EAAE;IACxCC,aAAa,EAAE,CAAC;IAChBC,YAAY,EAAE,EAAE;IAChBC,IAAI,EAAE,IAAI;IACVC,UAAU,EAAE;MACXC,EAAE,EAAE,oBAAoB;MACxBC,SAAS,EAAE;IACZ,CAAC;IACDC,UAAU,EAAE;MACXC,MAAM,EAAE,qBAAqB;MAC7BC,MAAM,EAAE;IACT,CAAC;IACDL,UAAU,EAAE;MACXC,EAAE,EAAE,oBAAoB;MACxBC,SAAS,EAAE,IAAI;MACfI,YAAY,EAAE,SAAAA,CAAUC,KAAK,EAAEC,SAAS,EAAE;QACzC,OAAO,kBAAkBA,SAAS,aAAa;MAChD;IACD,CAAC;IACDC,EAAE,EAAE;MACHC,WAAW,EAAGC,MAAM,IAAK;QACxB,MAAMC,WAAW,GAAGD,MAAM,EAAEtB,MAAM,EAAEG,MAAM;QAC1CJ,cAAc,CAACK,WAAW,GAAG,aAC5BkB,MAAM,CAACE,SAAS,GAAG,CAAC,QACbD,WAAW,EAAE;MACtB;IACD;EACD,CAAC,CAAC;AACH,CAAC,CAAC,C","sources":["webpack://revues-precedentes/./src/revues-precedentes/view.js"],"sourcesContent":["document.addEventListener(\"DOMContentLoaded\", function () {\n\tconst currentBlock = document.querySelector(\".block-revues-precedentes\");\n\tif (!currentBlock) return;\n\n\tconst swiperFraction = currentBlock.querySelector(\n\t\t\".swiper-pagination-fraction\",\n\t);\n\n\tconst slides = currentBlock.querySelectorAll(\".swiper-slide\");\n\tconst slideCount = slides.length;\n\tswiperFraction.textContent = `Article n°1 sur ${slideCount}`;\n\tconsole.log(slideCount);\n\tnew Swiper(\".revues-precedentes-swiper\", {\n\t\tslidesPerView: 1,\n\t\tspaceBetween: 30,\n\t\tloop: true,\n\t\tpagination: {\n\t\t\tel: \".swiper-pagination\",\n\t\t\tclickable: true,\n\t\t},\n\t\tnavigation: {\n\t\t\tnextEl: \".swiper-button-next\",\n\t\t\tprevEl: \".swiper-button-prev\",\n\t\t},\n\t\tpagination: {\n\t\t\tel: \".swiper-pagination\",\n\t\t\tclickable: true,\n\t\t\trenderBullet: function (index, className) {\n\t\t\t\treturn `<button class=\"${className}\"></button>`;\n\t\t\t},\n\t\t},\n\t\ton: {\n\t\t\tslideChange: (swiper) => {\n\t\t\t\tconst slidesCount = swiper?.slides?.length;\n\t\t\t\tswiperFraction.textContent = `Article n°${\n\t\t\t\t\tswiper.realIndex + 1\n\t\t\t\t} sur ${slidesCount}`;\n\t\t\t},\n\t\t},\n\t});\n});\n"],"names":["document","addEventListener","currentBlock","querySelector","swiperFraction","slides","querySelectorAll","slideCount","length","textContent","console","log","Swiper","slidesPerView","spaceBetween","loop","pagination","el","clickable","navigation","nextEl","prevEl","renderBullet","index","className","on","slideChange","swiper","slidesCount","realIndex"],"sourceRoot":""}
{"version":3,"file":"revues-precedentes/view.js","mappings":";;;;AAAAA,QAAQ,CAACC,gBAAgB,CAAC,kBAAkB,EAAE,YAAY;EACzD,IAAIC,MAAM,CAAC,4BAA4B,EAAE;IACxCC,aAAa,EAAE,CAAC;IAChBC,YAAY,EAAE,EAAE;IAChBC,UAAU,EAAE;MACXC,EAAE,EAAE,oBAAoB;MACxBC,SAAS,EAAE;IACZ,CAAC;IACDC,UAAU,EAAE;MACXC,MAAM,EAAE,qBAAqB;MAC7BC,MAAM,EAAE;IACT;EACD,CAAC,CAAC;AACH,CAAC,CAAC,C","sources":["webpack://revues-precedentes/./src/revues-precedentes/view.js"],"sourcesContent":["document.addEventListener(\"DOMContentLoaded\", function () {\n\tnew Swiper(\".revues-precedentes-swiper\", {\n\t\tslidesPerView: 1,\n\t\tspaceBetween: 30,\n\t\tpagination: {\n\t\t\tel: \".swiper-pagination\",\n\t\t\tclickable: true,\n\t\t},\n\t\tnavigation: {\n\t\t\tnextEl: \".swiper-button-next\",\n\t\t\tprevEl: \".swiper-button-prev\",\n\t\t},\n\t});\n});\n"],"names":["document","addEventListener","Swiper","slidesPerView","spaceBetween","pagination","el","clickable","navigation","nextEl","prevEl"],"sourceRoot":""}

View File

@ -22,10 +22,6 @@ $query = new WP_Query(array(
<div class="swiper revues-precedentes-swiper">
<div class="swiper-wrapper">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<?php
$issue_number = get_field('issue_number', get_the_ID());
?>
<article class="card-revue swiper-slide">
<div class="content-meta">
<span class="content-meta__type content-meta__type--revue">Revue</span>
@ -34,25 +30,7 @@ $query = new WP_Query(array(
<h4 class="card-revue__title title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
<h5 class="card-revue__edito-title edito-title">Édito</h5>
<div class="card-revue__excerpt">
<?php echo wp_trim_words(get_the_excerpt(), 45, '...'); ?>
</div>
<div class="card-revue__post-details">
<?php if ($issue_number) : ?>
<div class="card-revue__issue-number">
<p class="card-revue__issue-number__label label">Numéro</p>
<p class="card-revue__issue-number__value">
<?php echo get_field('issue_number', get_the_ID()); ?>
</p>
</div>
<?php endif; ?>
<div class="card-revue__parution">
<p class="card-revue__parution__label label">Publication</p>
<time class="card-revue__parution__date">
<?php echo get_the_date('d F Y'); ?>
</time>
</div>
<?php the_excerpt(); ?>
</div>
</div>
@ -70,10 +48,7 @@ $query = new WP_Query(array(
</article>
<?php endwhile; ?>
</div>
<div class="swiper-pagination-fraction"></div>
<div class="swiper-pagination"></div>
<div class="swiper-controls">
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>

View File

@ -1,19 +1,7 @@
document.addEventListener("DOMContentLoaded", function () {
const currentBlock = document.querySelector(".block-revues-precedentes");
if (!currentBlock) return;
const swiperFraction = currentBlock.querySelector(
".swiper-pagination-fraction",
);
const slides = currentBlock.querySelectorAll(".swiper-slide");
const slideCount = slides.length;
swiperFraction.textContent = `Article n°1 sur ${slideCount}`;
console.log(slideCount);
new Swiper(".revues-precedentes-swiper", {
slidesPerView: 1,
spaceBetween: 30,
loop: true,
pagination: {
el: ".swiper-pagination",
clickable: true,
@ -22,20 +10,5 @@ document.addEventListener("DOMContentLoaded", function () {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
pagination: {
el: ".swiper-pagination",
clickable: true,
renderBullet: function (index, className) {
return `<button class="${className}"></button>`;
},
},
on: {
slideChange: (swiper) => {
const slidesCount = swiper?.slides?.length;
swiperFraction.textContent = `Article n°${
swiper.realIndex + 1
} sur ${slidesCount}`;
},
},
});
});