update
This commit is contained in:
35
footer.php
35
footer.php
@@ -220,6 +220,41 @@
|
||||
|
||||
<!-- JS
|
||||
============================================ -->
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
|
||||
// Counter animation
|
||||
const counters = document.querySelectorAll(".counter");
|
||||
|
||||
counters.forEach(counter => {
|
||||
const target = +counter.getAttribute("data-score");
|
||||
let count = 0;
|
||||
|
||||
const updateCounter = () => {
|
||||
if (count < target) {
|
||||
count++;
|
||||
counter.innerText = count;
|
||||
setTimeout(updateCounter, 120);
|
||||
} else {
|
||||
counter.innerText = target;
|
||||
}
|
||||
};
|
||||
|
||||
updateCounter();
|
||||
});
|
||||
|
||||
// Progress bar animation
|
||||
const bars = document.querySelectorAll(".bar span");
|
||||
|
||||
setTimeout(() => {
|
||||
bars.forEach(bar => {
|
||||
const width = bar.getAttribute("data-progress");
|
||||
bar.style.width = width + "%";
|
||||
});
|
||||
}, 300);
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
<script src="assets/js/vendor/jquery.min.js" defer></script>
|
||||
|
||||
Reference in New Issue
Block a user