24 lines
583 B
JavaScript
24 lines
583 B
JavaScript
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);
|
|
},
|
|
});
|