mirror of
https://github.com/fromchat-messenger/web.git
synced 2026-09-22 19:15:08 +03:00
Add profile dialog
This commit is contained in:
+9
-6
@@ -77,12 +77,6 @@
|
|||||||
<!-- Chat Interface -->
|
<!-- Chat Interface -->
|
||||||
<div id="chat-interface" style="display: none;">
|
<div id="chat-interface" style="display: none;">
|
||||||
<div class="all-container">
|
<div class="all-container">
|
||||||
<div class="profile" id="profile">
|
|
||||||
<div class="profileheader">
|
|
||||||
<p>Твой профиль</p>
|
|
||||||
<a href="#" id="closeprofile">закрыть</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="chat-list" id="chat-list">
|
<div class="chat-list" id="chat-list">
|
||||||
<header class="chat-header-left">
|
<header class="chat-header-left">
|
||||||
<div id="productname">Loading...</div>
|
<div id="productname">Loading...</div>
|
||||||
@@ -156,6 +150,15 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<mdui-dialog id="profile-dialog" close-on-overlay-click close-on-esc>
|
||||||
|
<p>
|
||||||
|
Скоро будет...
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<mdui-button id="profile-dialog-close">Закрыть</mdui-button>
|
||||||
|
</p>
|
||||||
|
</mdui-dialog>
|
||||||
<script src="src/main.ts" type="module"></script>
|
<script src="src/main.ts" type="module"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
@use "common/material" as *;
|
@use "common/material" as *;
|
||||||
|
|
||||||
#chat-interface {
|
#chat-interface {
|
||||||
/* Header */
|
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
background-color: $color-dark-surface-container;
|
background-color: $color-dark-surface-container;
|
||||||
@@ -16,7 +15,6 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
|
|
||||||
|
|
||||||
.header-content {
|
.header-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
@@ -33,6 +31,7 @@
|
|||||||
display: none;
|
display: none;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
|
||||||
li {
|
li {
|
||||||
a {
|
a {
|
||||||
color: white;
|
color: white;
|
||||||
@@ -83,19 +82,24 @@
|
|||||||
|
|
||||||
.chat-header-info {
|
.chat-header-info {
|
||||||
display: flex;
|
display: flex;
|
||||||
.info-chat{
|
|
||||||
|
.info-chat {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
h4 {
|
h4 {
|
||||||
font-size: 1.1rem;
|
font-size: 1.1rem;
|
||||||
|
margin: 0;
|
||||||
margin-bottom: 0.2rem;
|
margin-bottom: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
|
margin: 0;
|
||||||
font-size: 0.8rem;
|
font-size: 0.8rem;
|
||||||
color: #718096;
|
color: #718096;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.online-status {
|
.online-status {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 10px;
|
width: 10px;
|
||||||
@@ -104,7 +108,8 @@
|
|||||||
background-color: $success;
|
background-color: $success;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
a{
|
|
||||||
|
a {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -115,7 +120,8 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
right: 2%;
|
right: 2%;
|
||||||
top: 2%;
|
top: 2%;
|
||||||
&:hover{
|
|
||||||
|
&:hover {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -249,5 +255,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -9,9 +9,8 @@
|
|||||||
@use "lib/fonts/montserrat";
|
@use "lib/fonts/montserrat";
|
||||||
@use "lib/fonts/material-symbols";
|
@use "lib/fonts/material-symbols";
|
||||||
|
|
||||||
|
|
||||||
* {
|
* {
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,5 +21,15 @@ body {
|
|||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
mdui-dialog {
|
||||||
|
> *:first-child {
|
||||||
|
margin-block-start: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
> *:last-child {
|
||||||
|
margin-block-end: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+16
-14
@@ -5,6 +5,7 @@ import { API_BASE_URL, API_FULL_BASE_URL, PRODUCT_NAME } from './config';
|
|||||||
import type { Message, Messages, WebSocketMessage } from './types';
|
import type { Message, Messages, WebSocketMessage } from './types';
|
||||||
import "./links";
|
import "./links";
|
||||||
import "./material";
|
import "./material";
|
||||||
|
import type { Dialog } from 'mdui/components/dialog.js';
|
||||||
|
|
||||||
const websocket = new WebSocket(`ws://${API_FULL_BASE_URL}/chat/ws`);
|
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.getElementById("productname")!.textContent = PRODUCT_NAME;
|
||||||
document.title = PRODUCT_NAME;
|
document.title = PRODUCT_NAME;
|
||||||
|
|
||||||
|
|
||||||
// сварачивание и разворачивание чата
|
// сварачивание и разворачивание чата
|
||||||
const but = document.getElementById('chat-recrol')!;
|
const but = document.getElementById('chat-recrol')!;
|
||||||
const but_list1 = document.getElementById('chat1but')!;
|
const but_list1 = document.getElementById('chat1but')!;
|
||||||
@@ -153,6 +156,7 @@ const but_list2 = document.getElementById('chat1but2')!;
|
|||||||
const cont1 = document.getElementById('conteinerchat')!;
|
const cont1 = document.getElementById('conteinerchat')!;
|
||||||
const logout = document.getElementById('logouts')!;
|
const logout = document.getElementById('logouts')!;
|
||||||
const namechat = document.getElementById('namechat')!;
|
const namechat = document.getElementById('namechat')!;
|
||||||
|
|
||||||
but.addEventListener('click',() => {
|
but.addEventListener('click',() => {
|
||||||
but.style.display = 'none';
|
but.style.display = 'none';
|
||||||
cont1.style.display = 'none';
|
cont1.style.display = 'none';
|
||||||
@@ -168,18 +172,16 @@ but_list2.addEventListener('click',() => {
|
|||||||
cont1.style.display = 'flex';
|
cont1.style.display = 'flex';
|
||||||
namechat.textContent = 'общий чат 2';
|
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',()=>{
|
const butprofile = document.getElementById('profbut')!;
|
||||||
chatlist.style.display = 'flex'
|
const dialog = document.getElementById("profile-dialog") as Dialog;
|
||||||
profile.style.display = 'none'
|
const dialogClose = document.getElementById("profile-dialog-close")!;
|
||||||
})
|
|
||||||
|
butprofile.addEventListener('click', () => {
|
||||||
|
dialog.open = true;
|
||||||
|
});
|
||||||
|
|
||||||
|
dialogClose.addEventListener("click", () => {
|
||||||
|
dialog.open = false;
|
||||||
|
});
|
||||||
@@ -6,6 +6,8 @@ import 'mdui/components/list-item.js';
|
|||||||
import 'mdui/components/bottom-app-bar.js';
|
import 'mdui/components/bottom-app-bar.js';
|
||||||
import 'mdui/components/button-icon.js';
|
import 'mdui/components/button-icon.js';
|
||||||
import 'mdui/components/fab.js';
|
import 'mdui/components/fab.js';
|
||||||
|
import 'mdui/components/dialog.js';
|
||||||
|
import 'mdui/components/button.js';
|
||||||
|
|
||||||
import { setColorScheme } from 'mdui/functions/setColorScheme.js';
|
import { setColorScheme } from 'mdui/functions/setColorScheme.js';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user