Add references section

This commit is contained in:
2021-10-18 09:30:35 +01:00
parent aa97aaf12c
commit 743c82b5a5
5 changed files with 55 additions and 0 deletions

View File

@ -75,3 +75,19 @@ anime({
delay: 3000,
easing: 'easeInOutExpo'
});
var HIGHLIGHT_DURATION = 4000;
// Highlight References
document.addEventListener('DOMContentLoaded', function() {
document.querySelectorAll('[href^="#ref-"]').forEach(function(a) {
a.addEventListener('click', function() {
var target = document.getElementById(a.href.slice(a.href.indexOf('#') + 1));
target.classList.add('highlight');
setTimeout(function() {
target.classList.remove('highlight');
}, HIGHLIGHT_DURATION);
});
});
});