{ questionnaireSteps.contactUs && (<StepOneForm
statusStepOneForm={(value) => {setQuestionnaireSteps({...questionnaireSteps, contactUs: value}); console.log(value)}}
statusSmsPhone={(value) => setQuestionnaireSteps({...questionnaireSteps, phoneNumberVerification: value})}
phoneNumber={setPhoneNumber}
/>)}
const myFunc = (type, value) => {
console.log(value)
if(type === 'step') setQuestionnaireSteps({...questionnaireSteps, contactUs: value});
if(type === 'sms') (value) => setQuestionnaireSteps({...questionnaireSteps, phoneNumberVerification: value})
};
{ questionnaireSteps.contactUs && (<StepOneForm
statusStepOneForm={value => myFunc('step', value)}
statusSmsPhone={value => myFunc('sms', value)}
phoneNumber={setPhoneNumber}
/>)}
<input type="text" id='text'>
<p id='showText'></p>
function show_input_info(input, el) {
document.querySelector(input).addEventListener('input', e => {
document.querySelector(el).innerText = e.target.value;
});
}
show_input_info('#text', '#showText');
const presidents = [
{ first: 'George', last: 'Washington', born: 1732, died: 1799 },
{ first: 'John', last: 'Adams', born: 1735, died: 1826 },
{ first: 'Ronald', last: 'Reagan', born: 1911, died: 2004 },
];
let presidentsMap = presidents.map(item => ({first: item.first, last: item.last}));
console.log(presidentsMap)
const candidate = ['Jimmy', 'Rayn', 'Jack', 'Vladimir', 'joen', ];
const friend = candidate.filter(item => item[0].match(/J/i))
console.log(friend)
pc.createOffer({offerToReceiveVideo: true});
<div class="list">
<ul class="list__items current-list">
<li class="item">Egg - food</li>
<li class="item">Dog - animal</li>
<li class="item">Cat - animal</li>
<li class="item">Bread - food</li>
</ul>
<ul class="list__items new-list">
<!-- animal - список -->
</ul>
</div>
document.querySelector('.new-list').innerHTML = [...document.querySelectorAll('.current-list li')].map(el => {
if(el.innerText.indexOf('animal') > -1) return `<li class="item">${el.innerText}</li>`;
}).join('');
AOS.init();
const watch = document.querySelector("#watch");
let milliseconds = 0;
let timer;
function ImgForJs() {
window.open("https://website-about.neocities.org/main-page.html", "_blank")
}
function h1ForJs() {
window.open("https://website-about.neocities.org/main-page.html", "_blank")
}
function millisToHuman(milliseconds) {
return new Date(milliseconds).toISOString().slice(11, 23);
}
const startWatch = () => {
watch.classList.remove("paused");
clearInterval(timer);
timer = setInterval(() => {
milliseconds += 10;
const timeStr = millisToHuman(milliseconds);
result.innerHTML = timeStr;
watch.innerHTML = timeStr;
}, 10);
};
const pauseWatch = () => {
watch.classList.add("paused");
clearInterval(timer);
};
const resetWatch = () => {
watch.classList.remove("paused");
clearInterval(timer);
// milliseconds = 0;
watch.innerHTML = "00:00:00:00";
result.innerHTML = "00:00:00:00";
};
document.addEventListener("click", (e) => {
const element = e.target;
if (element.id === "start") startWatch();
if (element.id === "pause") pauseWatch();
if (element.id === "reset") resetWatch();
});
const laps = [];
function newLapTime() {
if(laps.length < 6) {
laps.push(`
<br/>
<div>
${millisToHuman(milliseconds)}
</div>`
); document.querySelector('.lapContainer').innerHTML = laps.join('');
}
// milliseconds = 0;
}