From f1a0f407bdff5055f8f6aef32beaf418a1fd2bde Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Sat, 2 Sep 2023 17:10:48 +0200 Subject: [PATCH] fix: progress bar animations --- assets/js/main.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/assets/js/main.js b/assets/js/main.js index a9c07f8..ddd115d 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -175,17 +175,19 @@ /** * Skills animation */ - let skilsContent = select(".skills-content"); - if (skilsContent) { - new Waypoint({ - element: skilsContent, - offset: "80%", - handler: function(direction) { - let progress = select(".progress .progress-bar", true); - progress.forEach((el) => { - el.style.width = el.getAttribute("aria-valuenow") + "%"; - }); - }, + let skillsContent = select(".skills-content .progress", true); + if (skillsContent) { + skillsContent.forEach((skill) => { + new Waypoint({ + element: skill, + offset: "100%", + handler: function(direction) { + let progress = skill.querySelectorAll(".progress-bar"); + progress.forEach((el) => { + el.style.width = el.getAttribute("aria-valuenow") + "%"; + }); + }, + }); }); }