mirror of
https://github.com/michivonah/website-v3.git
synced 2025-12-22 21:36:28 +01:00
implement contact me section
This commit is contained in:
parent
112f84b1ca
commit
a8753d42b2
6 changed files with 123 additions and 1 deletions
|
|
@ -46,4 +46,21 @@ function scrollTopVisibilityUpdate(){
|
|||
const scrollTop = document.querySelector(".scroll-top");
|
||||
scrollTop.style.display = ((window.scrollY > 20) ? 'flex' : 'none');
|
||||
scrollTop.style.right = ((window.scrollY > 20) ? '0' : '-55px');
|
||||
}
|
||||
}
|
||||
|
||||
// intersection observer for animations
|
||||
// credits: https://coolcssanimation.com/how-to-trigger-a-css-animation-on-scroll/
|
||||
const observer = new IntersectionObserver(entries => {
|
||||
entries.forEach(entry => {
|
||||
const actionObject = entry.target.querySelector('.contact-title');
|
||||
|
||||
if (entry.isIntersecting) {
|
||||
actionObject.classList.add('typewriter-animation');
|
||||
return;
|
||||
}
|
||||
|
||||
actionObject.classList.remove('typewriter-animation');
|
||||
});
|
||||
});
|
||||
|
||||
observer.observe(document.querySelector('.contact-title-wrapper'));
|
||||
Loading…
Add table
Add a link
Reference in a new issue