188 lines
4.2 KiB
CSS
188 lines
4.2 KiB
CSS
|
<!DOCTYPE html>
|
||
|
<html lang="ru">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
|
<title>Список Чат-Комнат</title>
|
||
|
<link rel="stylesheet" href="form.css">
|
||
|
</head>
|
||
|
<body>
|
||
|
<div class="container">
|
||
|
<h1 stylebody {
|
||
|
font-family: Arial, sans-serif;
|
||
|
background-color: #f0f0f0;
|
||
|
margin: 0;
|
||
|
padding: 0;
|
||
|
}
|
||
|
|
||
|
.container {
|
||
|
max-width: 800px;
|
||
|
margin: 30px auto; /* Уменьшили верхний отступ */
|
||
|
padding: 20px;
|
||
|
background-color: #007bff;
|
||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||
|
border-radius: 8px;
|
||
|
}
|
||
|
|
||
|
h1 {
|
||
|
text-align: center;
|
||
|
color: #fff; /* Белый цвет для заголовка */
|
||
|
}
|
||
|
|
||
|
.room-list {
|
||
|
list-style-type: none;
|
||
|
padding: 0;
|
||
|
}
|
||
|
|
||
|
.room-item {
|
||
|
display: flex;
|
||
|
justify-content: space-between;
|
||
|
align-items: center;
|
||
|
padding: 15px;
|
||
|
margin: 10px 0;
|
||
|
background-color: #fafafa;
|
||
|
border: 1px solid #ddd;
|
||
|
border-radius: 5px;
|
||
|
transition: background-color 0.3s ease;
|
||
|
}
|
||
|
|
||
|
.room-item:hover {
|
||
|
background-color: #eaeaea;
|
||
|
}
|
||
|
|
||
|
.room-name {
|
||
|
font-size: 18px;
|
||
|
color: #555;
|
||
|
}
|
||
|
|
||
|
.join-button {
|
||
|
padding: 10px 15px;
|
||
|
font-size: 16px;
|
||
|
color: white;
|
||
|
background-color: #007bff;
|
||
|
border: none;
|
||
|
border-radius: 5px;
|
||
|
cursor: pointer;
|
||
|
transition: background-color 0.3s ease;
|
||
|
}
|
||
|
|
||
|
.join-button:hover {
|
||
|
background-color: #0056b3;
|
||
|
}
|
||
|
|
||
|
.modal {
|
||
|
display: none;
|
||
|
position: fixed;
|
||
|
z-index: 1;
|
||
|
left: 0;
|
||
|
top: 0;
|
||
|
width: 100%;
|
||
|
height: 100%;
|
||
|
overflow: auto;
|
||
|
background-color: rgba(0, 0, 0, 0.4);
|
||
|
}
|
||
|
|
||
|
.modal-content {
|
||
|
background-color: #fff;
|
||
|
margin: 10% auto;
|
||
|
padding: 20px;
|
||
|
border: 1px solid #888;
|
||
|
width: 80%;
|
||
|
max-width: 400px;
|
||
|
border-radius: 10px;
|
||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
|
||
|
}
|
||
|
|
||
|
.modal-header, .modal-footer {
|
||
|
padding: 10px;
|
||
|
color: #333;
|
||
|
}
|
||
|
|
||
|
.modal-header {
|
||
|
text-align: center;
|
||
|
}
|
||
|
|
||
|
.modal-footer {
|
||
|
text-align: right;
|
||
|
}
|
||
|
|
||
|
.close {
|
||
|
color: #aaa;
|
||
|
float: right;
|
||
|
font-size: 28px;
|
||
|
font-weight: bold;
|
||
|
}
|
||
|
|
||
|
.close:hover, .close:focus {
|
||
|
color: black;
|
||
|
text-decoration: none;
|
||
|
cursor: pointer;
|
||
|
}
|
||
|
|
||
|
.modal input {
|
||
|
width: 93.5%;
|
||
|
padding: 10px;
|
||
|
margin: 10px 0;
|
||
|
border: 1px solid #ddd;
|
||
|
border-radius: 5px;
|
||
|
}
|
||
|
|
||
|
.create-room-button {
|
||
|
display: block;
|
||
|
width: 100%;
|
||
|
padding: 10px;
|
||
|
font-size: 16px;
|
||
|
color: white;
|
||
|
background-color: #1609ab;
|
||
|
border: none;
|
||
|
border-radius: 5px;
|
||
|
cursor: pointer;
|
||
|
transition: background-color 0.3s ease;
|
||
|
margin-top: 20px;
|
||
|
}
|
||
|
|
||
|
.create-room-button:hover {
|
||
|
background-color: #218838;
|
||
|
}="color: white;">Выберите Чат-Комнату</h1>
|
||
|
<ul class="room-list">
|
||
|
<!-- Здесь будет список комнат -->
|
||
|
</ul>
|
||
|
<button class="create-room-button" onclick="openCreateRoomModal()">Создать Комнату</button>
|
||
|
</div>
|
||
|
|
||
|
<div id="passwordModal" class="modal">
|
||
|
<div class="modal-content">
|
||
|
<div class="modal-header">
|
||
|
<span class="close" onclick="closeModal()">×</span>
|
||
|
<h2>Введите Пароль</h2>
|
||
|
</div>
|
||
|
<div class="modal-body">
|
||
|
<input type="password" id="roomPassword" placeholder="Пароль">
|
||
|
</div>
|
||
|
<div class="modal-footer">
|
||
|
<button class="join-button" onclick="validatePassword()">Подтвердить</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<!-- Модальное окно для создания комнаты -->
|
||
|
<div id="createRoomModal" class="modal">
|
||
|
<div class="modal-content">
|
||
|
<div class="modal-header">
|
||
|
<span class="close" onclick="closeCreateRoomModal()">×</span>
|
||
|
<h2>Создать Комнату</h2>
|
||
|
</div>
|
||
|
<div class="modal-body">
|
||
|
<input type="text" id="newRoomName" placeholder="Название комнаты">
|
||
|
<input type="password" id="newRoomPassword" placeholder="Пароль">
|
||
|
</div>
|
||
|
<div class="modal-footer">
|
||
|
<button class="join-button" onclick="createRoom()">Создать</button>
|
||
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<script src="list-rooms.js"></script>
|
||
|
</body>
|
||
|
</html>
|