Add periodic event configuration

This commit is contained in:
Kiyomichi Kosaka 2025-06-12 20:19:27 +02:00
parent 235a432e1b
commit 7e0833c2b9
4 changed files with 44 additions and 0 deletions

14
events.js Normal file
View File

@ -0,0 +1,14 @@
// Configuration of periodic events in CoBiE time
// Each event repeats every cosmocycle.
// "cobie" is the timestamp within the cosmocycle when the event occurs.
// "tag" is a short label that will be displayed on the calendar.
window.SPECIAL_EVENTS = [
{ cobie: '49f4.9332', label: 'Afina', megasequence: 'Mythran Epoch', eonstrip: 'Ventaso' },
{ cobie: '11e5.f552', label: 'Oleks', megasequence: 'Umbral Echo', eonstrip: 'Ignisar' },
{ cobie: '4d07.a2b2', label: 'Vincent', megasequence: 'Azurean Tide', eonstrip: 'Floraen' },
{ cobie: '3edc.d430', label: 'Hochzeitstag', megasequence: 'Lustran Bounty', eonstrip: 'Electros' },
{ cobie: '330d.d4ae', label: 'Zusammentag', megasequence: 'Azurean Tide', eonstrip: 'Chronar' },
{ cobie: '11de.0c52', label: 'Anna', megasequence: 'Lustran Bounty', eonstrip: 'Radiantae' },
{ cobie: '467f.ae61', label: 'Iris', megasequence: 'Argent Veil', eonstrip: 'Etherion' }
];

View File

@ -136,6 +136,7 @@
</div>
</div>
<script src="events.js"></script>
<script src="script.js"></script>
</body>
</html>

View File

@ -810,6 +810,22 @@ function updateCalendar() {
<div class="eonstrip-dates">
${startDate.toLocaleDateString('en-US', dateOpts)}
</div>`;
if (Array.isArray(window.SPECIAL_EVENTS)) {
const offsetStart = ((cellCob % COBIE_UNITS.cosmocycle) + COBIE_UNITS.cosmocycle) % COBIE_UNITS.cosmocycle;
const offsetEnd = offsetStart + COBIE_UNITS.eonstrip;
window.SPECIAL_EVENTS.forEach(ev => {
const evCob = parseCobiets(ev.cobie);
if (evCob === null) return;
const evOffset = ((evCob % COBIE_UNITS.cosmocycle) + COBIE_UNITS.cosmocycle) % COBIE_UNITS.cosmocycle;
if (evOffset >= offsetStart && evOffset < offsetEnd) {
const tag = document.createElement('div');
tag.className = 'event-tag';
tag.textContent = ev.label;
card.appendChild(tag);
}
});
}
const tooltip = document.createElement('div');
tooltip.className = 'tooltip';
tooltip.innerHTML = showEonstripDetails(i, cellCob, dateOpts);

View File

@ -256,6 +256,19 @@
line-height: 1.4;
}
.event-tag {
display: inline-block;
margin-top: 4px;
padding: 2px 6px;
font-size: 0.75em;
font-weight: 600;
color: #fff;
background: linear-gradient(135deg, rgba(0,255,255,0.25), rgba(255,0,255,0.25));
border: 1px solid rgba(255,255,255,0.2);
border-radius: 4px;
text-shadow: 0 0 6px rgba(0,255,255,0.7);
}
.time-details {
background: rgba(255, 255, 255, 0.05);
border-radius: 10px;