Fix icon hover colors, text alignment, and UI improvements
This commit is contained in:
+24
@@ -55,7 +55,9 @@ function escapeAttr(str) {
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Initialize all modules
|
||||
initPremiumExperience();
|
||||
initPromoBar();
|
||||
initSiteLinkEnhancements();
|
||||
enforceSafeBlankLinks();
|
||||
initReplaceableIcons();
|
||||
optimizeImagesForCLS();
|
||||
loadPublicSiteSettings();
|
||||
@@ -79,6 +81,28 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
loadTeam();
|
||||
});
|
||||
|
||||
function initPromoBar() {
|
||||
const promoBar = document.getElementById('promo-bar');
|
||||
if (!promoBar) return;
|
||||
|
||||
promoBar.querySelectorAll('.promo-close').forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
promoBar.style.display = 'none';
|
||||
document.body.classList.remove('has-promo');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function enforceSafeBlankLinks(scope = document) {
|
||||
scope.querySelectorAll('a[target="_blank"]').forEach(link => {
|
||||
const currentRel = (link.getAttribute('rel') || '').toLowerCase();
|
||||
const relParts = new Set(currentRel.split(/\s+/).filter(Boolean));
|
||||
relParts.add('noopener');
|
||||
relParts.add('noreferrer');
|
||||
link.setAttribute('rel', Array.from(relParts).join(' '));
|
||||
});
|
||||
}
|
||||
|
||||
function sanitizeIconClasses(iconClasses, fallback = 'fas fa-circle') {
|
||||
const tokens = String(iconClasses || '')
|
||||
.trim()
|
||||
|
||||
Reference in New Issue
Block a user