let result = '-';
let max = 3;
for (let i = 1; i <= max; i++) {
for (let j = 1; j <= i; j++) {
result += 'x';
}
result += '-';
}
for (let i = max - 1; i >= 1; i--) {
for (let j = 1; j <= i; j++) {
result += 'x';
}
result += '-';
}
console.log(result);
let result = '-';
let max = 3;
const count = (max - 1) * 2 + 1;
for (let i = 1; i <= count; i++) {
let cond = i <= max ? i : count - i + 1;
for (let j = 1; j <= cond; j++) result += 'x';
result += '-';
}
console.log(result);
<script src="main.js" type="module"></script>
import ru from "./ru";
const input = document.querySelector("#phone");
intlTelInput(input, {
i18n: ru,
initialCountry: "ru",
});
<script type="module">
import ru from "./ru";
const input = document.querySelector("#phone");
intlTelInput(input, {
i18n: ru,
initialCountry: "ru",
});
</script>
doOrderBtn.addEventListener('click', function (el) {
const phio = document.querySelector('#name')
const phone = document.querySelector('#phone')
const address = document.querySelector('#address')
if (phio.value < 1 && phone.value < 1 && address.value < 1) {
el.preventDefault()
}
});
window.addEventListener('scroll', function () {
const currentScrollTop = window.pageYOffset || document.documentElement.scrollTop;
document.body.classList.toggle('scrolled', currentScrollTop > 0)
});
body.scrolled
.topbar__bottom-consult {
opacity: 0;
transition: 0.3s ease;
}
body.scrolled .topbar__bottom-consult {
opacity: 1;
}
position:sticky
.topbar__bottom {
position: sticky;
top: 0;
}
/[a-z0-9!@#$%^&*\(\)_\+]/i