refactoring

This commit is contained in:
frankknoll
2023-04-18 17:21:41 +02:00
parent 71c7f8d261
commit 0fc151cccc
3 changed files with 23 additions and 9 deletions

View File

@@ -0,0 +1,14 @@
class NumberWithBarElementFactory {
static createNumberWithBarElement({ number, barLenInPercent }) {
const numberWithBarElement = UIUtils.instantiateTemplate('template-number-with-bar');
const barElement = numberWithBarElement.querySelector('.bar');
barElement.style.width = barLenInPercent.toString() + "%";
const numberElement = numberWithBarElement.querySelector('.number');
numberElement.textContent = number;
return numberWithBarElement;
}
}