<div class="popup" id="popup">
<div class="popup-content">
<div class="popup-container">
<span class="close-popup" id="close-popup">×</span>
<h2>Заказать звонок</h2>
<form id="contact-form">
<div class="form-name">
<label for="name">Имя</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-name">
<label for="phone">Телефон</label>
<input type="tel" id="phone" name="phone" value="+7" required>
</div>
<div class="form-name">
<label for="time">Удобное время для звонка</label>
<input type="time" id="time" name="time" required>
<p class="time-text">Мы можем перезвонить в любой день с 9:00 до 22:00</p>
</div>
<button type="submit">Отправить</button>
<p class="button-text"><span class="gray-text">Нажимая на кнопку, вы соглашаетесь с политикой</span> <span class="red-text">защиты персональной информации.</span></p>
</form>
</div>
</div>
</div>
.popup {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
z-index: 1000;
display: flex;
justify-content: center;
align-items: center;
}
.popup h2{
color: #F05A26;
}
.popup-content {
background: #fff;
padding: 20px;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5);
position: relative;
width: 450px;
height: 605px;
}
.popup-container{
margin: auto;
max-width: 85%;
}
.close-popup {
position: absolute;
top: 10px;
right: 20px;
font-size: 35px;
cursor: pointer;
}
#contact-form {
display: flex;
flex-direction: column;
gap: 10px;
}
label {
font-weight: bold;
}
input[type="text"],
input[type="tel"],
input[type="time"] {
border: none;
border-bottom: 1px solid #ccc;
padding: 5px;
border-radius: 0;
outline: none;
width: 100%;
font-size: 20px;
padding: 5px 0;
}
#contact-form input:focus {
border-bottom-color: #F05A26;
}
button[type="submit"] {
background-color: #999999;
color: #ffffff;
border: none;
padding: 10px 20px;
cursor: pointer;
width: 274px;
height: 50px;
font-size: 18px;
margin-top: 10%;
}
const burgerMenu = document.querySelector('.burger-menu');
const menu = document.querySelector('.menu');
const orderButton = document.getElementById('order-button');
const popup = document.getElementById('popup');
const closePopup = document.getElementById('close-popup');
burgerMenu.addEventListener('click', () => {
menu.classList.toggle('active');
});
orderButton.addEventListener('click', () => {
popup.style.display = 'flex';
});
closePopup.addEventListener('click', () => {
popup.style.display = 'none';
});