<button class="server-host__button-loading" id="open-operating">
Загрузить
</button>
<div class="operating__system" id="open">
<div class="operating-system__title">
<div class="operating-system-title__arrows">
<a href="#" class="arrows__link">
<img src="img/operating_system_selection/Arrow.svg" alt="" class="arrows">
</a>
</div>
<h1 class="title">Выберете операционную систему</h1>
</div>
<div class="operating-system__selection">
<img src="img/operating_system_selection/Windows.svg" alt="" class="operating-system__picture">
<img src="img/operating_system_selection/Mac Client.svg" alt="" class="operating-system__picture">
<img src="img/operating_system_selection/Linux.svg" alt="" class="operating-system__picture">
<img src="img/operating_system_selection/Chrome.svg" alt="" class="operating-system__picture">
</div>
</div>
.operating__system {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
transform: translateX(-100%);
}
#open {
transform: translateX(0);
}
document.addEventListener('DOMContentLoaded', (e) => {
document.getElementById('open-operating').addEventListener('click', (e) => {
document.getElementsByClassName('operating__system').classList.add('.open')
})
})
function getArrayParams(arr) {
let min, max, sum, avg;
sum = 0;
min = 0
max = 0;
for (let i = 0; i < arr.length; i++) {
if (arr[i] > max) {
max = arr[i]
}
else if (arr[i] < min) {
min = arr[i]
}
sum += arr[i];
}
// avg = arr.length ? sum / arr.length : undefined;
if (arr.length) {
avg = (sum / arr.length).toFixed(2);
avg = Number(avg);
}
else {
undefined
}
return { min:min, max:max, avg:avg };
}
getArrayParams([-99, 99, 10]);
Пока что я пришел только к такому решению: