updated header, footer and feed js
All checks were successful
publish / publish (push) Successful in 23s
All checks were successful
publish / publish (push) Successful in 23s
This commit is contained in:
parent
e76e021d97
commit
9b3a38fa16
4 changed files with 82 additions and 49 deletions
|
@ -1,5 +1,3 @@
|
|||
// noinspection JSUnresolvedReference
|
||||
|
||||
/* ========================
|
||||
Darkmode
|
||||
======================== */
|
||||
|
@ -62,6 +60,8 @@ window.toggleDetails = function (element) {
|
|||
/* ========================
|
||||
News Feed
|
||||
======================== */
|
||||
let lastColumnCount = null;
|
||||
|
||||
function renderFeedEntries(data) {
|
||||
const container = document.getElementById('feed');
|
||||
if (!container) return;
|
||||
|
@ -71,6 +71,7 @@ function renderFeedEntries(data) {
|
|||
if (isInFeedSection) {
|
||||
const computedStyle = window.getComputedStyle(container);
|
||||
const columnCount = computedStyle.getPropertyValue('grid-template-columns').split(' ').length;
|
||||
lastColumnCount = columnCount;
|
||||
maxItems = columnCount === 3 ? 3 : 4;
|
||||
} else {
|
||||
maxItems = data.items.length;
|
||||
|
@ -119,6 +120,14 @@ fetch('https://api.rss2json.com/v1/api.json?rss_url=https://toot.kif.rocks/@ifsr
|
|||
.then(data => {
|
||||
renderFeedEntries(data);
|
||||
window.addEventListener('resize', () => {
|
||||
renderFeedEntries(data);
|
||||
const container = document.getElementById('feed');
|
||||
if (!container) return;
|
||||
|
||||
const computedStyle = window.getComputedStyle(container);
|
||||
const columnCount = computedStyle.getPropertyValue('grid-template-columns').split(' ').length;
|
||||
|
||||
if (columnCount !== lastColumnCount) {
|
||||
renderFeedEntries(data);
|
||||
}
|
||||
});
|
||||
});
|
|
@ -1,36 +1,55 @@
|
|||
<!-- Footer -->
|
||||
<footer class="footer">
|
||||
<div class="container text-center">
|
||||
{{ if eq .Site.Language.Lang "de" }}
|
||||
<p>© 2025 iFSR. Alle Rechte vorbehalten.</p>
|
||||
<nav class="footer-nav">
|
||||
<ul>
|
||||
<li><a href="/barrierefreiheit">Barrierefreiheit</a></li>
|
||||
<li><a href="/datenschutz">Datenschutz</a></li>
|
||||
<li><a href="/impressum">Impressum</a></li>
|
||||
</ul>
|
||||
<hr>
|
||||
<ul>
|
||||
<li><a href="/de" onclick="localStorage.setItem('language', 'de');">Deutsch</a></li>
|
||||
<li>|</li>
|
||||
<li><a href="/en" onclick="localStorage.setItem('language', 'en');">English</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
{{ else }}
|
||||
<p>© 2025 iFSR. All rights reserved.</p>
|
||||
<nav class="footer-nav">
|
||||
<ul>
|
||||
<li><a href="/en/barrierefreiheit">Accessibility</a></li>
|
||||
<li><a href="/en/datenschutz">Privacy</a></li>
|
||||
<li><a href="/en/impressum">Legal Notice</a></li>
|
||||
</ul>
|
||||
<hr>
|
||||
<ul>
|
||||
<li><a href="/de" onclick="localStorage.setItem('language', 'de');">German</a></li>
|
||||
<li>|</li>
|
||||
<li><a href="/en" onclick="localStorage.setItem('language', 'en');">English</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
{{ end }}
|
||||
<p>
|
||||
{{ if eq .Site.Language.Lang "de" }}
|
||||
© 2025 iFSR. Alle Rechte vorbehalten.
|
||||
{{ else }}
|
||||
© 2025 iFSR. All rights reserved.
|
||||
{{ end }}
|
||||
</p>
|
||||
<nav class="footer-nav">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ if eq .Site.Language.Lang "de" }}/barrierefreiheit{{ else }}/en/barrierefreiheit{{ end }}">
|
||||
{{ if eq .Site.Language.Lang "de" }}Barrierefreiheit{{ else }}Accessibility{{ end }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ if eq .Site.Language.Lang "de" }}/datenschutz{{ else }}/en/datenschutz{{ end }}">
|
||||
{{ if eq .Site.Language.Lang "de" }}Datenschutz{{ else }}Privacy{{ end }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ if eq .Site.Language.Lang "de" }}/impressum{{ else }}/en/impressum{{ end }}">
|
||||
{{ if eq .Site.Language.Lang "de" }}Impressum{{ else }}Legal Notice{{ end }}
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#" id="lang-de-link">
|
||||
{{ if eq .Site.Language.Lang "de" }}Deutsch{{ else }}German{{ end }}
|
||||
</a>
|
||||
</li>
|
||||
<li>|</li>
|
||||
<li>
|
||||
<a href="#" id="lang-en-link">English</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
<script>
|
||||
document.getElementById('lang-en-link').addEventListener('click', function(event) {
|
||||
event.preventDefault();
|
||||
localStorage.setItem('language', 'en');
|
||||
window.location.pathname = '/en' + window.location.pathname.replace(/^\/(de|en)/, '');
|
||||
});
|
||||
document.getElementById('lang-de-link').addEventListener('click', function(event) {
|
||||
event.preventDefault();
|
||||
localStorage.setItem('language', 'de');
|
||||
window.location.pathname = '/' + window.location.pathname.replace(/^\/(de|en)/, '');
|
||||
});
|
||||
</script>
|
||||
</footer>
|
|
@ -3,10 +3,12 @@
|
|||
<meta name="description"
|
||||
content="Offizielle Website des iFSR – Informationen, Veranstaltungen und Ressourcen für Studierende der Informatik an der TU Dresden.">
|
||||
<link rel="icon" href="{{ "favicon.ico" | relURL }}" type="image/x-icon">
|
||||
|
||||
<!-- SVG Preload -->
|
||||
<link rel="preload" href="/images/logo.svg" as="image" type="image/svg+xml">
|
||||
<link rel="preload" href="/icons/dark.svg" as="image" type="image/svg+xml">
|
||||
<link rel="preload" href="/icons/light.svg" as="image" type="image/svg+xml">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<link
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css"
|
||||
|
@ -14,16 +16,34 @@
|
|||
integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<script
|
||||
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"
|
||||
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
|
||||
<!-- Exo 2 Font -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Exo+2:wght@400;500;600&display=swap" rel="stylesheet"/>
|
||||
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
|
||||
|
||||
<!-- Darkmode JS -->
|
||||
<script>
|
||||
(function () {
|
||||
try {
|
||||
const stored = localStorage.getItem("theme");
|
||||
const systemPrefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
const isDark = stored ? stored === "dark" : systemPrefersDark;
|
||||
if (isDark) {
|
||||
document.documentElement.classList.add("dark");
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore errors
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- JS Partials -->
|
||||
{{ partial "scripts.html" . }}
|
||||
{{ partial "event-calendar.html" . }}
|
||||
|
|
|
@ -1,18 +1,3 @@
|
|||
<!-- Darkmode JS -->
|
||||
<script>
|
||||
(function () {
|
||||
try {
|
||||
const stored = localStorage.getItem("theme");
|
||||
const systemPrefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
const isDark = stored ? stored === "dark" : systemPrefersDark;
|
||||
if (isDark) {
|
||||
document.documentElement.classList.add("dark");
|
||||
}
|
||||
} catch (e) {
|
||||
// ignore errors
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
<!-- Localization Auto Redirect -->
|
||||
{{ if .IsHome }}
|
||||
<script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue