From 981afc932183213ae2908d76895108c49a0e8480 Mon Sep 17 00:00:00 2001 From: Maaxxs <61059039+MaaxxsDev@users.noreply.github.com> Date: Fri, 25 Sep 2026 23:08:56 +0200 Subject: [PATCH] Calendar: long descriptions scroll in their box instead of stretching the entry A member asked for long calendar posts to be shortened with a scrollbar. The description of a member entry now shows at most a good five lines; the rest scrolls inside the box with the gold scrollbar, so title, participants and buttons stay in view. - While more text follows below, the bottom edge fades out (.has-more, set by assets/js/calendar.js on load, scroll and resize) - on phones the scrollbar only shows while scrolling. - calendar.js is now loaded for everyone, not only for members who may create entries; the map picker part still does nothing without its dialog. Co-Authored-By: Claude Opus 5.5 --- assets/css/style.css | 9 ++++++++- assets/js/calendar.js | 20 ++++++++++++++++++++ calendar.php | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/assets/css/style.css b/assets/css/style.css index ab19b9a..bd781f7 100644 --- a/assets/css/style.css +++ b/assets/css/style.css @@ -7051,7 +7051,14 @@ a.calendar-agenda-entry:hover { text-decoration: none; filter: brightness(1.2); .calendar-member-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.8rem; } .calendar-member-title { font-size: 1rem; } .calendar-member-author { display: inline-flex; align-items: center; gap: 0.35rem; margin-left: auto; font-size: 0.85rem; } -.calendar-member-description { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; } +/* Lange Beschreibungen scrollen in ihrem Feld, statt den Termin endlos lang zu machen: gut 5 Zeilen, die + angeschnittene letzte Zeile zeigt, dass noch mehr kommt */ +.calendar-member-description { max-height: 8.25em; margin: 0; padding-right: 0.4rem; overflow-y: auto; font-size: 0.9rem; overflow-wrap: anywhere; } +/* Unten kommt noch Text (assets/js/calendar.js): der Rand blendet aus */ +.calendar-member-description.has-more { + -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 2em), transparent); + mask-image: linear-gradient(to bottom, #000 calc(100% - 2em), transparent); +} .calendar-member-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; } /* Teilnehmer eines Mitglieder-Termins: Avatar-Reihe, aufklappbar zur Liste mit Namen */ .calendar-member-foot { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; } diff --git a/assets/js/calendar.js b/assets/js/calendar.js index 5b9ca24..c60f670 100644 --- a/assets/js/calendar.js +++ b/assets/js/calendar.js @@ -1,7 +1,27 @@ /** * Kalender: Treffpunkt eines Termins auf der Karte auswaehlen. Die Karte laeuft im Fenster * (map_frame.php?pick=1, der Viewer aus assets/map/) und schickt den gewaehlten Ort per postMessage zurueck. + * + * Dazu: Lange Beschreibungen von Mitglieder-Terminen scrollen in ihrem Feld (CSS). Solange darunter noch Text + * kommt, blendet der untere Rand aus (.has-more) - auch am Handy, wo der Scrollbalken erst beim Scrollen erscheint. */ +(function () { + 'use strict'; + + var descriptions = document.querySelectorAll('.calendar-member-description'); + function update(el) { + el.classList.toggle('has-more', el.scrollHeight - el.clientHeight - el.scrollTop > 1); + } + function updateAll() { + descriptions.forEach(update); + } + descriptions.forEach(function (el) { + el.addEventListener('scroll', function () { update(el); }, { passive: true }); + }); + updateAll(); + window.addEventListener('resize', updateAll); +})(); + (function () { 'use strict'; diff --git a/calendar.php b/calendar.php index 2d34c39..6419b05 100644 --- a/calendar.php +++ b/calendar.php @@ -359,6 +359,6 @@ include __DIR__ . '/includes/header.php'; - +