forked from cccb-website-team/www
adjust styling and bump dates etc
This commit is contained in:
parent
476bf0d6d9
commit
a584a5252f
40 changed files with 678 additions and 294 deletions
|
|
@ -35,6 +35,8 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
event.description = value;
|
||||
} else if (baseKey === "RRULE") {
|
||||
event.rrule = value;
|
||||
} else if (baseKey === "URL") {
|
||||
event.url = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -281,13 +283,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
const events = eventsByDate[dateKey];
|
||||
const hasMembersOnly = events.some(e => e.summary.toLowerCase().includes("members only"));
|
||||
const hasSubbotnik = events.some(e => e.summary.toLowerCase().includes("subbotnik"));
|
||||
const hasBastelabend = events.some(e => e.summary.toLowerCase().includes("bastelabend"));
|
||||
const hasSpieleabend = events.some(e => e.summary.toLowerCase().includes("spieleabend"));
|
||||
const hasRegular = events.some(e => {
|
||||
const title = e.summary.toLowerCase();
|
||||
return !title.includes("members only") &&
|
||||
!title.includes("subbotnik") &&
|
||||
!title.includes("bastelabend") &&
|
||||
!title.includes("spieleabend");
|
||||
});
|
||||
|
||||
|
|
@ -297,7 +297,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
dot.className = "event-dot event-dot-red";
|
||||
dotsContainer.appendChild(dot);
|
||||
}
|
||||
if (hasSubbotnik || hasBastelabend || hasSpieleabend) {
|
||||
if (hasSubbotnik || hasSpieleabend) {
|
||||
let dot = document.createElement("div");
|
||||
dot.className = "event-dot event-dot-orange";
|
||||
dotsContainer.appendChild(dot);
|
||||
|
|
@ -329,20 +329,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
calendarBody.appendChild(row);
|
||||
}
|
||||
|
||||
function createEventLink(eventTitle) {
|
||||
if (eventTitle.startsWith("Datengarten")) {
|
||||
// Extract the number after "Datengarten "
|
||||
const match = eventTitle.match(/Datengarten\s+(\d+)/i);
|
||||
if (match && match[1]) {
|
||||
return `https://berlin.ccc.de/datengarten/${match[1]}/`;
|
||||
}
|
||||
}
|
||||
|
||||
// For other titles, convert to lowercase and use as path
|
||||
const slug = eventTitle.toLowerCase().replace(/\s+/g, '-').replace(/[^\w-]/g, '');
|
||||
return `https://berlin.ccc.de/page/${slug}/`;
|
||||
}
|
||||
|
||||
function showEventDetails(dateKey) {
|
||||
const events = eventsByDate[dateKey];
|
||||
eventDateElem.textContent = formatDate(dateKey);
|
||||
|
|
@ -357,10 +343,16 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
eventTitle.className = "event-title";
|
||||
|
||||
// Create a link for the event title
|
||||
let titleLink = document.createElement("h");
|
||||
titleLink.textContent = ev.summary;
|
||||
titleLink.target = "_blank";
|
||||
eventTitle.appendChild(titleLink);
|
||||
if (ev.url) {
|
||||
let titleLink = document.createElement("a");
|
||||
titleLink.textContent = ev.summary;
|
||||
titleLink.href = ev.url;
|
||||
titleLink.target = "_blank";
|
||||
titleLink.rel = "noopener noreferrer";
|
||||
eventTitle.appendChild(titleLink);
|
||||
} else {
|
||||
eventTitle.textContent = ev.summary;
|
||||
}
|
||||
|
||||
eventItem.appendChild(eventTitle);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,25 +1,21 @@
|
|||
const spaceapiUrl = "https://spaceapi.hamburg.ccc.de"
|
||||
const interval_ms = 60000
|
||||
|
||||
console.log("clubstatus.js geladen!"); /* TODO: ENTFERNEN */
|
||||
|
||||
function timeDistanceDE(pastDate) {
|
||||
const seconds = Math.floor((Date.now() - pastDate.getTime()) / 1000)
|
||||
const minutes = Math.floor(seconds / 60)
|
||||
const hours = Math.floor(minutes / 60)
|
||||
const days = Math.floor(hours / 24)
|
||||
|
||||
if (days = 1) return `since ${days}d`
|
||||
if (days > 1) return `since ${days}d`
|
||||
if (hours = 1) return `since ${hours}h`
|
||||
if (hours > 1) return `since ${hours}h`
|
||||
if (minutes = 1) return `since ${minutes}min`
|
||||
if (minutes > 1) return `since ${minutes}min`
|
||||
if (days >= 1) return `seit ${days}d`
|
||||
if (hours >= 1) return `seit ${hours}h`
|
||||
if (minutes >= 1) return `seit ${minutes}min`
|
||||
return `gerade eben`
|
||||
}
|
||||
|
||||
function updateRoomState(openState, lastChangeTimestamp) {
|
||||
const roomstate = document.querySelector('#clubstatus-badge')
|
||||
if (!roomstate) return
|
||||
const statusItem = roomstate.querySelector(".state")
|
||||
const durationItem = roomstate.querySelector(".duration")
|
||||
|
||||
|
|
@ -30,17 +26,20 @@ function updateRoomState(openState, lastChangeTimestamp) {
|
|||
|
||||
if (openState === null || lastChangeTimestamp === null) {
|
||||
statusItem.textContent = "unbekannt"
|
||||
roomstate.classList.add("unknown")
|
||||
statusItem.classList.add("unknown")
|
||||
durationItem.textContent = "(since unbekannt)"
|
||||
durationItem.textContent = "(seit unbekannt)"
|
||||
} else {
|
||||
const changeDate = new Date(lastChangeTimestamp * 1000)
|
||||
const sinceText = timeDistanceDE(changeDate)
|
||||
|
||||
if (openState) {
|
||||
statusItem.textContent = "open"
|
||||
roomstate.classList.add("open")
|
||||
statusItem.classList.add("open")
|
||||
} else {
|
||||
statusItem.textContent = "closed"
|
||||
roomstate.classList.add("closed")
|
||||
statusItem.classList.add("closed")
|
||||
}
|
||||
|
||||
|
|
|
|||
62
assets/js/fairydust.js
Normal file
62
assets/js/fairydust.js
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
(function () {
|
||||
'use strict';
|
||||
|
||||
var SVG = [
|
||||
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 80" width="40" height="80">',
|
||||
// Exhaust flame
|
||||
'<path d="M13,65 Q20,80 27,65" fill="#f97316" opacity="0.85"/>',
|
||||
'<path d="M15,63 Q20,74 25,63" fill="#fbbf24"/>',
|
||||
// Fins
|
||||
'<path d="M11,53 L3,70 L14,58" fill="#a855f7"/>',
|
||||
'<path d="M29,53 L37,70 L26,58" fill="#a855f7"/>',
|
||||
// Body
|
||||
'<ellipse cx="20" cy="42" rx="11" ry="22" fill="#e879f9"/>',
|
||||
// Nose cone
|
||||
'<path d="M20,10 L10,32 L30,32 Z" fill="#c026d3"/>',
|
||||
// Window
|
||||
'<circle cx="20" cy="44" r="7" fill="#0ea5e9" opacity="0.82"/>',
|
||||
'<circle cx="22" cy="41" r="2.5" fill="white" opacity="0.35"/>',
|
||||
// Body highlight
|
||||
'<ellipse cx="15" cy="36" rx="3" ry="8" fill="white" opacity="0.15" transform="rotate(-15,15,36)"/>',
|
||||
'</svg>'
|
||||
].join('');
|
||||
|
||||
function isDark() {
|
||||
return document.documentElement.classList.contains('dark');
|
||||
}
|
||||
|
||||
function launch() {
|
||||
if (!isDark()) { scheduleNext(); return; }
|
||||
|
||||
var goRight = Math.random() > 0.5;
|
||||
var topPct = 6 + Math.random() * 72;
|
||||
var duration = (3.5 + Math.random() * 4).toFixed(1);
|
||||
|
||||
var wrapper = document.createElement('div');
|
||||
wrapper.className = 'fairydust-wrapper ' + (goRight ? 'go-right' : 'go-left');
|
||||
wrapper.style.top = topPct + 'vh';
|
||||
wrapper.style.setProperty('--fly-duration', duration + 's');
|
||||
|
||||
var rocket = document.createElement('div');
|
||||
rocket.className = 'fairydust-rocket';
|
||||
rocket.style.transform = 'rotate(' + (goRight ? 90 : -90) + 'deg)';
|
||||
rocket.innerHTML = SVG;
|
||||
|
||||
wrapper.appendChild(rocket);
|
||||
document.body.appendChild(wrapper);
|
||||
|
||||
wrapper.addEventListener('animationend', function (e) {
|
||||
if (e.animationName === 'fairydust-fly-right' ||
|
||||
e.animationName === 'fairydust-fly-left') {
|
||||
wrapper.remove();
|
||||
}
|
||||
});
|
||||
|
||||
scheduleNext();
|
||||
}
|
||||
|
||||
function scheduleNext() {
|
||||
setTimeout(launch, 250000 + Math.random() * 950000); // 250–1200 s
|
||||
}
|
||||
|
||||
})();
|
||||
Loading…
Reference in a new issue