From a059aae772433010220e942dcd9ea28940139b5b Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Sun, 21 Jan 2024 14:18:25 +0100 Subject: [PATCH] style & script fixes --- assets/css/style.css | 32 +++--- assets/js/script.js | 104 +++++++++++------- config.yml | 6 +- .../blog/einladung-weihnachtskonzert-2023.md | 2 +- content/chronikseiten/abiturdurchschnitte.md | 9 +- content/chronikseiten/schuelerzahlen.md | 7 -- layouts/partials/footer.html | 43 +------- layouts/partials/head.html | 25 ++--- layouts/partials/header.html | 14 ++- static/admin/previews/page-previews/styles.js | 4 +- 10 files changed, 110 insertions(+), 136 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index 8582af59..36afb1dd 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -688,7 +688,7 @@ link:focus, color: white; } -.navbar-expand-lg .navbar-nav .nav-link { +.navbar-expand-xl .navbar-nav .nav-link { padding: 40px 0px; } @@ -902,6 +902,17 @@ link:focus, } @media (max-width: 991px) { + .feature-blocks { + margin-top: 0; + padding: 50px; + } + + .feature-blocks h3 { + font-size: 25px; + } +} + +@media (max-width: 1199px) { .navigation { background: var(--gcg-color-secondary); } @@ -915,7 +926,7 @@ link:focus, background: var(--gcg-color-secondary) !important; } - .navbar-expand-lg .navbar-nav .nav-link { + .navbar-expand-xl .navbar-nav .nav-link { padding: 20px; } @@ -936,17 +947,6 @@ link:focus, text-align: center; } - .feature-blocks { - margin-top: 0; - padding: 50px; - } - - .feature-blocks h3 { - font-size: 25px; - } -} - -@media (max-width: 1199px) { .feature-blocks { padding-right: 50px; padding-left: 50px; @@ -1057,3 +1057,9 @@ link:focus, vertical-align: -0.125rem; } +#chart-container { + position: relative; + height: 50vh; + overflow: hidden; +} + diff --git a/assets/js/script.js b/assets/js/script.js index b4ced086..757c53a7 100644 --- a/assets/js/script.js +++ b/assets/js/script.js @@ -1,4 +1,4 @@ -(function ($) { +(($) => { 'use strict'; // adapt header to height @@ -18,7 +18,7 @@ } // load scripts - $(window).on('load', function () { + $(window).on('load', () => { $('.preloader').fadeOut(100); adaptHeight(); if ($('#top-banner').length) { @@ -48,12 +48,9 @@ }); // venobox popup - $(document).ready(function () { - new VenoBox({ - selector: '.vb-video', - spinner: 'grid' - }); - new VenoBox({ + $(document).ready(() => { + $('.vb-video').venobox({ spinner: 'grid' }); + $('.vb-gallery').venobox({ selector: '.vb-gallery', numeration: true, infinigall: true, @@ -64,48 +61,73 @@ }); // filter - $(document).ready(function () { - const shuffleInstance = new Shuffle($('.filter-container'), { - itemSelector: '.filter-item', - sizer: '.filter-sizer', // could also be a selector: '.js-shuffle-sizer' - delimiter: ',' - }); - $('.filter-controls li').on('click', function () { - $('.filter-controls li').removeClass('active'); - $(this).addClass('active'); - shuffleInstance.filter($(this).data('filter')) - }); + $(document).ready(() => { + if ($('.filter-container').length != 0) { + const shuffleInstance = new Shuffle($('.filter-container'), { + itemSelector: '.filter-item', + sizer: '.filter-sizer', + delimiter: ',' + }); + $('.filter-controls li').on('click',() => { + $('.filter-controls li').removeClass('active'); + $(this).addClass('active'); + shuffleInstance.filter($(this).data('filter')) + }); + } }); - // count up - function counter() { + // counter + $(window).on('scroll', () => { 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); - } - }); + $('.count').each(() => { + var $this = $(this), countTo = $this.attr('data-count'); + $({ countNum: $this.text() }).animate( + { countNum: countTo }, + { + duration: 1000, + easing: 'swing', + step: () => $this.text(Math.floor(this.countNum)), + complete: () => $this.text(this.countNum) + }); }); } - } - $(window).on('scroll', function () { - counter(); }); + + $(window).on('DOMContentLoaded', () => { + if (window.PagefindUI != undefined) { + new window.PagefindUI({ + element: "#search", + translations: { + placeholder: "Suchen...", + zero_results: "Leider konnten keine Ergebnisse zu [SEARCH_TERM] gefunden werden", + clear_search: "Löschen" + } + }); + + $('#pagefind-search').on('shown.bs.modal', () => { + $('.pagefind-ui__search-input').focus(); + }); + } + }); + + // enable matomo analytics + var _paq = window._paq = window._paq || []; + _paq.push(["setDoNotTrack", true]); + _paq.push(["disableCookies"]); + _paq.push(['trackPageView']); + _paq.push(['enableLinkTracking']); + (() => { + var u="https://analytics.cantorgymnasium.de/"; + _paq.push(['setTrackerUrl', u+'matomo.php']); + _paq.push(['setSiteId', '1']); + var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; + g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); + })(); + + new LazyLoad(); })(jQuery); diff --git a/config.yml b/config.yml index 30b67780..c9d07e87 100644 --- a/config.yml +++ b/config.yml @@ -34,12 +34,14 @@ params: - https://assets.cantorgymnasium.de/bootstrap/v5/css/bootstrap.min.css - https://assets.cantorgymnasium.de/slick/v1.8/slick.css - https://assets.cantorgymnasium.de/venobox/v2/dist/venobox.min.css - - https://assets.cantorgymnasium.de/fonts/fira/fira.css - - https://assets.cantorgymnasium.de/fonts/ubuntu/ubuntu.css + - https://assets.cantorgymnasium.de/fonts/fira/fira.min.css + - https://assets.cantorgymnasium.de/fonts/ubuntu/ubuntu.min.css + - /pagefind/pagefind-ui.css js: - https://assets.cantorgymnasium.de/bootstrap/v5/js/bootstrap.bundle.min.js - https://assets.cantorgymnasium.de/slick/v1.8/slick.min.js - https://assets.cantorgymnasium.de/lazyload/v17/dist/lazyload.min.js + - /pagefind/pagefind-ui.js head_js: - https://assets.cantorgymnasium.de/jquery/v3.7/jquery.min.js - https://assets.cantorgymnasium.de/venobox/v2/dist/venobox.min.js diff --git a/content/blog/einladung-weihnachtskonzert-2023.md b/content/blog/einladung-weihnachtskonzert-2023.md index 43c33a55..4e890112 100644 --- a/content/blog/einladung-weihnachtskonzert-2023.md +++ b/content/blog/einladung-weihnachtskonzert-2023.md @@ -2,7 +2,7 @@ title: Einladung Weihnachtskonzert 2023 date: 2023-11-04T23:10:45.890+01:00 draft: false -image: /media/gcgweihnachten.png +image: /media/blog/weihnachten.webp author: - herr-berger categories: diff --git a/content/chronikseiten/abiturdurchschnitte.md b/content/chronikseiten/abiturdurchschnitte.md index c2e30925..5c53fbef 100644 --- a/content/chronikseiten/abiturdurchschnitte.md +++ b/content/chronikseiten/abiturdurchschnitte.md @@ -10,15 +10,8 @@ type: pages aliases: - /schulchronik/pages/abiturdurchschnitte --- - - +
-
{{ end }} - - - - - - {{ $script := resources.Get "js/script.js" | minify }} - - - \ No newline at end of file + \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html index a0a3b6e0..a977e28f 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -17,9 +17,16 @@ + {{ if eq .Page.RelPermalink "/" }} + + {{ else }} + + {{ end }} + {{ range .Site.Params.plugins.head_js }} {{ end }} + - - {{ partial "opengraph" . }} {{ partial "twitter" . }} - - {{ if eq .Page.RelPermalink "/" }} - - {{ else }} - - {{ end }} - - \ No newline at end of file diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 2121cd92..5993a5d6 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -32,7 +32,7 @@ {{ end }}