feature update
Added- More emojis Recent messages are shown on chat cards with time of arrival
This commit is contained in:
parent
3dd5ca4819
commit
f665e340e8
File diff suppressed because one or more lines are too long
BIN
assets/messenger-favicon.png
Normal file
BIN
assets/messenger-favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 888 B |
1
assets/messenger-favicon.svg
Normal file
1
assets/messenger-favicon.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><path d="M.3,64s2.81-2.93,9.23-10.37c7.79-9.05,6.63-19.56,8.06-25.71C22.54,6.52,38.72,9.29,51.18,6A52.35,52.35,0,0,0,64,0s1,25.48-17.52,25.19c-7.06-.1-12.24,2.27-15.24,5.09,0,0,3.56-1.09,6.42-1.71,5.84-1.26,13.14,1.89,13.14,1.89a16.71,16.71,0,0,0-8.88,5.16c-1.53,1.78-3.84,7.74-11,10.59-3.24,1.29-12.45,3.12-17,6.63C11.56,54.64.3,64,.3,64Z" style="fill:#fff"/></svg>
|
||||
|
After Width: | Height: | Size: 426 B |
204
css/main.css
204
css/main.css
@ -17,7 +17,7 @@ html, body {
|
||||
}
|
||||
|
||||
body {
|
||||
--accent-color: #0779e4;
|
||||
--accent-color: #1976D2;
|
||||
--secondary-color: #ffac2e;
|
||||
--text-color: 17, 17, 17;
|
||||
--text-color-light: 100, 100, 100;
|
||||
@ -40,7 +40,7 @@ body[data-theme=dark] {
|
||||
}
|
||||
body[data-theme=dark] .initial {
|
||||
color: rgba(var(--text-color), 1) !important;
|
||||
box-shadow: 0 0.1rem 0.1rem #00000016, 0 0.1rem 0.3rem #00000040;
|
||||
box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.16);
|
||||
}
|
||||
body[data-theme=dark] .message {
|
||||
color: rgba(var(--text-color), 1);
|
||||
@ -165,11 +165,11 @@ textarea:focus {
|
||||
}
|
||||
|
||||
.fab {
|
||||
box-shadow: 0 1rem 1rem #00000020;
|
||||
filter: drop-shadow(0 0.4rem 0.3rem rgba(0, 0, 0, 0.2));
|
||||
margin-right: 1rem;
|
||||
position: fixed;
|
||||
bottom: 3.5rem;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
}
|
||||
.fab .icon {
|
||||
@ -331,20 +331,14 @@ sm-button[variant=primary] .icon {
|
||||
height: max-content;
|
||||
margin: 0.5rem 0;
|
||||
}
|
||||
.logo-section h4 {
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
font-size: 1rem;
|
||||
}
|
||||
.logo-section h5 {
|
||||
font-weight: 400;
|
||||
opacity: 0.8;
|
||||
color: rgba(var(--text-color), 0.7);
|
||||
font-size: 1.1rem !important;
|
||||
font-weight: 500;
|
||||
}
|
||||
.logo-section .main-logo {
|
||||
height: 1.4rem;
|
||||
margin-right: 0.4rem;
|
||||
fill: rgba(var(--text-color), 1);
|
||||
fill: rgba(var(--text-color), 0.8);
|
||||
stroke: none;
|
||||
}
|
||||
|
||||
@ -542,10 +536,10 @@ sm-button[variant=primary] .icon {
|
||||
position: relative;
|
||||
justify-content: center;
|
||||
font-size: 1.2rem;
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
color: white;
|
||||
box-shadow: 0 0.1rem 0.1rem #0000001a, 0 0.1rem 0.3rem #00000016;
|
||||
box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.06);
|
||||
border-radius: 2rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
@ -568,18 +562,21 @@ sm-button[variant=primary] .icon {
|
||||
}
|
||||
.contact .name {
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
text-transform: capitalize;
|
||||
font-weight: 500;
|
||||
color: rgba(var(--text-color), 0.8);
|
||||
}
|
||||
.contact .address {
|
||||
.contact .last-message {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
font-weight: 400;
|
||||
color: rgba(var(--text-color), 0.8);
|
||||
font-weight: 500;
|
||||
color: rgba(var(--text-color), 0.9);
|
||||
}
|
||||
.contact sm-menu {
|
||||
.contact .time {
|
||||
font-weight: 400;
|
||||
opacity: 0.8;
|
||||
grid-area: menu;
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
#warn_no_encryption, .date-card {
|
||||
@ -712,34 +709,49 @@ sm-button[variant=primary] .icon {
|
||||
|
||||
#main_navbar {
|
||||
position: fixed;
|
||||
flex-direction: column;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
width: max(18rem, 80vw);
|
||||
height: 100vh;
|
||||
background: rgba(var(--foreground-color), 1);
|
||||
box-shadow: 0 -0.2rem 1rem #00000016;
|
||||
height: 3.5rem;
|
||||
align-items: center;
|
||||
z-index: 4;
|
||||
}
|
||||
#main_navbar .logo-section {
|
||||
padding: 0;
|
||||
margin: 1rem 0 1.5rem 0;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
#main_navbar .active {
|
||||
background: var(--accent-color);
|
||||
}
|
||||
#main_navbar .active .icon {
|
||||
stroke: white;
|
||||
}
|
||||
#main_navbar .active .label {
|
||||
color: white;
|
||||
}
|
||||
#main_navbar .label {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
#main_navbar .navbar-item {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
opacity: 0.8;
|
||||
height: auto;
|
||||
justify-content: flex-start;
|
||||
flex-direction: row;
|
||||
flex: none;
|
||||
padding: 1rem 1.2rem;
|
||||
}
|
||||
#main_navbar .navbar-item .icon {
|
||||
height: 1.2rem;
|
||||
width: 2.4rem;
|
||||
margin-right: 0.8rem;
|
||||
}
|
||||
#main_navbar .navbar-item:last-of-type {
|
||||
margin-top: auto;
|
||||
}
|
||||
#main_navbar .navbar-item .icon {
|
||||
height: 1.2rem;
|
||||
width: 1.2rem;
|
||||
}
|
||||
#main_navbar .navbar-item .label {
|
||||
margin-top: 0.4rem;
|
||||
}
|
||||
#main_navbar .navbar-item.badge::after {
|
||||
right: 0;
|
||||
top: 0;
|
||||
@ -759,15 +771,6 @@ sm-button[variant=primary] .icon {
|
||||
#main_navbar .navbar-item.badge.active::after, #main_navbar .navbar-item.badge[data-notifications="0"]::after, #main_navbar .navbar-item.badge[data-notifications=""]::after {
|
||||
transform: scale(0);
|
||||
}
|
||||
#main_navbar .active {
|
||||
opacity: 1;
|
||||
}
|
||||
#main_navbar .active h5 {
|
||||
color: var(--accent-color);
|
||||
}
|
||||
#main_navbar .active .icon {
|
||||
stroke: var(--accent-color);
|
||||
}
|
||||
|
||||
#auto_complete_contact {
|
||||
position: relative;
|
||||
@ -783,7 +786,7 @@ sm-button[variant=primary] .icon {
|
||||
background: rgba(var(--foreground-color), 1);
|
||||
z-index: 1;
|
||||
border-radius: 0.4rem;
|
||||
box-shadow: 0 0.1rem 0.1rem #00000010, 0 0.2rem 0.5rem #00000020;
|
||||
box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.5rem rgba(0, 0, 0, 0.16);
|
||||
width: 100%;
|
||||
}
|
||||
#mail_contact_list .contact {
|
||||
@ -811,11 +814,9 @@ sm-button[variant=primary] .icon {
|
||||
width: 0.9rem;
|
||||
}
|
||||
#contacts header sm-input::part(input) {
|
||||
border-radius: 3rem;
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
#contacts header .flex {
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
#contacts #all_contacts {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@ -830,11 +831,23 @@ sm-button[variant=primary] .icon {
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
|
||||
#selected_contacts {
|
||||
padding: 1.5rem;
|
||||
background: rgba(var(--text-color), 0.06);
|
||||
}
|
||||
#selected_contacts h4 {
|
||||
font-weight: 500;
|
||||
font-size: 1rem;
|
||||
}
|
||||
#selected_contacts sm-button {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#contacts, #mails {
|
||||
overflow-y: hidden;
|
||||
position: relative;
|
||||
grid-template-rows: max-content 1fr;
|
||||
height: calc(100vh - 3.5rem);
|
||||
height: 100vh;
|
||||
}
|
||||
#contacts header, #mails header {
|
||||
padding: 1rem 1.5rem;
|
||||
@ -873,7 +886,6 @@ sm-button[variant=primary] .icon {
|
||||
}
|
||||
#chat header {
|
||||
padding: 0.5rem 1rem;
|
||||
box-shadow: 0 0.2rem 0.4rem #00000016;
|
||||
}
|
||||
#chat header .back-button {
|
||||
padding: 0.1rem;
|
||||
@ -882,8 +894,6 @@ sm-button[variant=primary] .icon {
|
||||
}
|
||||
#chat header .initial {
|
||||
margin-right: 1rem;
|
||||
width: 1.6em;
|
||||
height: 1.6em;
|
||||
}
|
||||
#chat header h4 {
|
||||
font-weight: 500;
|
||||
@ -920,7 +930,7 @@ sm-button[variant=primary] .icon {
|
||||
}
|
||||
#chat footer .flex {
|
||||
align-items: flex-end;
|
||||
padding: 1rem;
|
||||
padding: 1rem 1rem 1rem 0.4rem;
|
||||
}
|
||||
#chat footer sm-textarea::part(textarea) {
|
||||
background: rgba(var(--text-color), 0.1);
|
||||
@ -970,7 +980,7 @@ sm-button[variant=primary] .icon {
|
||||
-webkit-hyphens: auto;
|
||||
hyphens: auto;
|
||||
white-space: pre-wrap;
|
||||
box-shadow: 0 1px 0.1rem #00000020;
|
||||
box-shadow: 0 1px 0.1rem rgba(0, 0, 0, 0.16);
|
||||
padding: 0.6em 1em;
|
||||
line-height: 1.5;
|
||||
}
|
||||
@ -1069,6 +1079,7 @@ sm-button[variant=primary] .icon {
|
||||
padding: 0.4rem;
|
||||
border-radius: 0.6rem;
|
||||
user-select: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.big-emoji::after {
|
||||
@ -1076,14 +1087,11 @@ sm-button[variant=primary] .icon {
|
||||
}
|
||||
.big-emoji .message-body {
|
||||
background: none !important;
|
||||
box-shadow: none !important;
|
||||
padding: 0 !important;
|
||||
font-size: 2.6rem;
|
||||
}
|
||||
|
||||
.emoji:hover {
|
||||
background: rgba(var(--text-color), 0.1);
|
||||
}
|
||||
|
||||
#new_conversation, #no_mails {
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
@ -1189,7 +1197,7 @@ sm-tab-panels {
|
||||
}
|
||||
|
||||
#settings_page {
|
||||
height: calc(100vh - 3.5rem);
|
||||
height: 100vh;
|
||||
overflow: hidden auto;
|
||||
}
|
||||
#settings_page .flex sm-button {
|
||||
@ -1254,17 +1262,24 @@ sm-tab-panels {
|
||||
grid-area: illustration;
|
||||
}
|
||||
|
||||
#chat header h5 {
|
||||
width: calc(100vw - 12rem);
|
||||
#main_navbar {
|
||||
transform: translateX(-100%);
|
||||
transition: transform 0.3s;
|
||||
z-index: 4;
|
||||
}
|
||||
|
||||
#chat header {
|
||||
padding: 1rem;
|
||||
}
|
||||
#chat header .initial {
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
#chat .message {
|
||||
width: fit-content;
|
||||
max-width: 90%;
|
||||
}
|
||||
|
||||
#settings_page {
|
||||
padding-bottom: 3.5rem;
|
||||
}
|
||||
#settings_page header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
@ -1279,6 +1294,7 @@ sm-tab-panels {
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: rgba(var(--text-color), 0.3);
|
||||
border-radius: 1rem;
|
||||
}
|
||||
::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(var(--text-color), 0.5);
|
||||
@ -1294,7 +1310,6 @@ sm-tab-panels {
|
||||
|
||||
.fab {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.logo-section {
|
||||
@ -1322,37 +1337,17 @@ sm-tab-panels {
|
||||
}
|
||||
|
||||
#main_navbar {
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
padding: 0.5rem;
|
||||
box-shadow: none;
|
||||
height: auto;
|
||||
width: auto;
|
||||
background: rgba(var(--text-color), 0.06);
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
#main_navbar .navbar-item {
|
||||
height: auto;
|
||||
justify-content: flex-start;
|
||||
flex-direction: row;
|
||||
flex: none;
|
||||
padding: 1rem 0.5rem;
|
||||
border-radius: 0.4rem;
|
||||
margin: 0 0.5rem;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
#main_navbar .navbar-item .icon {
|
||||
height: 1.2rem;
|
||||
width: 2.4rem;
|
||||
}
|
||||
#main_navbar .navbar-item:last-of-type {
|
||||
margin-top: auto;
|
||||
}
|
||||
#main_navbar .logo-section {
|
||||
margin: 1rem 0 1.5rem 0;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
#main_navbar .active {
|
||||
background: var(--accent-color);
|
||||
border-radius: 0.4rem;
|
||||
}
|
||||
#main_navbar .active .icon {
|
||||
stroke: white;
|
||||
margin-right: 0;
|
||||
}
|
||||
#main_navbar .label {
|
||||
display: none;
|
||||
@ -1379,16 +1374,19 @@ sm-tab-panels {
|
||||
|
||||
#chat_page, #mail_page {
|
||||
grid-template-columns: 20rem 1fr;
|
||||
box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#contacts, #mails, #settings_sidebar {
|
||||
height: 100vh;
|
||||
background-color: #9da6ff10;
|
||||
background-color: rgba(157, 166, 255, 0.063);
|
||||
}
|
||||
|
||||
#settings_page {
|
||||
display: grid;
|
||||
height: 100vh;
|
||||
box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
|
||||
grid-template-columns: 14rem 1fr;
|
||||
}
|
||||
#settings_page sm-button {
|
||||
@ -1425,8 +1423,18 @@ sm-tab-panels {
|
||||
font-size: 3rem;
|
||||
}
|
||||
|
||||
#main_navbar {
|
||||
width: 12rem;
|
||||
}
|
||||
#main_navbar .navbar-item .icon {
|
||||
margin-right: 0.8rem;
|
||||
}
|
||||
#main_navbar .label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#chat_page, #mail_page {
|
||||
grid-template-columns: 22rem 1fr;
|
||||
grid-template-columns: 21rem 1fr;
|
||||
}
|
||||
|
||||
#chat header {
|
||||
@ -1451,4 +1459,8 @@ sm-tab-panels {
|
||||
sm-menu:focus-within {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.emoji:hover {
|
||||
background: rgba(var(--text-color), 0.1);
|
||||
}
|
||||
}
|
||||
2
css/main.min.css
vendored
2
css/main.min.css
vendored
File diff suppressed because one or more lines are too long
198
css/main.scss
198
css/main.scss
@ -14,7 +14,7 @@ html, body{
|
||||
height: 100%;
|
||||
}
|
||||
body{
|
||||
--accent-color: #0779e4;
|
||||
--accent-color: #1976D2;
|
||||
--secondary-color: #ffac2e;
|
||||
--text-color: 17, 17, 17;
|
||||
--text-color-light: 100, 100, 100;
|
||||
@ -35,7 +35,7 @@ body[data-theme='dark']{
|
||||
--foreground-color: 20, 20, 20;
|
||||
.initial{
|
||||
color: rgba(var(--text-color), 1) !important;
|
||||
box-shadow: 0 0.1rem 0.1rem #00000016, 0 0.1rem 0.3rem #00000040;
|
||||
box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.16);
|
||||
}
|
||||
.message{
|
||||
color: rgba(var(--text-color), 1);
|
||||
@ -136,11 +136,11 @@ textarea{
|
||||
color: var(--secondary-color)
|
||||
}
|
||||
.fab{
|
||||
box-shadow: 0 1rem 1rem #00000020;
|
||||
filter: drop-shadow(0 0.4rem 0.3rem rgba(0, 0, 0, 0.2));
|
||||
margin-right: 1rem;
|
||||
position: fixed;
|
||||
bottom: 3.5rem;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
z-index: 1;
|
||||
.icon{
|
||||
margin-left: 0 !important;
|
||||
@ -284,20 +284,14 @@ sm-button[variant="primary"]{
|
||||
align-items: center;
|
||||
height: max-content;
|
||||
margin: 0.5rem 0;
|
||||
h4{
|
||||
font-weight: 500;
|
||||
line-height: 1;
|
||||
font-size: 1rem;
|
||||
}
|
||||
h5{
|
||||
font-weight: 400;
|
||||
opacity: 0.8;
|
||||
color: rgba(var(--text-color), 0.7);
|
||||
font-size: 1.1rem !important;
|
||||
font-weight: 500;
|
||||
}
|
||||
.main-logo{
|
||||
height: 1.4rem;
|
||||
margin-right: 0.4rem;
|
||||
fill: rgba(var(--text-color), 1);
|
||||
fill: rgba(var(--text-color), 0.8);
|
||||
stroke: none;
|
||||
}
|
||||
}
|
||||
@ -493,10 +487,10 @@ sm-button[variant="primary"]{
|
||||
position: relative;
|
||||
justify-content: center;
|
||||
font-size: 1.2rem;
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
color: white;
|
||||
box-shadow: 0 0.1rem 0.1rem #0000001a, 0 0.1rem 0.3rem #00000016;
|
||||
box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.06);
|
||||
border-radius: 2rem;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
@ -518,18 +512,21 @@ sm-button[variant="primary"]{
|
||||
}
|
||||
.name{
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
text-transform: capitalize;
|
||||
font-weight: 500;
|
||||
color: rgba(var(--text-color), 0.8);
|
||||
}
|
||||
.address{
|
||||
.last-message{
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
font-weight: 400;
|
||||
color: rgba(var(--text-color), 0.8);
|
||||
font-weight: 500;
|
||||
color: rgba(var(--text-color), 0.9);
|
||||
}
|
||||
sm-menu{
|
||||
.time{
|
||||
font-weight: 400;
|
||||
opacity: 0.8;
|
||||
grid-area: menu;
|
||||
align-self: flex-start;
|
||||
}
|
||||
}
|
||||
#warn_no_encryption, .date-card{
|
||||
@ -654,32 +651,48 @@ sm-button[variant="primary"]{
|
||||
}
|
||||
#main_navbar{
|
||||
position: fixed;
|
||||
flex-direction: column;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
padding: 0;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
width: max(18rem, 80vw);
|
||||
height: 100vh;
|
||||
background: rgba(var(--foreground-color), 1);
|
||||
box-shadow: 0 -0.2rem 1rem #00000016;
|
||||
height: 3.5rem;
|
||||
align-items: center;
|
||||
z-index: 4;
|
||||
// box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
|
||||
.logo-section{
|
||||
padding: 0;
|
||||
margin: 1rem 0 1.5rem 0;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
.active{
|
||||
background: var(--accent-color);
|
||||
.icon{
|
||||
stroke: white;
|
||||
}
|
||||
.label{
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
.label{
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
.navbar-item{
|
||||
position: relative;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
opacity: 0.8;
|
||||
height: auto;
|
||||
justify-content: flex-start;
|
||||
flex-direction: row;
|
||||
flex: none;
|
||||
padding: 1rem 1.2rem;
|
||||
.icon{
|
||||
height: 1.2rem;
|
||||
width: 2.4rem;
|
||||
margin-right: 0.8rem;
|
||||
}
|
||||
&:last-of-type{
|
||||
margin-top: auto;
|
||||
}
|
||||
.icon{
|
||||
height: 1.2rem;
|
||||
width: 1.2rem;
|
||||
}
|
||||
.label{
|
||||
margin-top: 0.4rem;
|
||||
}
|
||||
&.badge::after{
|
||||
right: 0;
|
||||
top: 0;
|
||||
@ -702,15 +715,6 @@ sm-button[variant="primary"]{
|
||||
transform: scale(0);
|
||||
}
|
||||
}
|
||||
.active{
|
||||
opacity: 1;
|
||||
h5{
|
||||
color: var(--accent-color);
|
||||
}
|
||||
.icon{
|
||||
stroke: var(--accent-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
#auto_complete_contact{
|
||||
position: relative;
|
||||
@ -725,7 +729,7 @@ sm-button[variant="primary"]{
|
||||
background: rgba(var(--foreground-color), 1);
|
||||
z-index: 1;
|
||||
border-radius: 0.4rem;
|
||||
box-shadow: 0 0.1rem 0.1rem #00000010, 0 0.2rem 0.5rem #00000020;
|
||||
box-shadow: 0 0.1rem 0.1rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.5rem rgba(0, 0, 0, 0.16);
|
||||
width: 100%;
|
||||
.contact{
|
||||
grid-template-columns: auto 1fr;
|
||||
@ -750,11 +754,9 @@ sm-button[variant="primary"]{
|
||||
}
|
||||
}
|
||||
sm-input::part(input){
|
||||
border-radius: 3rem;
|
||||
padding: 0.5rem 1rem;
|
||||
}
|
||||
.flex{
|
||||
padding-bottom: 1rem;
|
||||
}
|
||||
}
|
||||
#all_contacts{
|
||||
position: absolute;
|
||||
@ -770,11 +772,22 @@ sm-button[variant="primary"]{
|
||||
transform: translateX(-100%);
|
||||
}
|
||||
}
|
||||
#selected_contacts{
|
||||
padding: 1.5rem;
|
||||
background: rgba(var(--text-color), 0.06);
|
||||
h4{
|
||||
font-weight: 500;
|
||||
font-size: 1rem;
|
||||
}
|
||||
sm-button{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
#contacts, #mails{
|
||||
overflow-y: hidden;
|
||||
position: relative;
|
||||
grid-template-rows: max-content 1fr;
|
||||
height: calc(100vh - 3.5rem);
|
||||
height: 100vh;
|
||||
header{
|
||||
padding: 1rem 1.5rem;
|
||||
h4{
|
||||
@ -810,7 +823,6 @@ sm-button[variant="primary"]{
|
||||
height: 100vh;
|
||||
header{
|
||||
padding: 0.5rem 1rem;
|
||||
box-shadow: 0 0.2rem 0.4rem #00000016;
|
||||
.back-button{
|
||||
padding: 0.1rem;
|
||||
stroke-width: 8;
|
||||
@ -818,8 +830,6 @@ sm-button[variant="primary"]{
|
||||
}
|
||||
.initial{
|
||||
margin-right: 1rem;
|
||||
width: 1.6em;
|
||||
height: 1.6em;
|
||||
}
|
||||
h4{
|
||||
font-weight: 500;
|
||||
@ -858,7 +868,7 @@ sm-button[variant="primary"]{
|
||||
}
|
||||
.flex{
|
||||
align-items: flex-end;
|
||||
padding: 1rem;
|
||||
padding: 1rem 1rem 1rem 0.4rem;
|
||||
}
|
||||
sm-textarea::part(textarea){
|
||||
background: rgba(var(--text-color), 0.1);
|
||||
@ -908,7 +918,7 @@ sm-button[variant="primary"]{
|
||||
-webkit-hyphens: auto;
|
||||
hyphens: auto;
|
||||
white-space: pre-wrap;
|
||||
box-shadow: 0 1px 0.1rem #00000020;
|
||||
box-shadow: 0 1px 0.1rem rgba(0, 0, 0, 0.16);
|
||||
padding: 0.6em 1em;
|
||||
line-height: 1.5;
|
||||
a{
|
||||
@ -1008,6 +1018,7 @@ sm-button[variant="primary"]{
|
||||
padding: 0.4rem;
|
||||
border-radius: 0.6rem;
|
||||
user-select: none;
|
||||
text-align: center;
|
||||
}
|
||||
.big-emoji{
|
||||
&::after{
|
||||
@ -1015,13 +1026,11 @@ sm-button[variant="primary"]{
|
||||
}
|
||||
.message-body{
|
||||
background: none !important;
|
||||
box-shadow: none !important;
|
||||
padding: 0 !important;
|
||||
font-size: 2.6rem;
|
||||
}
|
||||
}
|
||||
.emoji:hover{
|
||||
background: rgba(var(--text-color), 0.1);
|
||||
}
|
||||
#new_conversation, #no_mails{
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
@ -1118,7 +1127,7 @@ sm-tab-panels{
|
||||
}
|
||||
}
|
||||
#settings_page{
|
||||
height: calc(100vh - 3.5rem);
|
||||
height: 100vh;
|
||||
overflow: hidden auto;
|
||||
.flex sm-button{
|
||||
margin: 0;
|
||||
@ -1179,10 +1188,17 @@ sm-tab-panels{
|
||||
#landing_illustration{
|
||||
grid-area: illustration;
|
||||
}
|
||||
#main_navbar{
|
||||
transform: translateX(-100%);
|
||||
transition: transform 0.3s;
|
||||
z-index: 4;
|
||||
}
|
||||
#chat{
|
||||
header{
|
||||
h5{
|
||||
width: calc(100vw - 12rem);
|
||||
padding: 1rem;
|
||||
.initial{
|
||||
width: 2rem;
|
||||
height: 2rem;
|
||||
}
|
||||
}
|
||||
.message{
|
||||
@ -1191,7 +1207,6 @@ sm-tab-panels{
|
||||
}
|
||||
}
|
||||
#settings_page{
|
||||
padding-bottom: 3.5rem;
|
||||
header{
|
||||
position: sticky;
|
||||
top: 0;
|
||||
@ -1207,6 +1222,7 @@ sm-tab-panels{
|
||||
|
||||
::-webkit-scrollbar-thumb{
|
||||
background: rgba(var(--text-color), 0.3);
|
||||
border-radius: 1rem;
|
||||
&:hover{
|
||||
background: rgba(var(--text-color), 0.5);
|
||||
}
|
||||
@ -1219,7 +1235,6 @@ sm-tab-panels{
|
||||
}
|
||||
.fab{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
}
|
||||
.logo-section{
|
||||
padding: 2rem 3rem 0 3rem;
|
||||
@ -1246,35 +1261,15 @@ sm-tab-panels{
|
||||
}
|
||||
}
|
||||
#main_navbar{
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
padding: 0.5rem;
|
||||
box-shadow: none;
|
||||
height: auto;
|
||||
width: auto;
|
||||
background: rgba(var(--text-color), 0.06);
|
||||
padding-bottom: 0.5rem;
|
||||
.navbar-item{
|
||||
height: auto;
|
||||
justify-content: flex-start;
|
||||
flex-direction: row;
|
||||
flex: none;
|
||||
padding: 1rem 0.5rem;
|
||||
border-radius: 0.4rem;
|
||||
margin: 0 0.5rem;
|
||||
border-radius: 0.5rem;
|
||||
.icon{
|
||||
height: 1.2rem;
|
||||
width: 2.4rem;
|
||||
}
|
||||
&:last-of-type{
|
||||
margin-top: auto;
|
||||
}
|
||||
}
|
||||
.logo-section{
|
||||
margin: 1rem 0 1.5rem 0;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
.active{
|
||||
background: var(--accent-color);
|
||||
border-radius: 0.4rem;
|
||||
.icon{
|
||||
stroke: white;
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
.label{
|
||||
@ -1302,14 +1297,17 @@ sm-tab-panels{
|
||||
}
|
||||
#chat_page, #mail_page{
|
||||
grid-template-columns: 20rem 1fr;
|
||||
box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
|
||||
z-index: 1;
|
||||
}
|
||||
#contacts, #mails, #settings_sidebar{
|
||||
height: 100vh;
|
||||
background-color: #9da6ff10;
|
||||
background-color: rgba(157, 166, 255, 0.063);
|
||||
}
|
||||
#settings_page{
|
||||
display: grid;
|
||||
height: 100vh;
|
||||
box-shadow: 0 0 1rem rgba(0, 0, 0, 0.1);
|
||||
grid-template-columns: 14rem 1fr;
|
||||
sm-button{
|
||||
width: max-content;
|
||||
@ -1342,8 +1340,19 @@ sm-tab-panels{
|
||||
font-size: 3rem;
|
||||
}
|
||||
}
|
||||
#main_navbar{
|
||||
width: 12rem;
|
||||
.navbar-item{
|
||||
.icon{
|
||||
margin-right: 0.8rem;
|
||||
}
|
||||
}
|
||||
.label{
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
#chat_page, #mail_page{
|
||||
grid-template-columns: 22rem 1fr;
|
||||
grid-template-columns: 21rem 1fr;
|
||||
}
|
||||
#chat{
|
||||
header{
|
||||
@ -1367,4 +1376,7 @@ sm-tab-panels{
|
||||
sm-menu:focus-within{
|
||||
opacity: 1;
|
||||
}
|
||||
.emoji:hover{
|
||||
background: rgba(var(--text-color), 0.1);
|
||||
}
|
||||
}
|
||||
177
index.html
177
index.html
@ -5,6 +5,7 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>FLO Messenger</title>
|
||||
<link rel="shortcut icon" href="assets/messenger-favicon.png" type="image/png">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="css/main.min.css">
|
||||
@ -244,11 +245,12 @@
|
||||
<div class="contact" tabindex="0">
|
||||
<div class="initial flex align-center"></div>
|
||||
<h4 class="name"></h4>
|
||||
<h5 class="address copy"></h5>
|
||||
<sm-menu align-options="right">
|
||||
<h5 class="last-message"></h5>
|
||||
<h5 class="time"></h5>
|
||||
<!--<sm-menu align-options="right">
|
||||
<sm-menu-option class="send-mail-option">Send mail</sm-menu-option>
|
||||
<sm-menu-option onclick="copyToClipboard('.copy', 'FLO ID copied', this.closest('.contact'))">Copy FLO ID</sm-menu-option>
|
||||
</sm-menu>
|
||||
</sm-menu>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -265,7 +267,8 @@
|
||||
<title>RanchiMall</title>
|
||||
<path
|
||||
d="M27.14,30.86c-.74-2.48-3-4.36-8.25-6.94a20,20,0,0,1-4.2-2.49,6,6,0,0,1-1.25-1.67,4,4,0,0,1,0-2.26c.37-1.08.79-1.57,3.89-4.55a11.66,11.66,0,0,0,3.34-4.67,6.54,6.54,0,0,0,.05-2.82C20,3.6,18.58,2,16.16.49c-.89-.56-1.29-.64-1.3-.24a3,3,0,0,1-.3.72l-.3.55L13.42.94C13,.62,12.4.26,12.19.15c-.4-.2-.73-.18-.72.05a9.39,9.39,0,0,1-.61,1.33s-.14,0-.27-.13C8.76.09,8-.27,8,.23A11.73,11.73,0,0,1,6.76,2.6C4.81,5.87,2.83,7.49.77,7.49c-.89,0-.88,0-.61,1,.22.85.33.92,1.09.69A5.29,5.29,0,0,0,3,8.33c.23-.17.45-.29.49-.26a2,2,0,0,1,.22.63A1.31,1.31,0,0,0,4,9.34a5.62,5.62,0,0,0,2.27-.87L7,8l.13.55c.19.74.32.82,1,.65a7.06,7.06,0,0,0,3.46-2.47l.6-.71-.06.64c-.17,1.63-1.3,3.42-3.39,5.42L6.73,14c-3.21,3.06-3,5.59.6,8a46.77,46.77,0,0,0,4.6,2.41c.28.13,1,.52,1.59.87,3.31,2,4.95,3.92,4.95,5.93a2.49,2.49,0,0,0,.07.77h0c.09.09,0,.1.9-.14a2.61,2.61,0,0,0,.83-.32,3.69,3.69,0,0,0-.55-1.83A11.14,11.14,0,0,0,17,26.81a35.7,35.7,0,0,0-5.1-2.91C9.37,22.64,8.38,22,7.52,21.17a3.53,3.53,0,0,1-1.18-2.48c0-1.38.71-2.58,2.5-4.23,2.84-2.6,3.92-3.91,4.67-5.65a3.64,3.64,0,0,0,.42-2A3.37,3.37,0,0,0,13.61,5l-.32-.74.29-.48c.17-.27.37-.63.46-.8l.15-.3.44.64a5.92,5.92,0,0,1,1,2.81,5.86,5.86,0,0,1-.42,1.94c0,.12-.12.3-.15.4a9.49,9.49,0,0,1-.67,1.1,28,28,0,0,1-4,4.29C8.62,15.49,8.05,16.44,8,17.78a3.28,3.28,0,0,0,1.11,2.76c.95,1,2.07,1.74,5.25,3.32,3.64,1.82,5.22,2.9,6.41,4.38A4.78,4.78,0,0,1,21.94,31a3.21,3.21,0,0,0,.14.92,1.06,1.06,0,0,0,.43-.05l.83-.22.46-.12-.06-.46c-.21-1.53-1.62-3.25-3.94-4.8a37.57,37.57,0,0,0-5.22-2.82A13.36,13.36,0,0,1,11,21.19a3.36,3.36,0,0,1-.8-4.19c.41-.85.83-1.31,3.77-4.15,2.39-2.31,3.43-4.13,3.43-6a5.85,5.85,0,0,0-2.08-4.29c-.23-.21-.44-.43-.65-.65A2.5,2.5,0,0,1,15.27.69a10.6,10.6,0,0,1,2.91,2.78A4.16,4.16,0,0,1,19,6.16a4.91,4.91,0,0,1-.87,3c-.71,1.22-1.26,1.82-4.27,4.67a9.47,9.47,0,0,0-2.07,2.6,2.76,2.76,0,0,0-.33,1.54,2.76,2.76,0,0,0,.29,1.47c.57,1.21,2.23,2.55,4.65,3.73a32.41,32.41,0,0,1,5.82,3.24c2.16,1.6,3.2,3.16,3.2,4.8a1.94,1.94,0,0,0,.09.76,4.54,4.54,0,0,0,1.66-.4C27.29,31.42,27.29,31.37,27.14,30.86ZM6.1,7h0a3.77,3.77,0,0,1-1.46.45L4,7.51l.68-.83a25.09,25.09,0,0,0,3-4.82A12,12,0,0,1,8.28.76c.11-.12.77.32,1.53,1l.63.58-.57.84A10.34,10.34,0,0,1,6.1,7Zm5.71-1.78A9.77,9.77,0,0,1,9.24,7.18h0a5.25,5.25,0,0,1-1.17.28l-.58,0,.65-.78a21.29,21.29,0,0,0,2.1-3.12c.22-.41.42-.76.44-.79s.5.43.9,1.24L12,5ZM13.41,3a2.84,2.84,0,0,1-.45.64,11,11,0,0,1-.9-.91l-.84-.9.19-.45c.34-.79.39-.8,1-.31A9.4,9.4,0,0,1,13.8,2.33q-.18.34-.39.69Z" />
|
||||
</svg>
|
||||
</svg>
|
||||
<h5 class="label">FLO Messenger</h5>
|
||||
</div>
|
||||
<div class="navbar-item flex badge align-center active" data-notifications="0" id="chat_page_button" data-target="chat_page" title="Chat">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 64 64">
|
||||
@ -299,7 +302,7 @@
|
||||
<div class="grid align-center">
|
||||
<h4>Direct Messages</h4>
|
||||
<sm-menu align-options="right">
|
||||
<sm-menu-option>Create a group</sm-menu-option>
|
||||
<sm-menu-option onclick="initGroupCreation()">Create a group</sm-menu-option>
|
||||
</sm-menu>
|
||||
</div>
|
||||
<sm-input id="search_chats" type="search" placeholder="Search">
|
||||
@ -310,7 +313,7 @@
|
||||
</svg>
|
||||
</sm-input>
|
||||
</header>
|
||||
<sm-button variant="primary" id="new_message_button" onclick="toggleContacts()" class="fab round">
|
||||
<sm-button variant="primary" id="new_message_button" onclick="showContacts()" class="fab round">
|
||||
<svg xmlns="http://www.w3.org/2000/svg"class="icon" viewBox="0 0 64 64">
|
||||
<title>Send new message</title>
|
||||
<path d="M55.76,20.13,59,23.34l3.5-3.48a3.26,3.26,0,0,0,.05-4.63l0-.05-.59-.56a3.3,3.3,0,0,0-4.67,0l-21.1,21a2.34,2.34,0,0,0-.63,1.19l-.9,4.63a.8.8,0,0,0,.66.91.57.57,0,0,0,.26,0l4.65-.88a2.36,2.36,0,0,0,1.22-.61l15.7-15.63"/>
|
||||
@ -333,7 +336,7 @@
|
||||
<div id="all_contacts">
|
||||
<header class="grid">
|
||||
<div class="flex align-center">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon back" onclick="toggleContacts()" viewBox="0 0 64 64">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="icon back" onclick="showContacts(false)" viewBox="0 0 64 64">
|
||||
<title>back-arrow</title>
|
||||
<line x1="1" y1="32" x2="64" y2="32"/>
|
||||
<polyline points="29.64 60.97 0.65 32 29.64 3.03"/>
|
||||
@ -355,19 +358,21 @@
|
||||
</svg>
|
||||
</sm-input>
|
||||
</header>
|
||||
<div id="selected_contacts">
|
||||
<h4>Selected group members</h4>
|
||||
<div id="selected_contacts" class="hide-completely">
|
||||
<h4>Add group members</h4>
|
||||
<div id="selected_contacts_container">
|
||||
</div>
|
||||
<sm-button>Create</sm-button>
|
||||
</div>
|
||||
<div id="contacts_container" class="flex"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="chat" class="flex direction-column hide-on-mobile hide-completely">
|
||||
<header class="flex align-center">
|
||||
<svg class="icon hide-on-desktop back-button" onclick="goto('chats')" viewBox="0 0 64 64">
|
||||
<title>Go to main page</title>
|
||||
<polyline points="48.01 0.35 16.35 32 48.01 63.65"/>
|
||||
<svg class="icon hide-on-desktop back-button" onclick="goto('chats')" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
||||
<title>Go to chat page</title>
|
||||
<line x1="1" y1="32" x2="64" y2="32"/>
|
||||
<polyline points="29.64 60.97 0.65 32 29.64 3.03"/>
|
||||
</svg>
|
||||
<div id="receiver_initial" class="initial flex align-center"></div>
|
||||
<h4 id="receiver_name"></h4>
|
||||
@ -479,7 +484,7 @@
|
||||
<div id="personalise_panel" class="panel hide-completely">
|
||||
<section class="setting-toggle">
|
||||
<h4>Dark mode</h4>
|
||||
<p>Toggle dark mode on/off.</p>
|
||||
<p>Toggle dark mode on/off. Setting applies to this browser only</p>
|
||||
<sm-switch id="theme_switcher"></sm-switch>
|
||||
</section>
|
||||
<section class="setting-toggle">
|
||||
@ -670,6 +675,11 @@
|
||||
return color;
|
||||
}
|
||||
|
||||
const selectedColors = ['#FF1744', '#F50057', '#8E24AA', '#5E35B1', '#3F51B5', '#3D5AFE', '#00B0FF', '#00BCD4', '#1DE9B6', '#66BB6A', '#8BC34A', '#FBC02D', '#FF6F00', '#FF9100', '#FF3D00']
|
||||
function randomColor(){
|
||||
return selectedColors[Math.floor(Math.random() * selectedColors.length)]
|
||||
}
|
||||
|
||||
function clearElements(array = []) {
|
||||
array.forEach(item => {
|
||||
getRef(item).innerHTML = ``
|
||||
@ -1039,7 +1049,7 @@
|
||||
},
|
||||
activeChatPage = getRef('contacts'),
|
||||
activeMailPage = getRef('mails'),
|
||||
activeChat,
|
||||
activeChat = {},
|
||||
activeMail,
|
||||
frag = document.createDocumentFragment()
|
||||
|
||||
@ -1122,19 +1132,21 @@
|
||||
card.querySelector('.mail-content').textContent = content
|
||||
return card
|
||||
},
|
||||
contactCard(floID, name, type){
|
||||
async contactCard(floID, name, type){
|
||||
let card = getRef('contact_template').content.cloneNode(true),
|
||||
cardContainer = card.firstElementChild
|
||||
cardContainer.setAttribute("name", name || 'Unknown')
|
||||
cardContainer.setAttribute("flo-id", floID)
|
||||
card.querySelector('.name').textContent = name || 'Unknown'
|
||||
card.querySelector('.address').textContent = floID
|
||||
const lastMessage = Object.values(await messenger.getChat(floID)).pop()
|
||||
card.querySelector('.last-message').textContent = lastMessage.message
|
||||
card.querySelector('.time').textContent = formatedTime(lastMessage.time, true)
|
||||
let initial = card.querySelector('.initial')
|
||||
initial.textContent = name ? name.charAt(0) : 'U'
|
||||
let randomColor = randomHsl(70, 30)
|
||||
cardContainer.setAttribute("text-color", randomColor.primary)
|
||||
cardContainer.setAttribute("background-color", randomColor.light)
|
||||
initial.setAttribute(`style`, `background-color: ${randomColor.light}; color: ${randomColor.primary};`)
|
||||
let color = randomColor()
|
||||
//cardContainer.setAttribute("text-color", randomColor.primary)
|
||||
cardContainer.setAttribute("background-color", color)
|
||||
initial.setAttribute(`style`, `background-color: ${color};`)
|
||||
if(type === 'contact'){
|
||||
cardContainer.classList.add('contact')
|
||||
let duplicateCard = card.cloneNode(true);
|
||||
@ -1207,7 +1219,7 @@
|
||||
|
||||
function renderDirectUI(data) {
|
||||
console.log(data)
|
||||
renderMessages(data.messages);
|
||||
renderMessages(data.messages, {updateChatCard: true});
|
||||
renderMailList(data.mails)
|
||||
if(Object.keys(data.messages).length && activePage.button !== getRef('chat_page_button')){
|
||||
getRef('chat_page_button').setAttribute('data-notifications', Object.keys(data.messages).length)
|
||||
@ -1356,21 +1368,30 @@
|
||||
showPopup('compose_mail_popup')
|
||||
}
|
||||
if(e.target.closest('#chat')){
|
||||
messenger.removeMark(currentReceiver, "unread");
|
||||
messenger.removeMark(activeChat['receiver'], "unread");
|
||||
}
|
||||
|
||||
//Detect click on send mail option
|
||||
if (e.target.closest(".send-mail-option")){
|
||||
let floID;
|
||||
showPopup('compose_mail_popup')
|
||||
floID = e.target.closest(".contact").getAttribute("flo-id");
|
||||
getRef('send_mail_to').value = floID;
|
||||
return false;
|
||||
}
|
||||
|
||||
//detect click on chat cards
|
||||
if (!e.target.closest("sm-menu") && e.target.closest(".contact")){
|
||||
const contact = e.target.closest(".contact")
|
||||
if(activeChat === contact && window.innerWidth > 640) return
|
||||
if(activeChat['chatCard'] === contact && window.innerWidth > 640) return
|
||||
getRef('chat_page_button').setAttribute('data-notifications', '0')
|
||||
getRef('chat').classList.remove('hide-completely')
|
||||
contact.classList.remove('unread')
|
||||
viewConversation(contact)
|
||||
if(activeChat)
|
||||
activeChat.classList.remove('active')
|
||||
if(activeChat['chatCard'])
|
||||
activeChat['chatCard'].classList.remove('active')
|
||||
contact.classList.add('active')
|
||||
activeChat = contact
|
||||
activeChat['chatCard'] = contact
|
||||
if(activeChatPage.id === 'contacts'){
|
||||
getRef('chat').classList.remove('hide-on-mobile')
|
||||
getRef('contacts').classList.add('hide-on-mobile')
|
||||
@ -1386,7 +1407,14 @@
|
||||
}
|
||||
})
|
||||
|
||||
const emojis = ["😀", "😃", "😄", "😁", "😆", "😅", "😂", "🤣", "😊", "😇", "🙂", "🙃", "😉", "😌", "😍", "🥰", "😘", "😗", "😙", "😚", "😋", "😛", "😝", "😜", "🤪", "🤨", "🧐", "🤓", "😎", "🤩", "🥳", "😏", "😒", "😞", "😔", "😟", "😕", "🙁", "☹️", "😣", "😖", "😫", "😩", "🥺", "😢", "😭", "😤", "😠", "😡", "🤬", "🤯", "😳", "🥵", "🥶", "😱", "😨", "😰", "😥", "😓", "🤗", "🤔", "🤭", "🤫", "🤥", "😶", "😐", "😑", "😬", "🙄", "😯", "😦", "😧", "😮", "😲", "🥱", "😴", "🤤", "😪", "😵", "🤐", "🥴", "🤢", "🤮", "🤧", "😷", "🤒", "🤕", "🤑", "🤠", "😈", "👿", "👹", "👺", "🤡", "💩", "👻", "💀", "☠️", "👽", "👾", "🤖", "🎃", "😺", "😸", "😹", "😻", "😼", "😽", "🙀", "😿", "😾"];
|
||||
const emojis = ["😀", "😃", "😄", "😁", "😆", "😅", "😂", "🤣", "😊", "😇", "🙂", "🙃", "😉", "😌", "😍", "🥰", "😘", "😗","😙", "😚", "😋", "😛", "😝", "😜", "🤪", "🤨", "🧐",
|
||||
"🤓", "😎", "🤩", "🥳", "😏", "😒", "😞", "😔", "😟", "😕", "🙁", "☹️", "😣", "😖", "😫", "😩", "🥺", "😢", "😭", "😤", "😠", "😡", "🤬", "🤯", "😳", "🥵", "🥶",
|
||||
"😱", "😨", "😰", "😥", "😓", "🤗", "🤔", "🤭", "🤫", "🤥", "😶", "😐", "😑", "😬", "🙄", "😯", "😦", "😧", "😮", "😲", "🥱", "😴", "🤤", "😪", "😵", "🤐", "🥴",
|
||||
"🤢", "🤮", "🤧", "😷", "🤒", "🤕", "🤑", "🤠", "😈", "👿", "👹", "👺", "🤡", "💩", "👻", "💀", "☠️", "👽", "👾", "🤖", "🎃", "😺", "😸", "😹", "😻", "😼", "😽",
|
||||
"🙀", "😿", "😾",
|
||||
"👋", "🤚", "🖐", "✋", "🖖", "👌", "🤏", "✌️", "🤞", "🤟", "🤘", "🤙", "👈", "👉", "👆", "🖕", "👇", "☝️", "👍", "👎", "✊", "👊", "🤛", "🤜", "👏", "🙌", "👐", "🤲", "🤝", "🙏",
|
||||
"✍️", "💅", "🤳", "💪", "🦾", "🦵", "🦿", "🦶", "👣", "👂", "🦻", "👃", "🧠", "🦷", "🦴", "👀", "👅", "👄", "💋", "🩸"
|
||||
];
|
||||
let renderedEmojis = ''
|
||||
emojis.forEach(emoji => {
|
||||
renderedEmojis += `<span class="emoji">${emoji}</span>`
|
||||
@ -1445,8 +1473,14 @@
|
||||
})
|
||||
|
||||
// Function to show all contacts side drawer
|
||||
function toggleContacts(){
|
||||
getRef('all_contacts').classList.toggle('no-transformations')
|
||||
function showContacts(show = true){
|
||||
if(show)
|
||||
getRef('all_contacts').classList.add('no-transformations')
|
||||
else{
|
||||
getRef('all_contacts').classList.remove('no-transformations')
|
||||
getRef('selected_contacts').classList.add('hide-completely')
|
||||
isCreatingGroup = false
|
||||
}
|
||||
}
|
||||
|
||||
function updateHeight(){
|
||||
@ -1522,22 +1556,6 @@
|
||||
}
|
||||
})
|
||||
|
||||
getRef('dm_container').addEventListener('click', function (e) {
|
||||
let floID;
|
||||
if (e.target.closest(".send-mail-option")){
|
||||
showPopup('compose_mail_popup')
|
||||
floID = e.target.closest(".contact").getAttribute("flo-id");
|
||||
let tmp = getRef('send_mail_to').value.trim();
|
||||
if (!tmp.includes(floID)) {
|
||||
if (tmp == '')
|
||||
tmp = floID;
|
||||
else
|
||||
tmp += `, ${floID}`;
|
||||
}
|
||||
getRef('send_mail_to').value = tmp;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
getRef("sign_out").addEventListener('click', signOut);
|
||||
|
||||
@ -1629,19 +1647,21 @@
|
||||
})
|
||||
|
||||
function sendMessage() {
|
||||
let receiver = currentReceiver
|
||||
if(window.innerWidth > 640)
|
||||
getRef('type_message').focusIn()
|
||||
let receiver = activeChat['receiver']
|
||||
let container;
|
||||
let message = getRef('type_message').value;
|
||||
getRef('type_message').value = ''
|
||||
if(message.trim() === '') return
|
||||
if(message.trim() === '') return
|
||||
let time = Date.now()
|
||||
getRef('chat_container').append(render.messageBubble(receiver, message, time, 'sent', true))
|
||||
scrollToBottom(true)
|
||||
if(activeChat !== getRef('dm_container').children[0]){
|
||||
const contact = getRef('dm_container').querySelector(`.chat[flo-id="${activeChat.getAttribute('flo-id')}"]`)
|
||||
if(activeChat['chatCard'] !== getRef('dm_container').children[0]){
|
||||
const contact = getRef('dm_container').querySelector(`.chat[flo-id="${activeChat.receiver}"]`)
|
||||
const cloneContact = contact.cloneNode(true)
|
||||
contact.remove()
|
||||
activeChat = cloneContact
|
||||
activeChat['chatCard'] = cloneContact
|
||||
getRef('dm_container').prepend(cloneContact)
|
||||
animateTo(getRef('dm_container').children[0], [
|
||||
{transform: 'translateY(1rem)'},
|
||||
@ -1655,6 +1675,8 @@
|
||||
}
|
||||
messenger.sendMessage(message, receiver).then(data => {
|
||||
getRef(`${receiver}_${time}`).classList.remove('unconfirmed')
|
||||
activeChat.chatCard.querySelector('.last-message').textContent = message
|
||||
activeChat.chatCard.querySelector('.time').textContent = formatedTime(Date.now(), true)
|
||||
}).catch(error => notify(error, "error"));
|
||||
}
|
||||
|
||||
@ -1675,7 +1697,7 @@
|
||||
return
|
||||
}
|
||||
messenger.storeContact(floID, name).then(result => {
|
||||
render.contactCard(floID, name)
|
||||
render.contactCard(floID, name, 'contact')
|
||||
hidePopup()
|
||||
notify(`Added Contact: ${floID}`)
|
||||
}).catch(error => notify(error, "error"));
|
||||
@ -1686,10 +1708,11 @@
|
||||
render.contactCard(floID, contactList[floID], 'contact')
|
||||
}
|
||||
|
||||
function renderChatList() {
|
||||
async function renderChatList() {
|
||||
getRef('dm_container').innerHTML = ''
|
||||
for (floID of messenger.getChatOrder().direct)
|
||||
render.contactCard(floID, floGlobals.contacts[floID], 'chat')
|
||||
for (floID of messenger.getChatOrder().direct){
|
||||
await render.contactCard(floID, floGlobals.contacts[floID], 'chat')
|
||||
}
|
||||
}
|
||||
|
||||
function renderMarked(data) {
|
||||
@ -1704,39 +1727,48 @@
|
||||
getRef('chat_container').scrollTo({top: getRef('chat_container').scrollHeight, behaviour: smooth ? 'smooth': ''})
|
||||
}
|
||||
|
||||
function renderMessages(data, markUnread = true, unconfirmed = false) {
|
||||
function renderMessages(data, options) {
|
||||
let {markUnread = true, updateChatCard = false} = options
|
||||
for (let m in data) {
|
||||
let {floID, message, time, category} = data[m]
|
||||
frag.append(render.messageBubble(floID, message, time, category, unconfirmed))
|
||||
if (markUnread && activeChat !== getRef('dm_container').children[0]){
|
||||
const contact = getRef('dm_container').querySelector(`.chat[flo-id='${floID}']`)
|
||||
contact.classList.add("unread");
|
||||
//Stops message from rendering in wrong chat window
|
||||
if(activeChat['receiver'] && activeChat['receiver'] === floID)
|
||||
frag.append(render.messageBubble(floID, message, time, category))
|
||||
const contact = getRef('dm_container').querySelector(`.chat[flo-id='${floID}']`)
|
||||
if (markUnread){
|
||||
contact.classList.add("unread");
|
||||
if(activeChat['chatCard'] !== getRef('dm_container').children[0] || contact !== getRef('dm_container').children[0]){
|
||||
const cloneContact = contact.cloneNode(true)
|
||||
contact.remove()
|
||||
getRef('dm_container').prepend(cloneContact)
|
||||
animateTo(getRef('dm_container').children[0], [
|
||||
{transform: 'translateY(1rem)'},
|
||||
{transform: 'none'},
|
||||
],
|
||||
{
|
||||
easing: 'ease',
|
||||
duration: 300
|
||||
}
|
||||
{transform: 'translateY(1rem)'},
|
||||
{transform: 'none'},
|
||||
],
|
||||
{
|
||||
easing: 'ease',
|
||||
duration: 300
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
if(updateChatCard){
|
||||
const chatCard = getRef('dm_container').querySelector(`[flo-id="${floID}"]`)
|
||||
chatCard.querySelector('.last-message').textContent = message
|
||||
chatCard.querySelector('.time').textContent = formatedTime(time, true)
|
||||
}
|
||||
}
|
||||
getRef('chat_container').append(frag)
|
||||
scrollToBottom()
|
||||
}
|
||||
|
||||
let currentReceiver
|
||||
async function viewConversation(contact) {
|
||||
getRef('chat_container').innerHTML = ''
|
||||
let floID = contact.getAttribute("flo-id"),
|
||||
name = contact.getAttribute('name'),
|
||||
textColor = contact.getAttribute('text-color'),
|
||||
backgroundColor = contact.getAttribute('background-color')
|
||||
currentReceiver = floID
|
||||
activeChat['receiver'] = floID
|
||||
getRef("receiver_initial").textContent = floGlobals.contacts[floID] ? floGlobals.contacts[floID].charAt(0) : name.charAt(0) || ' ';
|
||||
getRef("receiver_initial").setAttribute('style', `color: ${textColor}; background-color: ${backgroundColor};`)
|
||||
getRef("receiver_name").textContent = floGlobals.contacts[floID] || name || ' ';
|
||||
@ -1744,7 +1776,7 @@
|
||||
getRef("warn_no_encryption").classList.add("hide-completely");
|
||||
else
|
||||
getRef("warn_no_encryption").classList.remove("hide-completely");
|
||||
renderMessages(await messenger.getChat(floID), false)
|
||||
renderMessages(await messenger.getChat(floID),{markUnread: false})
|
||||
scrollToBottom()
|
||||
prevScroll = getRef('chat_container').scrollTop
|
||||
messenger.removeMark(floID, "unread");
|
||||
@ -1772,6 +1804,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
let isCreatingGroup = false
|
||||
function initGroupCreation(){
|
||||
isCreatingGroup = true
|
||||
showContacts()
|
||||
getRef('selected_contacts').classList.remove('hide-completely')
|
||||
}
|
||||
|
||||
function viewMail(mailRef, newView = true) {
|
||||
//clear the container and display popup (if needed)
|
||||
if (newView)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user