mod: Улучшены SEO и LLMO
This commit is contained in:
@@ -68,16 +68,19 @@ document.addEventListener("DOMContentLoaded", function() {
|
||||
document.body.addEventListener('click', function(e) {
|
||||
// Find if a link was clicked (bubble up)
|
||||
const link = e.target.closest('a');
|
||||
if (link && link.href && link.target !== '_blank' && !link.href.startsWith('#') && !link.href.includes('javascript:')) {
|
||||
// Check if it is an internal link (same domain)
|
||||
if (new URL(link.href).origin === window.location.origin) {
|
||||
e.preventDefault(); // Stop immediate navigation
|
||||
document.body.style.opacity = 0; // Start Fade Out
|
||||
if (link && link.href && link.target !== '_blank') {
|
||||
const hrefAttr = link.getAttribute('href');
|
||||
if (hrefAttr && !hrefAttr.startsWith('#') && !link.href.includes('javascript:')) {
|
||||
// Check if it is an internal link (same domain)
|
||||
if (new URL(link.href).origin === window.location.origin) {
|
||||
e.preventDefault(); // Stop immediate navigation
|
||||
document.body.style.opacity = 0; // Start Fade Out
|
||||
|
||||
// Wait for transition (matches CSS transition time 1.5s)
|
||||
setTimeout(() => {
|
||||
window.location.href = link.href;
|
||||
}, 900);
|
||||
// Wait for transition (matches CSS transition time 1.5s)
|
||||
setTimeout(() => {
|
||||
window.location.href = link.href;
|
||||
}, 900);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user