refactor: remove unnecessary comments and variables
Some checks failed
CI / Get Changed Files (pull_request) Successful in 6s
CI / Checkstyle Main (pull_request) Has been skipped
CI / prettier (pull_request) Failing after 23s
CI / eslint (pull_request) Successful in 1m41s
CI / test-build (pull_request) Successful in 1m53s

This commit is contained in:
Jan-Marlon Leibl 2025-04-03 10:03:37 +02:00
parent 4b70a4ac4a
commit 28f7b15d4c
Signed by: jleibl
GPG key ID: 300B2F906DC6F1D5
2 changed files with 1 additions and 6 deletions

View file

@ -34,14 +34,11 @@ export class AnimatedNumberComponent implements OnChanges, AfterViewInit {
ngOnChanges(changes: SimpleChanges): void {
if (changes['value']) {
if (this.countUp) {
const startVal = this.previousValue;
const endVal = this.value;
// Update the CountUp instance with new start and end values
this.countUp.update(endVal);
this.previousValue = endVal;
} else {
// Format the initial value if CountUp is not yet initialized
this.formattedValue = new Intl.NumberFormat('de-DE', {
style: 'currency',
currency: 'EUR',
@ -58,11 +55,10 @@ export class AnimatedNumberComponent implements OnChanges, AfterViewInit {
startVal: this.previousValue,
duration: this.duration,
easingFn: (t, b, c, d) => {
// Custom easing function based on the input ease type
if (this.ease === 'power1.out') {
return c * (1 - Math.pow(1 - t / d, 1)) + b;
}
return c * (t / d) + b; // linear fallback
return c * (t / d) + b;
},
formattingFn: (value) => {
const formatted = new Intl.NumberFormat('de-DE', {