font load detection

This commit is contained in:
Anthony Stirling
2024-05-18 12:47:21 +01:00
parent b860146c93
commit f0dd48b3b1
5 changed files with 29 additions and 3 deletions

View File

@@ -85,3 +85,15 @@ function initializeCards() {
}
window.onload = initializeCards;
document.addEventListener("DOMContentLoaded", function() {
const materialIcons = new FontFaceObserver('Material Symbols Rounded');
materialIcons.load().then(() => {
document.querySelectorAll('.feature-card.hidden').forEach(el => {
el.classList.remove('hidden');
});
}).catch(() => {
console.error('Material Symbols Rounded font failed to load.');
});
});