Compare commits
4 Commits
master
...
adel_branc
Author | SHA1 | Date | |
---|---|---|---|
36d3d3b6a7 | |||
3da3777285 | |||
4c9630a299 | |||
a921e4ed8c |
@ -1,40 +1,43 @@
|
||||
{% ELDEF main JSON pres JSON userinfo %}
|
||||
<!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="/assets/css/chat.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="chat-container">
|
||||
<div class="chat-header">
|
||||
<span class="room-name">Веб чат</span>
|
||||
<button class="members" onclick="openMembersList()">Показать участников</button>
|
||||
</div>
|
||||
<div class="chat-messages" id="chat-messages">
|
||||
<!-- Сообщения чата будут здесь -->
|
||||
</div>
|
||||
<div class="chat-footer">
|
||||
<input type="text" class="chat-input" id="chat-input" placeholder="Введите сообщение...">
|
||||
<button class="chat-send-button" onclick="sendMessage()">Отправить</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overlay" id="overlay">
|
||||
<div class="members-list" id="members-list">
|
||||
<div class="members-list-header">
|
||||
<span class="close" onclick="closeMembersList()">×</span>
|
||||
<h2 class="all-members">Все участники</h2>
|
||||
</div>
|
||||
<div class="members-list-body">
|
||||
<ul id="members-list-body">
|
||||
<!-- Список участников будет добавлен динамически -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/js/chat.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
{% ENDELDEF %}
|
||||
{% ELDEF main JSON pres JSON userinfo %}
|
||||
<!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="/assets/css/chat.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="chat-container">
|
||||
<div class="chat-header">
|
||||
<span class="room-name" id="room-name">Веб чат</span>
|
||||
<button class="members" onclick="openMembersList()">Показать участников</button>
|
||||
<button class="edit-chat" onclick="editChat()">Редактировать чат</button>
|
||||
<button class="exit-chat" onclick="exitChat()">Выйти</button>
|
||||
|
||||
</div>
|
||||
<div class="chat-messages" id="chat-messages">
|
||||
<!-- Сообщения чата будут здесь -->
|
||||
</div>
|
||||
<div class="chat-footer">
|
||||
<input type="text" class="chat-input" id="chat-input" placeholder="Введите сообщение...">
|
||||
<button class="chat-send-button" onclick="sendMessage()">Отправить</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overlay" id="overlay">
|
||||
<div class="members-list" id="members-list">
|
||||
<div class="members-list-header">
|
||||
<span class="close" onclick="closeMembersList()">×</span>
|
||||
<h2 class="all-members">Все участники</h2>
|
||||
</div>
|
||||
<div class="members-list-body">
|
||||
<ul id="members-list-body">
|
||||
<!-- Список участников будет добавлен динамически -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/js/chat.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
{% ENDELDEF %}
|
||||
|
@ -199,4 +199,42 @@ body {
|
||||
}
|
||||
.chat-send-button:hover {
|
||||
background-color: #007bb5;
|
||||
}
|
||||
}
|
||||
|
||||
.room-name {
|
||||
position: absolute;
|
||||
left: 40%;
|
||||
font-size: 24px;
|
||||
}
|
||||
|
||||
.edit-chat {
|
||||
border: none;
|
||||
position: absolute;
|
||||
left: 70%;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
width: 150px;
|
||||
background-color: #f7f7f7;
|
||||
height: 25px;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.edit-chat:hover {
|
||||
background-color: #ffcc00;
|
||||
}
|
||||
|
||||
.exit-chat {
|
||||
border: none;
|
||||
position: absolute;
|
||||
left: 90%;
|
||||
border-radius: 10px;
|
||||
cursor: pointer;
|
||||
width: 150px;
|
||||
background-color: #f7f7f7;
|
||||
height: 25px;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.exit-chat:hover {
|
||||
background-color: #dc3545;
|
||||
}
|
||||
|
@ -1,62 +1,67 @@
|
||||
dy {
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
margin: 0;
|
||||
background-color: #e5e5e5;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
.form-container {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
background-color: white;
|
||||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||
max-width: 450px;
|
||||
background-color: #0c39ce;
|
||||
box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: 8px;
|
||||
padding: 40px;
|
||||
border-radius: 12px;
|
||||
padding: 50px;
|
||||
text-align: center;
|
||||
color: white;
|
||||
transform: translateY(-40px);
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-bottom: 20px;
|
||||
color: #2F4F4F;
|
||||
color: white;
|
||||
}
|
||||
|
||||
input {
|
||||
width: 100%;
|
||||
background: #f7f7f7;
|
||||
width: calc(100% - 50px);
|
||||
background: #f0f0f0;
|
||||
font-size: 16px;
|
||||
padding: 10px;
|
||||
border: 1px solid #ddd;
|
||||
padding: 12px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 20px;
|
||||
margin-bottom: 15px;
|
||||
margin-bottom: 20px;
|
||||
outline: none;
|
||||
color: black;
|
||||
margin-left: 25px;
|
||||
}
|
||||
|
||||
button {
|
||||
width: 100%;
|
||||
width: calc(100% - 50px);
|
||||
padding: 15px;
|
||||
border: none;
|
||||
background-color: #0088cc;
|
||||
background-color: #024a7e;
|
||||
color: white;
|
||||
border-radius: 20px;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
font-size: 16px;
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
transition: background-color 0.3s;
|
||||
margin-left: 25px;
|
||||
}
|
||||
|
||||
button:hover,
|
||||
button:focus-visible {
|
||||
background-color: #007bb5;
|
||||
background-color: #28a745;
|
||||
}
|
||||
|
||||
.hide-cursor::placeholder {
|
||||
color: #000;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
.hide-cursor {
|
||||
@ -64,13 +69,13 @@ button:focus-visible {
|
||||
}
|
||||
|
||||
.no-select {
|
||||
-webkit-user-select: none; /* Для Safari */
|
||||
-moz-user-select: none; /* Для Firefox */
|
||||
user-select: none; /* Для всех остальных браузеров */
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
div {
|
||||
color: red;
|
||||
color: rgba(255, 0, 0, 0.911);
|
||||
font-size: 15px;
|
||||
margin-top: 10px;
|
||||
display: none;
|
||||
|
@ -68,7 +68,7 @@ async function sendMessage() {
|
||||
|
||||
const usernameElement = document.createElement('div');
|
||||
usernameElement.classList.add('username');
|
||||
usernameElement.textContent = await getUserName();
|
||||
usernameElement.textContent = await getUserName(); // Отображение имени пользователя
|
||||
|
||||
const textElement = document.createElement('div');
|
||||
textElement.classList.add('text');
|
||||
@ -88,6 +88,7 @@ async function sendMessage() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function openMembersList() {
|
||||
renderMembersList();
|
||||
document.getElementById("members-list").style.display = "block";
|
||||
@ -157,6 +158,18 @@ async function editMessage(new_message) {
|
||||
currentHistoryId = response.update[0].HistoryId;
|
||||
}
|
||||
}
|
||||
|
||||
function editChat() {
|
||||
const newName = prompt("Введите новое имя комнаты:");
|
||||
if (newName) {
|
||||
document.getElementById('room-name').textContent = newName;
|
||||
}
|
||||
}
|
||||
|
||||
function exitChat() {
|
||||
window.location.href = 'list-rooms.nytl.html';
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async function() {
|
||||
currentChatID = await getChatID();
|
||||
});
|
Loading…
Reference in New Issue
Block a user