Skip to content

Commit 97fc7e4

Browse files
committed
Добавлен сигнальный сервер, сделана передача текста
1 parent 866892c commit 97fc7e4

16 files changed

Lines changed: 279 additions & 160 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
services:
2-
mosquitto:
3-
image: eclipse-mosquitto:2
4-
ports:
5-
- "9001:9001"
6-
volumes:
7-
- ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf
8-
restart: unless-stopped
1+

mosquitto/mosquitto.conf

Lines changed: 0 additions & 5 deletions
This file was deleted.

web/cdn/css/buttons.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ a:not(:has(i)) {
3535
box-shadow 300ms cubic-bezier(0.4, 0, 0.2, 1);
3636
}
3737

38+
button *,
39+
a:not(:has(i))>* {
40+
color: var(--button-color-text) !important;
41+
}
42+
3843
button.active,
3944
a.active:not(:has(i)) {
4045
box-shadow: inset 0 0 0 calc(var(--border)*1.5) var(--border-color-active);
@@ -73,6 +78,10 @@ button[class^='iconoir-'] {
7378
justify-content: center;
7479
}
7580

81+
button[class^='iconoir-']>* {
82+
color: var(--button-color-text);
83+
}
84+
7685
button:has(> i:only-child) {
7786
background: transparent;
7887
box-shadow: none;

web/cdn/css/inputs.css

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
@media (prefers-color-scheme: light) {
22
:root {
3-
--input-placeholder: var(--light-lavender)
3+
--input-placeholder: var(--light-lavender);
4+
--input-border-color: var(--soft-purple);
45
}
56
}
67

78
@media (prefers-color-scheme: dark) {
89
:root {
9-
--input-placeholder: var(--deep-indigo)
10+
--input-placeholder: var(--deep-indigo);
11+
--input-border-color: var(--dark-plum);
12+
--input-border-color-active: var(--soft-purple);
1013
}
1114

1215
}
@@ -17,15 +20,15 @@ input {
1720
background-color: var(--input);
1821
color: var(--text-color);
1922
border: none;
20-
box-shadow: inset 0 0 0 var(--border) var(--border-color);
23+
box-shadow: inset 0 0 0 var(--border) var(--input-border-color);
2124
font-size: var(--h4);
2225
box-sizing: border-box;
2326
transition: 150ms ease;
2427
}
2528

2629
input:focus {
2730
outline: none;
28-
box-shadow: inset 0 0 0 var(--border) var(--border-color-active);
31+
box-shadow: inset 0 0 0 var(--border) var(--input-border-color-active);
2932
}
3033

3134
input::placeholder {
@@ -34,8 +37,25 @@ input::placeholder {
3437
}
3538

3639
input[type="checkbox"] {
37-
accent-color: var(--border-color-active);
40+
accent-color: var(--input-border-color-active);
3841
cursor: pointer;
3942
width: 1.25rem;
4043
height: 1.25rem;
44+
}
45+
46+
textarea {
47+
background-color: var(--background);
48+
color: var(--text-color);
49+
width: 100%;
50+
border: none;
51+
box-sizing: border-box;
52+
max-height: 40dvh;
53+
resize: none;
54+
overflow-y: auto;
55+
font-size: clamp(1rem, 4vw, 1.25rem);
56+
}
57+
58+
59+
textarea:focus {
60+
outline: none;
4161
}

web/cdn/css/layout/header.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ header>nav>* {
2525
justify-content: center;
2626
}
2727

28+
main>header>nav>* {
29+
flex: 1;
30+
}
31+
2832
header>nav>*:first-child {
2933
justify-content: start !important;
3034
}

web/cdn/css/variables.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
--max-width: 1440px;
1919
--vh: 100dvh;
2020

21-
--text-color: var(--soft-purple);
21+
--text-color: var(--deep-navy);
22+
--text-color-adaptive: var(--soft-purple);
2223

2324
--border: 2px;
2425
--border-radius: 12px;
@@ -38,7 +39,8 @@
3839

3940
@media (prefers-color-scheme: light) {
4041
:root {
41-
--button-text-color: var(--soft-purple);
42+
--text-color: var(--deep-navy);
43+
4244
--background: var(--white);
4345
--icon-color: var(--soft-purple);
4446

@@ -58,6 +60,8 @@
5860
--border-color: var(--deep-indigo);
5961
--border-color-active: var(--dark-plum);
6062

63+
--text-color: var(--light-lavender);
64+
6165
}
6266

6367
}

web/cdn/js/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import './menu.js';
33
import './templates.js';
44
import { initNavigation } from './ui/header.js';
55
import './ui/color.js';
6+
import './utils/field-sync.js.js';
67

78
globalThis.notification = notification;
89

web/cdn/js/templates.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,11 @@ async function loadTemplates() {
1111

1212
const html = await response.text();
1313

14-
// Вставляем содержимое ПЕРЕД элементом-заглушкой
1514
element.insertAdjacentHTML('beforebegin', html);
16-
17-
// Полностью удаляем элемент-заглушку из DOM
1815
element.remove();
1916

2017
} catch (error) {
2118
console.error(`Ошибка загрузки "${templateName}":`, error);
22-
// Опционально: можно оставить заглушку или показать ошибку в ней
2319
}
2420
});
2521

web/chat.html

Lines changed: 27 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,9 @@
1616

1717
<meta charset="UTF-8" />
1818
<link rel="icon" href="static/icons/favicon.svg" type="image/png" />
19-
<link rel="stylesheet" type="text/css" href="static/css/chat.css" />
2019

21-
<script src="https://cdn.jsdelivr.net/npm/socket.io-client@4.0.1/dist/socket.io.min.js"></script>
2220
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/iconoir-icons/iconoir@main/css/iconoir.css" />
2321

24-
<script src="https://unpkg.com/mqtt/dist/mqtt.min.js"></script>
25-
2622
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.8.0/styles/github.min.css"
2723
media="(prefers-color-scheme: light)">
2824
<link rel="stylesheet"
@@ -39,60 +35,46 @@
3935
<link rel="stylesheet" href="cdn/css/main.css">
4036
<script src="cdn/js/main.js" type="module"></script>
4137

42-
<script src="static/scripts/database/contacts.js" type="module"></script>
38+
<link rel="stylesheet" type="text/css" href="static/css/chat.css" />
4339
<link rel="stylesheet" href="static/css/main.css">
4440

45-
41+
<script src="https://unpkg.com/peerjs@1.5.2/dist/peerjs.min.js"></script>
42+
<script src="static/scripts/chat/webrtc.js"></script>
43+
<script src="static/scripts/chat/users.js"></script>
44+
<script type="module" src="static/scripts/ui/auto-fonts.js"></script>
4645
</head>
4746

4847
<body>
4948
<main>
49+
<header>
50+
<nav>
51+
<a href="/">
52+
<i>
53+
<h4 class="iconoir-arrow-left"></h4>
54+
</i>
55+
</a>
56+
<nav id="users-list">
57+
<h4 data-field="avatar"></h4>
58+
</nav>
59+
<nav>
60+
<button class="iconoir-phone"></button>
61+
<button class="iconoir-menu" menu="chat-menu"></button>
62+
</nav>
63+
</nav>
64+
</header>
5065
<div class="chat">
5166
<p id="displayMessage"></p>
5267
</div>
5368

5469
<div id="textarea">
55-
<div class="commands hidden">
56-
<div class="list"></div>
57-
<div class="w-line"></div>
58-
</div>
59-
<header>
60-
<nav>
61-
<code class="inline copy"></code>
62-
<nav>
63-
<button id="muteButton" class="hidden iconoir-microphone-mute-solid"></button>
64-
<button id="videoButton" class="hidden iconoir-camera"></button>
65-
<button id="screenButton" class="hidden iconoir-chromecast"></button>
66-
<button id="audioCallButton" class="iconoir-phone"></button>
67-
<button id="shareButton" class="iconoir-share-android"></button>
68-
<button class="iconoir-menu" menu="chat-menu"></button>
69-
</nav>
70-
</nav>
71-
</header>
72-
<div class="textarea-wrapper">
73-
<div class="resize-handle"><i class="iconoir-menu"></i></div>
74-
<div class="input-area">
75-
<textarea rows="1" id="inputMessage" placeholder="Введите сообщение..." inputmode="text"></textarea>
76-
<button id="exec" class="hidden" title="Выполнить команду">
77-
<i class="iconoir-send"></i>
78-
</button>
79-
<button id="reset" class="ghost">
80-
<i class="iconoir-xmark"></i>
81-
</button>
82-
</div>
83-
</div>
70+
<nav class="input-area">
71+
<textarea rows="1" placeholder="Сообщение" inputmode="text"></textarea>
72+
<button id="reset" class="ghost">
73+
<i class="iconoir-xmark"></i>
74+
</button>
75+
</nav>
8476
</div>
8577
</main>
8678
</body>
8779

88-
<script type="module" src="static/scripts/message/main.js"></script>
89-
<script type="module" src="static/scripts/commands/dispatch.js" defer></script>
90-
<script src="static/scripts/share.js"></script>
91-
<script src="static/scripts/ui/resize.js"></script>
92-
<script src="static/scripts/message/copy.js" defer></script>
93-
<script src="static/scripts/ui/clear.js" defer></script>
94-
<script src="static/scripts/ui/resize-video.js" defer></script>
95-
<script type="module" src="static/scripts/ui/auto-fonts.js" defer></script>
96-
<script type="module" src="static/scripts/calls/main.js" defer></script>
97-
9880
</html>

0 commit comments

Comments
 (0)