diff --git a/src/DejaVuSans.ttf b/src/DejaVuSans.ttf new file mode 100644 index 0000000..e5f7eec Binary files /dev/null and b/src/DejaVuSans.ttf differ diff --git a/src/modal.css b/src/modal.css index 194099e..53b1f44 100644 --- a/src/modal.css +++ b/src/modal.css @@ -1,3 +1,8 @@ +@font-face { + font-family: 'DejaVu Sans'; + src: local('DejaVu Sans'), url(./DejaVuSans.ttf); +} + .modal { position: fixed; z-index: 99; @@ -5,6 +10,19 @@ left: 0; width: 100%; height: 100%; + text-align: center; +} + +.modal:before { + content: ''; + display: inline-block; + height: 100%; + vertical-align: middle; +} + +.modal-content { + display: inline-block; + vertical-align: middle; } #loadingSpinner { @@ -12,3 +30,12 @@ background-repeat: no-repeat; background-position: center; } + +#errorModal { + background-color: rgba(200, 200, 200, 0.6); +} + +.modal-icon { + font-size: 10em; + font-family: 'DejaVu Sans'; +} diff --git a/src/wall-display.html b/src/wall-display.html index 94686f9..f54851f 100644 --- a/src/wall-display.html +++ b/src/wall-display.html @@ -8,6 +8,12 @@ +
diff --git a/src/wall-display.ts b/src/wall-display.ts index c9bce60..421a53f 100644 --- a/src/wall-display.ts +++ b/src/wall-display.ts @@ -30,7 +30,25 @@ const calendarOptions: CalendarOptions = { }; }) : [], + eventSourceFailure(error: { message: string }) { + console.error('Error fetching events', error); + const errorModal = document.getElementById('errorModal'); + if (errorModal) { + errorModal.style.display = ''; + const message = errorModal.querySelector('.modal-message'); + if (message) { + message.textContent = `Failed to fetch events: ${error.message}. Displayed events may not be accurate.`; + } + } + }, loading(isLoading: boolean) { + if (isLoading) { + const errorModal = document.getElementById('errorModal'); + if (errorModal) { + errorModal.style.display = 'none'; + } + } + const spinner = document.getElementById('loadingSpinner'); if (spinner) { spinner.style.display = isLoading ? '' : 'none';