.fotbar-nav {
font-size: 130%;
}
ul {
display: flex;
list-style: none;
gap: 10px;
}
.nav_link {
color: #fff;
}
.end_foot {
text-align: center;
color: #fff;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
font-size: 15px;
font-style: normal;
font-weight: 400;
line-height: normal;
} { name: 'Вася', age: 25 }function getAvarageAge(arr) {
return arr.reduce((sum, item) => sum + item.age, 0) / arr.length;
}
let vasya = { name: 'Вася', age: 25 };
let petya = { name: 'Петя', age: 30 };
let masha = { name: 'Маша', age: 29 };
let arr = [vasya, petya, masha];
console.log(getAvarageAge(arr)); // 28 data: {
projects: [ ... ]
}<div class="project" v-for="p in projects">
<div class="project__pin">{{ p.pin }}</div>
</div> tofixed, умножение на 100 и деление. округление все это не подходит.
w = val * 100 / max; - ширина в процентах, если бы была одна линия.ceil(w / 25) кол-во полностью закрашенных частей(w % 25) * 100 / 25 - ширина в процентах частично закрашенной части/**
* chapter - номер полоски, от 1 до 4
* val - текущее значение
* max - максимальное значение
* Возвращает ширину полоски в процентах
*/
getWidth(chapter, val, max) {
const CHAPTERS = 4;
const p = 100 / CHAPTERS;
let full = Math.ceil(w / p);
let w = val * 100 / max;
if (chapter <= full) return 100;
if (chapter === full + 1) return (w % p) * 100 / p;
return 0;
}<div class="chapter-progress"
:style="{width: getWidth(chapter, property.value, property.maxValue)+'%'}"
></div>