drop filterizr in favor of shuffle (close #258)
All checks were successful
website-main / prod-build (push) Successful in 13s
website-main / test-build (push) Successful in 6s

This commit is contained in:
Denys Konovalov 2024-01-20 21:52:20 +01:00
parent 323559c90f
commit ac3bc5b0ed
Signed by: Denys Konovalov
GPG Key ID: 0037E1B0E33BD2C9
6 changed files with 18 additions and 20 deletions

@ -65,20 +65,15 @@
// filter // filter
$(document).ready(function () { $(document).ready(function () {
var containerEl = document.querySelector('.filtr-container'); const shuffleInstance = new Shuffle($('.filter-container'), {
if (containerEl) { itemSelector: '.filter-item',
new Filterizr( sizer: '.filter-sizer', // could also be a selector: '.js-shuffle-sizer'
'.filtr-container', delimiter: ','
{ });
layout: 'sameWidth',
gutterPixels: 10
}
);
}
// active changer
$('.filter-controls li').on('click', function () { $('.filter-controls li').on('click', function () {
$('.filter-controls li').removeClass('active'); $('.filter-controls li').removeClass('active');
$(this).addClass('active'); $(this).addClass('active');
shuffleInstance.filter($(this).data('filter'))
}); });
}); });

@ -43,7 +43,7 @@ params:
head_js: head_js:
- https://assets.cantorgymnasium.de/jquery/v3.7/jquery.min.js - https://assets.cantorgymnasium.de/jquery/v3.7/jquery.min.js
- https://assets.cantorgymnasium.de/venobox/v2/dist/venobox.min.js - https://assets.cantorgymnasium.de/venobox/v2/dist/venobox.min.js
- https://assets.cantorgymnasium.de/filterizr/v2/dist/vanilla.filterizr.min.js - https://assets.cantorgymnasium.de/shuffle/v6/shuffle.min.js
social: social:
- title: YouTube - title: YouTube
icon: youtube icon: youtube

@ -3,12 +3,13 @@
<section class="section"> <section class="section">
<div class="container"> <div class="container">
{{ partial "filter-controls" . }} {{ partial "filter-controls" . }}
<div class="filtr-container"> <div class="filter-container row">
{{ range .Data.Pages }} {{ range .Data.Pages }}
<div data-category="{{ .Params.category | urlize }}" class="col-lg-4 col-sm-6 filtr-item"> <div data-groups="{{ .Params.category | urlize }}" class="col-lg-4 col-sm-6 filter-item">
{{ partial "ganztag" . }} {{ partial "ganztag" . }}
</div> </div>
{{ end }} {{ end }}
<div class="filter-sizer col-1"></div>
</div> </div>
</div> </div>
</section> </section>

@ -7,12 +7,13 @@
<li class="list-inline-item m-3 text-uppercase" data-filter="upcoming">Anstehend</li> <li class="list-inline-item m-3 text-uppercase" data-filter="upcoming">Anstehend</li>
<li class="list-inline-item m-3 text-uppercase" data-filter="past">Vergangen</li> <li class="list-inline-item m-3 text-uppercase" data-filter="past">Vergangen</li>
</ul> </ul>
<div class="filtr-container row mx-auto"> <div class="filter-container row mx-auto">
{{ range .Params.events }} {{ range .Params.events }}
<div class="filtr-item col-12" data-category="{{ if or (ge (.date | time.AsTime).Unix now.Unix) (and .enddate (ge (.enddate | time.AsTime).Unix now.Unix)) }}upcoming{{else}}past{{end}}" data-time="{{.date}}"> <div class="filter-item col-12" data-groups="{{ if or (ge (.date | time.AsTime).Unix now.Unix) (and .enddate (ge (.enddate | time.AsTime).Unix now.Unix)) }}upcoming{{else}}past{{end}}" data-time="{{.date}}">
{{ partial "termin" . }} {{ partial "termin" . }}
</div> </div>
{{ end }} {{ end }}
<div class="filter-sizer col-1"></div>
</div> </div>
</div> </div>
</section> </section>

@ -3,12 +3,13 @@
<section class="section"> <section class="section">
<div class="container"> <div class="container">
{{ partial "filter-controls" . }} {{ partial "filter-controls" . }}
<div class="row filtr-container"> <div class="filter-container row">
{{ range .Data.Pages }} {{ range .Data.Pages }}
<div data-category="{{ .Params.category | urlize }}" class="col-lg-4 col-sm-6 filtr-item"> <div data-groups="{{ .Params.category | urlize }}" class="col-lg-4 col-sm-6 filter-item">
{{ partial "card-category" . }} {{ partial "card-category" . }}
</div> </div>
{{ end }} {{ end }}
<div class="filter-sizer col-1"></div>
</div> </div>
</div> </div>
</section> </section>

@ -31,11 +31,11 @@ const EventPreview = ({ widgetsFor, entry }) => {
), ),
h( h(
"div", "div",
{ className: "filtr-container row" }, { className: "filter-container row" },
widgetsFor("events").map((event) => widgetsFor("events").map((event) =>
h( h(
"div", "div",
{ className: "filtr-item col-12" }, { className: "filter-item col-12" },
h( h(
"div", "div",
{ {