webseite/layouts/_partials/head.html
Jannik Menzel 79e88ec9c2
All checks were successful
publish / publish (push) Successful in 25s
Event Calendar debug-version
2025-06-08 18:06:11 +02:00

81 lines
3.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<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"
rel="stylesheet"
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>
<!-- 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>
<!-- 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>
<!-- Event Calendar -->
<link href='https://cdn.jsdelivr.net/npm/fullcalendar@5/main.min.css' rel='stylesheet'/>
<script src='https://cdn.jsdelivr.net/npm/fullcalendar@5/main.min.js'></script>
<script src='https://cdn.jsdelivr.net/npm/ical.js@1.4.0/build/ical.min.js'></script>
<script>
document.addEventListener('DOMContentLoaded', async function () {
const calendarEl = document.getElementById('calendar');
const calendar = new FullCalendar.Calendar(calendarEl, {
initialView: 'dayGridMonth'
});
calendar.render();
try {
const response = await fetch('https://nc.ifsr.de/remote.php/dav/public-calendars/W5Sk7zLD28n6ze44/?export');
const icsData = await response.text();
const jcalData = ICAL.parse(icsData);
const comp = new ICAL.Component(jcalData);
const events = comp.getAllSubcomponents('vevent');
const fcEvents = events.map(event => {
const icalEvent = new ICAL.Event(event);
return {
title: icalEvent.summary,
start: icalEvent.startDate.toJSDate(),
end: icalEvent.endDate.toJSDate(),
description: icalEvent.description
};
});
calendar.addEventSource(fcEvents);
} catch (error) {
console.error('Fehler beim Laden oder Parsen der ICS-Datei:', error);
}
});
</script>
{{ partialCached "head/css.html" . }}
{{ partialCached "head/js.html" . }}