Added fading for resume page.
This commit is contained in:
parent
7ddca3c39d
commit
3dad792c5f
4 changed files with 68 additions and 23 deletions
12
docs/src/js/resume.js
Normal file
12
docs/src/js/resume.js
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
window.addEventListener('scroll', function () {
|
||||
const contents = document.querySelectorAll('.fade-in-up-section');
|
||||
|
||||
contents.forEach(content => {
|
||||
const contentPosition = content.getBoundingClientRect().top;
|
||||
const screenPosition = window.innerHeight / 1.2;
|
||||
|
||||
if (contentPosition < screenPosition) {
|
||||
content.classList.add('visible');
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue