initial page
This commit is contained in:
23
assets/js/landing-page-animations.js
Normal file
23
assets/js/landing-page-animations.js
Normal file
@@ -0,0 +1,23 @@
|
||||
const { animate, scroll } = Motion;
|
||||
|
||||
const yearsExperience = document.getElementById("years-experience");
|
||||
const programmingLangues = document.getElementById("programming-languages");
|
||||
|
||||
const startDate = new Date("2019-01-01");
|
||||
years = Math.floor((new Date() - startDate) / 1000 / 60 / 60 / 24 / 365);
|
||||
|
||||
animate(0, years, {
|
||||
duration: 2,
|
||||
ease: "circOut",
|
||||
onUpdate: (latest) => {
|
||||
yearsExperience.innerHTML = Math.round(latest);
|
||||
},
|
||||
});
|
||||
|
||||
animate(0, 4, {
|
||||
duration: 2,
|
||||
ease: "circOut",
|
||||
onUpdate: (latest) => {
|
||||
programmingLangues.innerHTML = Math.round(latest);
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user