cleanups + optimizations

This commit is contained in:
Denys Konovalov 2023-01-03 11:09:20 +01:00
parent 8a6d1516ec
commit 68c4f2ab54
29 changed files with 38 additions and 229 deletions

@ -103,22 +103,6 @@
});
});
var containerEl = document.querySelector('.shuffle-wrapper');
if (containerEl) {
var Shuffle = window.Shuffle;
var myShuffle = new Shuffle(document.querySelector('.shuffle-wrapper'), {
itemSelector: '.shuffle-item',
buffer: 1
});
jQuery('input[name="shuffle-filter"]').on('change', function (evt) {
var input = evt.currentTarget;
if (input.checked) {
myShuffle.filter(input.value);
}
});
}
})(jQuery);

@ -1,138 +0,0 @@
(function ($) {
'use strict';
// Preloader js
$(window).on('load', function () {
$('.preloader').fadeOut(100);
});
// Sticky Menu
$(window).scroll(function () {
var height = $('.top-header').innerHeight();
if ($('header').offset().top > 10) {
$('.top-header').addClass('hide');
$('.navigation').addClass('nav-bg');
$('.navigation').css('margin-top','-'+height+'px');
} else {
$('.top-header').removeClass('hide');
$('.navigation').removeClass('nav-bg');
$('.navigation').css('margin-top','-'+0+'px');
}
});
// Background-media
$('[data-background]').each(function () {
$(this).css({
'background-image': 'url(' + $(this).data('background') + ')'
});
});
//Hero Slider
$('.hero-slider').slick({
autoplay: true,
autoplaySpeed: 7500,
pauseOnFocus: false,
pauseOnHover: false,
infinite: true,
arrows: true,
fade: true,
prevArrow: '<button type=\'button\' class=\'prevArrow\'><i class=\'fa-solid fa-angle-left\'></i></button>',
nextArrow: '<button type=\'button\' class=\'nextArrow\'><i class=\'fa-solid fa-angle-right\'></i></button>',
dots: true
});
$('.hero-slider').slickAnimation();
// venobox popup
$(document).ready(function () {
$('.venobox').venobox();
});
// filter
$(document).ready(function () {
var containerEl = document.querySelector('.filtr-container');
var filterizd;
if (containerEl) {
filterizd = $('.filtr-container').filterizr({});
}
//Active changer
$('.filter-controls li').on('click', function () {
$('.filter-controls li').removeClass('active');
$(this).addClass('active');
});
});
// Count Up
function counter() {
var oTop;
if ($('.count').length !== 0) {
oTop = $('.count').offset().top - window.innerHeight;
}
if ($(window).scrollTop() > oTop) {
$('.count').each(function () {
var $this = $(this),
countTo = $this.attr('data-count');
$({
countNum: $this.text()
}).animate({
countNum: countTo
}, {
duration: 1000,
easing: 'swing',
step: function () {
$this.text(Math.floor(this.countNum));
},
complete: function () {
$this.text(this.countNum);
}
});
});
}
}
$(window).on('scroll', function () {
counter();
});
// Animation
$(document).ready(function () {
$('.has-animation').each(function (index) {
$(this).delay($(this).data('delay')).queue(function () {
$(this).addClass('animate-in');
});
});
});
var containerEl = document.querySelector('.shuffle-wrapper');
if (containerEl) {
var Shuffle = window.Shuffle;
var myShuffle = new Shuffle(document.querySelector('.shuffle-wrapper'), {
itemSelector: '.shuffle-item',
buffer: 1
});
jQuery('input[name="shuffle-filter"]').on('change', function (evt) {
var input = evt.currentTarget;
if (input.checked) {
myShuffle.filter(input.value);
}
});
}
})(jQuery);
var acc = document.getElementsByClassName("accordion");
var i;
for (i = 0; i < acc.length; i++) {
acc[i].addEventListener("click", function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
});
}

@ -1,6 +1,6 @@
baseURL: https://cantorgymnasium.de/
title: Georg-Cantor-Gymnasium
paginate: 5
paginate: 6
summaryLength: "10"
defaultContentLanguageInSubdir: false
defaultContentLanguage: de
@ -30,7 +30,7 @@ params:
css:
- link: plugins/bootstrap/bootstrap.min.css
- link: plugins/slick/slick.css
- link: plugins/animate/animate.css
- link: plugins/animate/animate.min.css
- link: plugins/venobox/venobox.css
- link: plugins/fontawesome/css/all.css
- link: plugins/fira/fira.css
@ -38,7 +38,6 @@ params:
- link: plugins/jQuery/jquery.min.js
- link: plugins/bootstrap/bootstrap.min.js
- link: plugins/slick/slick.min.js
- link: plugins/shuffle/shuffle.min.js
- link: plugins/venobox/venobox.min.js
- link: plugins/filterizr/jquery.filterizr.min.js
social:

@ -4,8 +4,7 @@ date: 2022-04-01T13:28:14.429Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/band.webp
categories_ag:
- Musik
category: Musik
duration: flexibel
weekly: Mittwoch, 9. Stunde
class: alle Klassenstufen

@ -5,8 +5,7 @@ draft: "false"
bg_image: /media/backgrounds/page-title.png
description: ""
image: /media/ganztagsangebote/biologie.webp
categories_ag:
- Naturwissenschaften
category: Naturwissenschaften
duration: 1. Stunde (14-tägig)
weekly: Montag, 13:20 bis 14:50 Uhr
class: 5. Klasse

@ -4,8 +4,7 @@ date: 2022-10-15T16:21:22.895Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/bw.webp
categories_ag:
- Gesellschaft
category: Gesellschaft
duration: nach Vereinbarung
weekly: ab November
class: alle Klassenstufen

@ -5,9 +5,7 @@ draft: false
bg_image: /media/backgrounds/page-title.png
description: ""
image: /media/ganztagsangebote/cantortechnik.webp
categories_ag:
- Technik
- Naturwissenschaften
category: Technik
duration: 2 Stunden
weekly: "Donnerstag, 8.-9. Stunde "
class: alle Klassenstufen

@ -4,8 +4,7 @@ date: 2022-04-01T13:28:14.429Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/chor.webp
categories_ag:
- Musik
category: Musik
duration: 45 Minuten
weekly: Mittwoch, 8. / 9. Stunde
class: alle Klassenstufen

@ -5,8 +5,7 @@ draft: "false"
bg_image: /media/backgrounds/page-title.png
description: "Zurück in die Zukunft: Unser GCG im Wandel der Zeit"
image: /media/ganztagsangebote/chronik.webp
categories_ag:
- Gesellschaft
category: Gesellschaft
duration: 2. Stunden
weekly: Donnerstag, 9. - 10. Stunde
class: 8. - 12. Klasse

@ -4,8 +4,7 @@ date: 2022-10-15T16:21:22.895Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/keramik.webp
categories_ag:
- Kunst
category: Kunst
duration: 2. Stunden
weekly: Dienstag, 7./8. Stunde
class: 5. - 8. Klasse

@ -4,8 +4,7 @@ date: 2022-10-15T16:21:22.895Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/kb.webp
categories_ag:
- Musik
category: Musik
duration: 1. Stunde
weekly: Mittwoch, 7./8. Stunde
class: alle Klassenstufen

@ -4,8 +4,7 @@ date: 2022-10-15T16:21:22.895Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/kunst.webp
categories_ag:
- Kunst
category: Kunst
duration: nach Vereinbarung
weekly: Freitag, ab 7. Stunde
class: 5. - 7. Klasse

@ -4,9 +4,7 @@ date: 2022-10-15T16:32:26.371Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/lego.webp
categories_ag:
- Naturwissenschaften
- Technik
category: Technik
duration: nach Vereinbarung
weekly: Mittwoch, 8. Stunde
class: 6. Klasse

@ -5,9 +5,7 @@ draft: false
bg_image: /media/bild_titelbild.jpg
description: Förderung für begabte Schülerinnen und Schüler in Mathematik.
image: /media/ganztagsangebote/mathematik.webp
categories_ag:
- Mathematik
- Naturwissenschaften
category: Mathematik
duration: 1. Stunde
weekly: Dienstag, 7. Stunde
class: 5. Klasse

@ -5,9 +5,7 @@ draft: false
bg_image: /media/bild_titelbild.jpg
description: Förderung für begabte Schülerinnen und Schüler in Mathematik
image: /media/ganztagsangebote/mathematik.webp
categories_ag:
- Mathematik
- Naturwissenschaften
category: Mathematik
duration: 1. Stunde
weekly: Montag, 7. Stunde
class: 6. Klasse

@ -5,8 +5,7 @@ draft: false
bg_image: /media/bild_titelbild.jpg
description: Begabtenförderung in Biologie, Chemie und Physik
image: /media/ganztagsangebote/nawigator.webp
categories_ag:
- Naturwissenschaften
category: Naturwissenschaften
duration: nach Vereinbarung
weekly: ab November
class: alle Klassenstufen

@ -4,8 +4,7 @@ date: 2022-10-15T16:38:35.662Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/pen-paper.webp
categories_ag:
- Gesellschaft
category: Gesellschaft
duration: nach Vereinbarung
weekly: siehe Tabelle
class: alle Klassenstufen

@ -4,8 +4,7 @@ date: 2022-10-15T16:21:22.895Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/schach.webp
categories_ag:
- Naturwissenschaften
category: Naturwissenschaften
duration: nach Vereinbarung
weekly: ab November
class: alle Klassenstufen

@ -4,8 +4,7 @@ date: 2022-10-15T17:01:15.900Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/sz.webp
categories_ag:
- Gesellschaft
category: Gesellschaft
duration: nach Vereinbarung
weekly: nach Vereinbarung
class: alle Klassenstufen

@ -4,8 +4,7 @@ date: 2022-10-15T16:21:22.895Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/sport.webp
categories_ag:
- Sport
category: Sport
duration: 1. Stunde
weekly: Freitag, 7. Stunde
class: 5. - 6. Klasse

@ -5,8 +5,7 @@ draft: "false"
bg_image: /media/backgrounds/page-title.png
description: ""
image: /media/ganztagsangebote/theater.webp
categories_ag:
- Gesellschaft
category: Gesellschaft
duration: 2. Stunden
weekly: Dienstag/Freitag 7./8.-9. Stunde
class: alle Klassenstufen

@ -4,8 +4,7 @@ date: 2022-10-15T16:21:22.895Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/volleyball.webp
categories_ag:
- Sport
category: Sport
duration: 2. Stunden
weekly: Freitag, 8. - 9. Stunde
class: 6. - 10. Klasse

@ -4,8 +4,7 @@ date: 2022-10-15T16:21:22.895Z
draft: "false"
bg_image: /media/backgrounds/page-title.png
image: /media/ganztagsangebote/wasserball.webp
categories_ag:
- Sport
category: Sport
duration: 2. Stunden
weekly: Dienstag, 17.00 - 18.30 Uhr
class: 5. - 8. Klasse

@ -19,7 +19,7 @@
href="{{ `author/` | relLangURL }}{{ .Params.Author | urlize }}">{{ .Params.Author | title }}</a>
</li>
</ul>
<h4 class="card-title"><a href="{{ .Permalink }}">{{ .Title }}</a></h4>
<h4 class="card-title"><a href="{{ .Permalink }}">{{ .Title | truncate 20 }}</a></h4>
<p class="card-text">{{ .Summary | truncate 100 }}</p>
<a href="{{ .Permalink }}" class="btn btn-primary btn-sm">{{ i18n "read_more" }}</a>
</div>

@ -27,11 +27,6 @@
<div class="col-12 my-4">
<div class="border-bottom"></div>
</div>
<div class="content">
<aside>
{{ .TableOfContents }}
</aside>
</div>
<div class="col-12 mb-5 content">
{{ .Content }}
</div>

@ -1,26 +1,19 @@
{{ define "main" }}
<section class="section" id="portfolio">
<section class="section">
<div class="container">
<div class="row gta-cat">
<div class="col-lg-12">
<div class="btn-group portfolio-filter btn-group-toggle justify-content-center d-flex flex-wrap"
data-toggle="buttons">
<label class="btn btn-primary-outline active">
<input type="radio" name="shuffle-filter" value="all" checked="checked" />{{ i18n "all"}}
</label>
<ul class="list-inline text-center filter-controls mb-5">
<li class="list-inline-item m-3 text-uppercase active" data-filter="all">{{ i18n "all" }}</li>
{{ $categories := slice }}
{{ range .Data.Pages }}
{{ range .Params.Categories_ag }}
{{ $categories = $categories | append . }}
{{ end }}
{{ $categories = $categories | append .Params.Category }}
{{ end }}
{{ range ( $categories | uniq ) }}
<label class="btn btn-primary-outline">
<input type="radio" name="shuffle-filter" value="{{ . | urlize }}" />{{ . }}
</label>
<li class="list-inline-item m-3 text-uppercase" data-filter="{{ . | urlize }}">{{ . | humanize }}</li>
{{ end }}
</div>
</ul>
</div>
</div>
<noscript>
@ -30,13 +23,9 @@
}
</style>
</noscript>
<br>
<div class="row shuffle-wrapper justify-content-center">
<div class="row filtr-container">
{{ range .Data.Pages }}
<div class="col-lg-4 shuffle-item"
data-groups="[{{range $index, $element:= .Params.Categories_ag }}{{if ne $index 0}},{{end}}&quot;{{. | urlize}}&quot;{{ end }}]">
<div data-category="{{ .Params.Category | urlize }}" class="col-lg-4 col-sm-6 mb-5 filtr-item">
{{ .Render "ganztagsangebote" }}
</div>
{{ end }}

@ -105,7 +105,7 @@ h6, .h6 {
background: #ffab08;
color: #ffbc3b; }
.btn-primary.active:not(:disabled):not(.disabled),
.btn-primary:not(:disabled):not(.disabled).active,
.btn-primary:not(:disabled):not(.disabled):active,
.show > .btn-primary.dropdown-toggle {
color: #fff;
@ -461,6 +461,10 @@ details[open] summary {
.termin-tc {
width: 25%; } }
#wc-canvas {
width: 100%;
height: 600px; }
.top-header {
font-size: 12px;
transition: transform .2s ease;

@ -201,7 +201,7 @@ CMS.registerEditorComponent({
<script>
CMS.registerPreviewStyle("https://cantorgymnasium.de/plugins/bootstrap/bootstrap.min.css");
CMS.registerPreviewStyle("https://cantorgymnasium.de/plugins/slick/slick.css");
CMS.registerPreviewStyle("https://cantorgymnasium.de/plugins/animate/animate.css");
CMS.registerPreviewStyle("https://cantorgymnasium.de/plugins/animate/animate.min.css");
CMS.registerPreviewStyle("https://cantorgymnasium.de/plugins/venobox/venobox.css");
CMS.registerPreviewStyle("https://cantorgymnasium.de/plugins/fontawesome/css/all.css");
CMS.registerPreviewStyle("https://cantorgymnasium.de/plugins/fira/fira.css");