-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec0a315
commit 8056a6d
Showing
11 changed files
with
156 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
@font-face { | ||
font-family: 'Doxent'; | ||
src: url('../media/fonts/doxent.otf') format('opentype'); | ||
} | ||
@font-face { | ||
font-family: 'Kreadon'; | ||
src: url('../media/fonts/kreadon.ttf') format('opentype'); | ||
} | ||
|
||
#user-list { | ||
max-height: 300px; /* Adjusted height for scrolling */ | ||
overflow-y: auto; | ||
} | ||
|
||
|
||
body { | ||
font-family: Arial, sans-serif; | ||
display: flex; | ||
background: url("../assets/background_auth.png") center/cover; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100vh; | ||
margin: 0; | ||
} | ||
|
||
.container { | ||
background-color: #fff; | ||
padding: 40px; | ||
border-radius: 8px; | ||
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | ||
} | ||
|
||
h2 { | ||
margin-top: 0; | ||
text-align: center; | ||
} | ||
|
||
.user-input { | ||
display: flex; | ||
align-items: center; | ||
margin-bottom: 10px; | ||
} | ||
|
||
.user-input input { | ||
flex: 1; | ||
padding: 10px; | ||
border: 1px solid #ccc; | ||
border-radius: 4px; | ||
} | ||
|
||
.add-button { | ||
background-color: #28a745; | ||
color: #fff; | ||
border: none; | ||
padding: 10px 15px; | ||
margin-left: 10px; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
} | ||
|
||
.add-button:hover { | ||
background-color: #218838; | ||
} | ||
|
||
.create-button { | ||
width: 100%; | ||
padding: 15px; | ||
background-color: #7366BD; | ||
color: #fff; | ||
border: none; | ||
border-radius: 4px; | ||
cursor: pointer; | ||
margin-top: 20px; | ||
} | ||
|
||
.create-button:hover { | ||
background-color: #0056b3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
function showAddButton(input) { | ||
const addButton = input.nextElementSibling; | ||
if (input.value.trim() !== "") { | ||
addButton.style.display = "inline-block"; | ||
} else { | ||
addButton.style.display = "none"; | ||
} | ||
} | ||
|
||
function addUserInput(button) { | ||
const userInputDiv = document.createElement('div'); | ||
userInputDiv.classList.add('user-input'); | ||
userInputDiv.innerHTML = ` | ||
<input type="text" placeholder="Введите имя пользователя" oninput="showAddButton(this)"> | ||
<button class="add-button" style="display: none;" onclick="addUserInput(this)">+</button> | ||
`; | ||
document.getElementById('user-list').appendChild(userInputDiv); | ||
button.style.display = "none"; | ||
} | ||
|
||
function createChat() { | ||
const userInputs = document.querySelectorAll('.user-input input'); | ||
const users = []; | ||
userInputs.forEach(input => { | ||
if (input.value.trim() !== "") { | ||
users.push(input.value.trim()); | ||
} | ||
}); | ||
alert("Чат создан с пользователями: " + users.join(', ')); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
const createChat = document.getElementById('create_room'); | ||
createChat.addEventListener('click', () => { | ||
window.location.href = "create_room.html"; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!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="../css/create_room.css"> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h2>Создание чата</h2> | ||
<div id="user-list"> | ||
<div class="user-input"> | ||
<input type="text" placeholder="Введите имя пользователя" oninput="showAddButton(this)"> | ||
<button class="add-button" style="display: none;" onclick="addUserInput(this)">+</button> | ||
</div> | ||
</div> | ||
<button class="create-button" onclick="createChat()">Создать</button> | ||
</div> | ||
<script src="../scripts/create_room.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters