Проблемы с отображением всплывающих окон
Пытаюсь создать всплывающее окно, которое содержит настройки и информацию. Но как обычно - работает не так, как надо. Можете подсказать, в чём прокол? (если кратко,то поверх всего сайта вылезает непрозрачное окно,которое пока содержит три кнопки,которые изменяют цвет основного окна).
HTML документ
<!DOCTYPE html>
<html lang = "ru">
<head>
<meta charset = "utf-8"/>
<title>Экспресс Опросник</title>
<link rel = "icon" href = "../Графика/Изображения/favicon.ico"/>
<link rel = "stylesheet" href = "../Графика/CSS файлы/Cover_Site.css"/>
<link rel = "stylesheet" href = "../Графика/CSS файлы/Pop-ups.css"/>
</head>
<body>
<div id = "pop_up_settings">
<button
title = "Тема ночного неба."
id = "set_background_night_sky"
onclick = "changeBackColorFirst(ArrayforVarforArguments)"></button>
<button
title = "Тема цветков сакуры."
id = "set_background_cherry_blossom_petal"
onclick = "changeBackColorSecond(ArrayforVarforArguments)"></button>
<button
title = "Тема пустынь."
id = "set_background_clear_sand"
onclick = "changeBackColorThird(ArrayforVarforArguments)"></button>
<button
title = "Случайная тема сайта. Вы уверены, что хотите увидеть это?(Опасно для эпелептиков!)"
id = "set_background_rand_color"
onclick = "changeBackColorRand(ArrayforVarforArguments)"></button>
<!-- <div id = "timer"></div> -->
</div>
<!--<div id = "data_load_form">
<select id = "select_type_data">
<option value = "string">Текст</option>
<option value = "img">Изображение</option>
</select>
</div>
<div id = "debate">
<dl id = "list_enviroment">
<dt>Отлично.</dt>
<button>Отправить</button>
<progress value = "0" max = "100"></progress>
<dt>Неплохо.</dt>
<button>Отправить</button>
<progress value = "0" max = "100"></progress>
<dt>Нормально.</dt>
<button>Отправить</button>
<progress value = "0" max = "100"></progress>
<dt>Плохо.</dt>
<button>Отправить</button>
<progress value = "0" max = "100"></progress>
<dt>Ужасно.</dt>
<button>Отправить</button>
<progress value = "0" max = "100"></progress>
</dl>
</div> -->
<div id = "pop_up_settings_overlay"></div>
<div id = "hat_site">
<button id = "button_chat"
title = "Здесь хранятся комментарии для загруженного контента.">Чат</button>
<button id = "settings" title = "Настройки сайта" onclick = "openSettingsPage(ArrayArgumentsForObjects)">Настройки</button>
</div>
<footer>
<input type = "text" id = "comment_text" placeholder = "Введите ваш коменнтарий и нажмите Enter чтобы отправить его.">
</footer>
<script src = "../Скрипты/Visual.js"></script>
<script src = "../Скрипты/Calculations.js"></script>
<script src = "../Скрипты/Pop_Up.js"></script>
</body>
</html>
CSS документ основной страницы
body {
background-color: rgb(202, 202, 202);
}
footer {
position: absolute;
left: 0px;
right: 0px;
bottom: 0px;
height: 50px;
width: 100%;
background: rgb(32, 32, 32);
}
/* #set_background_night_sky {
outline: none;
position: absolute;
top: 3px;
left: 15px;
height: 30px;
width: 30px;
border-radius: 50%;
background: rgb(0, 0, 28);
border: 3px solid rgb(0, 0, 68);
}
#set_background_night_sky:hover {
cursor: pointer;
background: rgb(0, 0, 68);
}
#set_background_clear_sand {
outline: none;
position: absolute;
top: 3px;
left: 105px;
height: 30px;
width: 30px;
border-radius: 50%;
background: rgb(247, 207, 154);
border: 3px solid rgb(247, 237, 174);
}
#set_background_clear_sand:hover {
cursor: pointer;
background: rgb(247, 237, 174);
}
#set_background_cherry_blossom_petal {
outline: none;
position: absolute;
top: 3px;
left: 60px;
height: 30px;
width: 30px;
border-radius: 50%;
background: rgb(247, 207, 254);
border: 3px solid rgb(227, 150, 215);
}
#set_background_cherry_blossom_petal:hover {
cursor: pointer;
background: rgb(227, 150, 215);
}
#set_background_rand_color {
outline: none;
position: absolute;
top: 3px;
left: 150px;
height: 30px;
width: 30px;
border-radius: 50%;
background: rgb(0, 0, 0);
border: 3px solid rgb(255, 255, 255);
}
#set_background_rand_color:hover {
cursor: pointer;
background: rgb(255, 255, 255);
} */
progress {
/* position: absolute; */
width: 100%;
height: 30px;
}
#comment_text {
background: rgb(172, 172, 172);
outline: none;
box-sizing: border-box;
margin-top: 12px;
margin-bottom: 11px;
width: 100%;
height: 50%;
left: 0;
right: 0;
border-style: none;
font-family: fantasy;
font-size: medium;
}
/* placeholder {
font-size: 15px;
} */
#send_comment_text {
position: absolute;
color: rgb(128, 128, 128);
background: rgb(32, 32, 32);
text-align: center;
border: 2px solid rgb(128, 128, 128);
border-radius: 15%;
outline: none;
margin: auto;
right: 3px;
top: 6px;
}
#data_load_form {
position: fixed;
width: 512px;
height: 512px;
left: 0;
top: 25%;
bottom: 15%;
/*transform: translate(0%, 50%); */
background: white;
border: 3px dashed rgb(64, 64, 64);
border-right: 6px solid rgb(64, 64, 64);
}
#debate {
position: fixed;
width: 384px;
height: 512px;
right: 0;
top: 25%;
bottom: 15%;
/*transform: translate(0%, 50%); */
background: white;
border: 3px dashed rgb(64, 64, 64);
border-left: 6px solid rgb(64, 64, 64);
}
#hat_site {
position: absolute;
width: 100%;
height: 40px;
top: 0px;
left: 0px;
right: 0px;
background: rgb(32, 32, 32);
}
#button_chat {
position: absolute;
cursor: pointer;
top: 7px;
right: 10px;
color: rgb(128, 128, 128);
background: rgb(32, 32, 32);
text-align: center;
border: 3px solid rgb(128, 128, 128);
border-radius: 15%;
outline: none;
margin: auto;
}
#settings {
position: absolute;
left: 10px;
top: 7px;
cursor: pointer;
color: rgb(128, 128, 128);
background: rgb(32, 32, 32);
text-align: center;
border: 3px solid rgb(128, 128, 128);
border-radius: 10%;
outline: none;
margin: auto;
}
#select_type_data{
position: absolute;
top: -7%;
height: 32px;
width: 100%;
text-align: left;
font-family: fantasy;
outline: none;
border: none;
cursor: pointer;
}
#list_enviroment {
position: absolute;
color: rgb(128, 128, 128);
font-family: fantasy;
left: 45%;
}
dt {
padding-top: 20px;
}
button {
border: 2px solid rgb(64, 64, 64);
background-color: rgb(128, 128, 128);
outline: none;
cursor: pointer;
}
CSS всплывающего окна
#pop_up_settings {
position: absolute;
top: 50%;
left: 50%;
width: 50%;
height: 50%;
background: rgb(128, 128, 128);
transform: translate(-50%, -50%);
display: none;
}
#pop_up_settings_overlay {
position: absolute;
/* top: 0;
left: 0; */
width: 100%;
height: 100%;
background: rgb(32, 32, 32);
display: none;
}
JS всплывающего окна
const PopUpSettings = document.getElementById('pop_up_settings');
const PopUpSettingsOverlay = document.getElementById('pop_up_settings_overlay');
const SettingsButton = document.getElementById('settings');
const ArrayArgumentsForObjects = [
PopUpSettings,
SettingsButton,
PopUpSettingsOverlay
];
function openSettingsPage(ArrayArgumentsForObjects) {
PopUpSettings.style.display = 'block';
}