Add periodic event configuration
This commit is contained in:
parent
235a432e1b
commit
7e0833c2b9
14
events.js
Normal file
14
events.js
Normal 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' }
|
||||||
|
];
|
||||||
@ -136,6 +136,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script src="events.js"></script>
|
||||||
<script src="script.js"></script>
|
<script src="script.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
16
script.js
16
script.js
@ -810,6 +810,22 @@ function updateCalendar() {
|
|||||||
<div class="eonstrip-dates">
|
<div class="eonstrip-dates">
|
||||||
${startDate.toLocaleDateString('en-US', dateOpts)}
|
${startDate.toLocaleDateString('en-US', dateOpts)}
|
||||||
</div>`;
|
</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');
|
const tooltip = document.createElement('div');
|
||||||
tooltip.className = 'tooltip';
|
tooltip.className = 'tooltip';
|
||||||
tooltip.innerHTML = showEonstripDetails(i, cellCob, dateOpts);
|
tooltip.innerHTML = showEonstripDetails(i, cellCob, dateOpts);
|
||||||
|
|||||||
13
style.css
13
style.css
@ -256,6 +256,19 @@
|
|||||||
line-height: 1.4;
|
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 {
|
.time-details {
|
||||||
background: rgba(255, 255, 255, 0.05);
|
background: rgba(255, 255, 255, 0.05);
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user