wip del err
This commit is contained in:
1 parent
812736ca9a
commit
9bcd4432c6
1210 files changed
-220941
No files matched your search
@@ -1 +0,0 @@
|
||||
import './bootstrap';
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
import axios from "axios";
|
||||
|
||||
window.axios = axios;
|
||||
|
||||
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest";
|
||||
@@ -1,43 +0,0 @@
|
||||
function animate(element, end, dezimal = 0) {
|
||||
var duration = 500;
|
||||
var element = document.getElementById(element);
|
||||
|
||||
const startTime = performance.now();
|
||||
|
||||
// Cubic easing function: slows down at the start and end
|
||||
const easeInOutCubic = (t) =>
|
||||
t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1;
|
||||
|
||||
const updateCount = (currentTime) => {
|
||||
const elapsedTime = currentTime - startTime;
|
||||
let progress = elapsedTime / duration;
|
||||
|
||||
// Clamp progress to ensure it doesn't overshoot
|
||||
if (progress > 1) progress = 1;
|
||||
|
||||
// Apply easing curve to progress
|
||||
const easedProgress = easeInOutCubic(progress);
|
||||
|
||||
// Calculate current value and round to integer
|
||||
const currentCount = Math.round(end * easedProgress * 100) / 100;
|
||||
|
||||
switch (dezimal) {
|
||||
case 1:
|
||||
element.innerHTML = currentCount.toFixed(1);
|
||||
break;
|
||||
case 2:
|
||||
element.innerHTML = currentCount.toFixed(2);
|
||||
break;
|
||||
|
||||
default:
|
||||
element.innerHTML = currentCount;
|
||||
break;
|
||||
}
|
||||
|
||||
if (progress < 1) {
|
||||
requestAnimationFrame(updateCount);
|
||||
}
|
||||
};
|
||||
|
||||
requestAnimationFrame(updateCount);
|
||||
}
|
||||
Reference in new issue
Block a user