diff --git a/frontend/index.html b/frontend/index.html index a11dd32..ced21ef 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -77,12 +77,6 @@ + +

+ Скоро будет... +

+ +

+ Закрыть +

+
\ No newline at end of file diff --git a/frontend/src/css/_chat.scss b/frontend/src/css/_chat.scss index b45373a..fe4ecdf 100644 --- a/frontend/src/css/_chat.scss +++ b/frontend/src/css/_chat.scss @@ -2,7 +2,6 @@ @use "common/material" as *; #chat-interface { - /* Header */ .header { display: flex; background-color: $color-dark-surface-container; @@ -16,7 +15,6 @@ top: 0; right: 0; - .header-content { display: flex; justify-content: space-between; @@ -33,6 +31,7 @@ display: none; list-style: none; gap: 10px; + li { a { color: white; @@ -83,19 +82,24 @@ .chat-header-info { display: flex; - .info-chat{ + + .info-chat { display: flex; flex-direction: column; + h4 { font-size: 1.1rem; + margin: 0; margin-bottom: 0.2rem; } p { + margin: 0; font-size: 0.8rem; color: #718096; } } + .online-status { display: inline-block; width: 10px; @@ -104,7 +108,8 @@ background-color: $success; margin-right: 5px; } - a{ + + a { display: flex; flex-direction: row; text-decoration: none; @@ -115,7 +120,8 @@ position: absolute; right: 2%; top: 2%; - &:hover{ + + &:hover { border: none; } } @@ -249,5 +255,4 @@ } } } - } \ No newline at end of file diff --git a/frontend/src/css/style.scss b/frontend/src/css/style.scss index 302081e..b5aeb78 100644 --- a/frontend/src/css/style.scss +++ b/frontend/src/css/style.scss @@ -9,9 +9,8 @@ @use "lib/fonts/montserrat"; @use "lib/fonts/material-symbols"; + * { - margin: 0; - padding: 0; box-sizing: border-box; } @@ -22,5 +21,15 @@ body { line-height: 1.6; height: 100vh; position: relative; + margin: 0; +} +mdui-dialog { + > *:first-child { + margin-block-start: 0; + } + + > *:last-child { + margin-block-end: 0; + } } \ No newline at end of file diff --git a/frontend/src/main.ts b/frontend/src/main.ts index c87cdbb..06b5181 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -5,6 +5,7 @@ import { API_BASE_URL, API_FULL_BASE_URL, PRODUCT_NAME } from './config'; import type { Message, Messages, WebSocketMessage } from './types'; import "./links"; import "./material"; +import type { Dialog } from 'mdui/components/dialog.js'; const websocket = new WebSocket(`ws://${API_FULL_BASE_URL}/chat/ws`); @@ -146,6 +147,8 @@ document.getElementById('message-form')!.addEventListener('submit', (e) => { document.getElementById("productname")!.textContent = PRODUCT_NAME; document.title = PRODUCT_NAME; + + // сварачивание и разворачивание чата const but = document.getElementById('chat-recrol')!; const but_list1 = document.getElementById('chat1but')!; @@ -153,6 +156,7 @@ const but_list2 = document.getElementById('chat1but2')!; const cont1 = document.getElementById('conteinerchat')!; const logout = document.getElementById('logouts')!; const namechat = document.getElementById('namechat')!; + but.addEventListener('click',() => { but.style.display = 'none'; cont1.style.display = 'none'; @@ -168,18 +172,16 @@ but_list2.addEventListener('click',() => { cont1.style.display = 'flex'; namechat.textContent = 'общий чат 2'; }); -// открытие профиля -const butprofile = document.getElementById('profbut')! -const chatlist = document.getElementById('chat-list')! -const profile = document.getElementById('profile')! -const closeprofile = document.getElementById('closeprofile')! -butprofile.addEventListener('click',()=>{ - chatlist.style.display = 'none' - cont1.style.display = 'none' - profile.style.display = 'flex' -}) -closeprofile.addEventListener('click',()=>{ - chatlist.style.display = 'flex' - profile.style.display = 'none' -}) \ No newline at end of file +// открытие профиля +const butprofile = document.getElementById('profbut')!; +const dialog = document.getElementById("profile-dialog") as Dialog; +const dialogClose = document.getElementById("profile-dialog-close")!; + +butprofile.addEventListener('click', () => { + dialog.open = true; +}); + +dialogClose.addEventListener("click", () => { + dialog.open = false; +}); \ No newline at end of file diff --git a/frontend/src/material.ts b/frontend/src/material.ts index 50ec98d..3d4a75d 100644 --- a/frontend/src/material.ts +++ b/frontend/src/material.ts @@ -6,6 +6,8 @@ import 'mdui/components/list-item.js'; import 'mdui/components/bottom-app-bar.js'; import 'mdui/components/button-icon.js'; import 'mdui/components/fab.js'; +import 'mdui/components/dialog.js'; +import 'mdui/components/button.js'; import { setColorScheme } from 'mdui/functions/setColorScheme.js';