diff --git a/css/main.css b/css/main.css index 42a03b0..f93a7fb 100644 --- a/css/main.css +++ b/css/main.css @@ -548,11 +548,17 @@ sm-button[variant=primary] .icon { position: relative; display: grid; gap: 0 1rem; - grid-template-columns: auto 1fr auto; - grid-template-areas: "dp . menu" "dp . menu"; padding: 0.8rem 1.5rem; align-items: center; } +.contact.chat { + grid-template-columns: auto 1fr auto; + grid-template-areas: "dp . menu" "dp . ."; +} +.contact:not(.chat) { + grid-template-columns: auto 1fr; + grid-template-areas: "dp ."; +} .contact:focus { background: rgba(var(--text-color), 0.06); outline: none; @@ -566,6 +572,7 @@ sm-button[variant=primary] .icon { color: rgba(var(--text-color), 0.8); } .contact .last-message { + grid-column: 2/4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; @@ -598,7 +605,7 @@ sm-button[variant=primary] .icon { .contact.unread .initial::before { content: ""; position: absolute; - padding: 0.3rem; + padding: 0.4rem; border-radius: 1rem; top: 0; left: 0; @@ -973,6 +980,9 @@ sm-button[variant=primary] .icon { margin-top: 0.8rem; } #chat .message .message-body { + display: inline-flex; + align-items: center; + flex-wrap: wrap; overflow-wrap: break-word; word-wrap: break-word; word-break: break-all; @@ -988,6 +998,11 @@ sm-button[variant=primary] .icon { #chat .message .message-body a { color: inherit; } +#chat .message .message-body .text-emoji { + align-self: center; + font-size: 1.4em; + letter-spacing: 0ch; +} #chat .message .time { white-space: nowrap; font-size: 0.8em; @@ -1044,18 +1059,28 @@ sm-button[variant=primary] .icon { } #chat .unconfirmed { opacity: 0.7; - transform-origin: left; + transform-origin: right; animation: slide-up 0.3s forwards; } @keyframes slide-up { from { - transform: translate(-2rem, 2rem) scale(0.8); + transform: translateY(-2rem); } to { transform: none; } } +.big-emoji::after { + display: none; +} +.big-emoji .message-body { + background: none !important; + box-shadow: none !important; + padding: 0 !important; + font-size: 2.6rem; +} + #chat_container { flex: 1; padding: 0 1rem; @@ -1063,15 +1088,26 @@ sm-button[variant=primary] .icon { #emoji_picker { display: grid; + gap: 1rem; background: rgba(var(--text-color), 0.06); border-radius: 1rem; margin: 0 1rem; - grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr)); box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.3); - padding: 1rem; overflow-y: auto; + max-height: 30vh; +} +#emoji_picker section { + display: flex; flex-wrap: wrap; - max-height: min(16rem, 30vh); + padding: 1rem; +} +#emoji_picker .section-header { + position: sticky; + top: 0; + background: linear-gradient(rgba(var(--text-color), 0.06), rgba(var(--text-color), 0.06)), rgba(var(--foreground-color), 1); + padding: 1rem 0; + width: 100%; + z-index: 1; } .emoji { @@ -1081,16 +1117,7 @@ sm-button[variant=primary] .icon { border-radius: 0.6rem; user-select: none; text-align: center; -} - -.big-emoji::after { - display: none; -} -.big-emoji .message-body { - background: none !important; - box-shadow: none !important; - padding: 0 !important; - font-size: 2.6rem; + min-width: 3rem; } #new_conversation, #no_mails { @@ -1269,6 +1296,11 @@ sm-tab-panels { z-index: 4; } + #dm_container, +#contact_container { + gap: 0.5rem; + } + #chat header { padding: 1rem; } @@ -1340,7 +1372,7 @@ sm-tab-panels { #main_navbar { position: relative; width: auto; - background: rgba(var(--text-color), 0.06); + background: rgba(var(--text-color), 0.05); padding-bottom: 0.5rem; } #main_navbar .navbar-item { @@ -1369,6 +1401,10 @@ sm-tab-panels { grid-template-columns: auto 1fr; } + #emoji_picker { + max-height: 18rem; + } + #chat .message .message-body { max-width: 65ch; } diff --git a/css/main.min.css b/css/main.min.css index 28efe79..ed941cd 100644 --- a/css/main.min.css +++ b/css/main.min.css @@ -1 +1 @@ -#landing_page,.sign-in-box,body,body #scroll_to_bottom{background:rgba(var(--foreground-color),1)}p,textarea{line-height:1.6}.hide,span.ripple{pointer-events:none}.contact .last-message,.copy-row .copy,.mail-card .sender,.text-overflow{text-overflow:ellipsis;white-space:nowrap}*,::after,::before{padding:0;margin:0;box-sizing:border-box;font-family:Roboto,sans-serif}:root{scroll-behavior:smooth;font-size:clamp(16px,1.2vw,48px)}body,html{height:100%}body{--accent-color:#1976D2;--secondary-color:#ffac2e;--text-color:17,17,17;--text-color-light:100,100,100;--foreground-color:255,255,255;--background-color:#efefef;--error-color:red;color:rgba(var(--text-color),1)}body #scroll_to_bottom{box-shadow:0 .3rem .4rem rgba(0,0,0,.2)}body[data-theme=dark]{--secondary-color:#FDB956;--text-color:218,218,218;--text-color-light:170,170,170;--foreground-color:20,20,20}body[data-theme=dark] .initial{color:rgba(var(--text-color),1)!important;box-shadow:0 .1rem .1rem rgba(0,0,0,.16)}body[data-theme=dark] .message,h1,h2,h3,h4,h5,textarea{color:rgba(var(--text-color),1)}body[data-theme=dark] #scroll_to_bottom{background:linear-gradient(rgba(var(--text-color),.1),rgba(var(--text-color),.1)),rgba(var(--foreground-color),1);box-shadow:0 .4rem .4rem rgba(0,0,0,.3)}h1{font-size:3rem}h2{font-size:2rem}h3{font-size:1.5rem}h4{font-size:1.1rem}h5{font-size:.8rem}h1,h2,h3,h4,h5{font-weight:600}textarea{background:rgba(var(--text-color),.06);border:none;border-radius:.3rem;width:100%;padding:1rem;font-size:1rem;resize:none}textarea:focus{outline:0;box-shadow:0 0 0 .1rem var(--accent-color)}.flex{display:flex}.grid{display:grid}.grid-2{grid-template-columns:auto auto;gap:1em}.align-center{align-items:center}.justify-right{margin-left:auto}.direction-column{flex-direction:column}.rest{flex:1}.hide{opacity:0}.hide-completely{display:none!important}.no-transformations{transform:none!important}.breakable{overflow-wrap:break-word}.text-overflow{overflow:hidden}.sticky{position:sticky;top:1rem}.light-text{color:rgba(var(--text-color-light),1)}.accent-color{color:var(--accent-color)}.secondary-color{color:var(--secondary-color)}.fab{filter:drop-shadow(0 .4rem .3rem rgba(0, 0, 0, .2));margin-right:1rem;position:fixed;right:0;bottom:0;z-index:1}.fab .icon{margin-left:0!important;margin-right:.5rem;height:.9rem!important;stroke-width:8!important}a:any-link{word-wrap:break-word;color:var(--accent-color);font-weight:500}.solid-background{background:var(--background-color)!important}.normal-weight{font-weight:400}.icon{fill:none;stroke-width:6;stroke:rgba(var(--text-color),1);height:1.2rem;width:1.2rem;overflow:visible;stroke-linecap:round;stroke-linejoin:round}span.ripple{position:absolute;border-radius:50%;transform:scale(0);background:rgba(var(--text-color),.2)}#landing_illustration,.contact,.initial,.interact,.logo-section{position:relative}.interact{overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent}sm-popup sm-input+sm-input{margin-top:1rem}.popup-header{padding:.5rem 1.5rem 0;display:flex;align-items:center;width:100%}.popup-header .icon{padding:.7rem;height:2.4rem;width:2.4rem;stroke-width:8;transform:translateX(-.5rem);cursor:pointer;-webkit-tap-highlight-color:transparent}.popup-header .back{transform:none}.popup-header button,.popup-header sm-button{width:auto;margin-left:auto}.copy-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:auto}.copy-row .icon{cursor:pointer;padding:.4rem;height:1.8rem;width:1.8rem}.copy-row .copy{overflow:hidden}.copy-row h4{margin-bottom:0!important}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-weight:500;margin-bottom:.5rem}#confirmation_popup sm-button,#prompt_popup sm-button{margin:0}#confirmation_popup .flex,#prompt_popup .flex{padding:0;margin-top:2rem}#confirmation_popup .flex sm-button:first-of-type,#prompt_popup .flex sm-button:first-of-type{margin-right:.6rem;margin-left:auto}.card,sm-button{margin:1rem 0}.page{align-items:flex-start;width:100%;height:100%}.card{display:flex;flex-direction:column}sm-button .icon{margin-right:.4rem}sm-button[variant=primary]{--foreground-color:255,255,255}sm-button[variant=primary] .icon{align-self:center;height:1rem;width:1rem;margin-left:.8rem;stroke-width:6;stroke:#fff}.logo-section{align-items:center;height:max-content;margin:.5rem 0}.logo-section h5{font-size:1.1rem!important;font-weight:500}.logo-section .main-logo{height:1.4rem;margin-right:.4rem;fill:rgba(var(--text-color),.8);stroke:none}.select-file input[type=file]{display:none}#landing{display:grid;border-radius:.6rem;width:100%;padding:0 1.5rem;height:100%;align-items:center}#landing .logo-section{padding:1.5rem;display:flex}#landing .title-font{line-height:1.2;font-weight:700;font-size:2.5rem}#landing .left h3,#landing .left h4,#landing .left p,.contact .last-message,.contact .name,.sign-in-box h3,.sign-in-box h4,.sign-in-box h5{font-weight:500}#landing .left{display:grid;flex-direction:column;padding-bottom:1.5rem;z-index:1}#landing .left h4{color:rgba(var(--foreground-color),1)}#landing .left sm-button{margin:1.5rem 0 2rem;width:max-content}#landing .left h3{margin-bottom:1rem}.logo-section{padding:1.5rem}#landing_illustration{width:100%}#sign_in_popup::part(popup-body){padding:0}.sign-in-box{width:100%;margin:0 -2rem;z-index:1;justify-self:center;padding:1.5rem;border-radius:.5rem}.sign-in-box sm-input{text-align:left}.sign-in-box sm-panel{width:100%}.sign-in-box sm-tab-header{margin:0;background:0 0;align-self:flex-start}.sign-in-box sm-tab-header::part(tab-header){padding-bottom:.4rem;gap:1.5rem}.sign-in-box sm-tab::part(tab){padding:.4rem 0}.sign-in-box sm-tab-panels{margin-top:1.5rem}.sign-in-box form{width:100%}.sign-in-box h2{margin-bottom:.5rem}.sign-in-box h4{margin-bottom:1.5rem}.sign-in-box h5{opacity:.8}.sign-in-box .copy-row h4{max-width:34ch}.sign-in-box .copy-row:not(:last-of-type){margin-bottom:1rem}.sign-in-box button{width:auto;margin-top:1rem;padding:.6rem 1.6rem}.sign-in-box p{max-width:35ch;margin-top:.5rem;margin-bottom:1.5rem}.sign-in-box #credentials_section{border-top:1px rgba(var(--text-color),.2) solid;margin-top:1rem;padding-top:1.5rem;animation:slide-down .3s forwards}.sign-in-box #sign_in_with{margin-top:2rem}@keyframes slide-down{from{transform:translateY(-1rem)}to{transform:none}}#loading_page{height:100vh;display:grid;place-content:center;justify-items:center}#loading_page svg{z-index:1;transform-origin:bottom;height:6rem;width:6rem;animation:bounce .5s infinite alternate ease-in}#loading_page .shadow{margin-top:-1rem;width:5rem;height:2rem;background:rgba(var(--text-color),.1);border-radius:50%;animation:scale .5s infinite alternate ease-in;margin-left:1rem}#loading_page h4{margin-top:2rem}@keyframes bounce{0%{transform:scaleY(1) translateY(-4rem)}90%{transform:scaleY(1) translateY(0)}100%{transform:scaleY(.8)}}@keyframes scale{0%{transform:scale(.5)}90%{transform:scale(1.05)}100%{transform:scale(1)}}.initial{justify-content:center;font-size:1.2rem;width:2.5rem;height:2.5rem;color:#fff;box-shadow:0 .1rem .1rem rgba(0,0,0,.06);border-radius:2rem;text-transform:uppercase}#contacts header h4,#mails header h4,#settings_page #settings_title,.sidebar-item{text-transform:capitalize}.contact{display:grid;gap:0 1rem;grid-template-columns:auto 1fr auto;grid-template-areas:"dp . menu" "dp . menu";padding:.8rem 1.5rem;align-items:center}.contact:focus{background:rgba(var(--text-color),.06);outline:0}.contact .initial{grid-area:dp}.contact .name{font-size:1rem;color:rgba(var(--text-color),.8)}.contact .last-message{overflow:hidden;color:rgba(var(--text-color),.9)}.contact .time{font-weight:400;opacity:.8;grid-area:menu;align-self:flex-start}#warn_no_encryption,.date-card{padding:.4rem .8rem;background:rgba(var(--text-color),.1);font-weight:500;border-radius:.5rem;color:rgba(var(--text-color),.8);margin:1rem 0;justify-self:center;align-self:flex-start}.date-card{align-self:center}.contact.unread .initial::before,.mail-card.unread::before{content:"";position:absolute;padding:.3rem;border-radius:1rem;top:0;left:0;background:var(--accent-color)}.mail,.mail-card{position:relative}#contacts header,#mails header,.mail-card{padding:1rem 1.5rem}.contact.unread h4,.contact.unread h5,.contact.unread p,.mail-card.unread h4,.mail-card.unread h5,.mail-card.unread p{font-weight:700}.mail-card{display:flex;flex-direction:column}.mail-card .sender{color:rgba(var(--text-color),.9);font-weight:500;overflow:hidden;margin-right:1rem}.mail-card .date{margin-left:auto;font-weight:500;white-space:nowrap}.mail-card .subject{font-size:1em;margin-top:.5rem;font-weight:500}.mail-card .description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.9em;margin-top:.2rem;color:rgba(var(--text-color),.8)}#chat .message .message-body,.mail .mail-content,.mail .mail-subject{overflow-wrap:break-word;word-wrap:break-word}@keyframes slide{from{opacity:0;transform:translateX(-1rem)}to{opacity:1;transform:none}}#mail_container{width:100%}.mail:not(:first-of-type){margin-top:2rem;padding-inline-start:1rem}.mail:not(:first-of-type)::before{content:"";position:absolute;left:0;top:0;width:.2rem;height:100%;background:rgba(var(--text-color),.2)}.mail header{align-self:start;margin-bottom:1rem;padding-bottom:.5rem;border-bottom:solid 1px rgba(var(--text-color),.2)}.mail header h4{font-weight:500}.mail header .flo-id{font-weight:400;max-width:90%}.mail .mail-subject{margin-bottom:.4em}.mail .mail-content{height:max-content;max-width:60ch;white-space:pre-wrap}.logo-section{display:grid;grid-template-columns:auto 1fr}#main_navbar{position:fixed;flex-direction:column;bottom:0;top:0;padding:0;width:max(18rem,80vw);height:100vh;background:rgba(var(--foreground-color),1)}#chat .sent .message-body,#main_navbar .active{background:var(--accent-color)}#main_navbar .logo-section{margin:1rem 0 1.5rem;padding:0 1rem}#main_navbar .active .icon{stroke:#fff}#main_navbar .active .label{color:#fff}#main_navbar .label{font-size:.9rem}#main_navbar .navbar-item{height:auto;justify-content:flex-start;flex-direction:row;flex:none;padding:1rem 1.2rem}#main_navbar .navbar-item .icon{margin-right:.8rem;height:1.2rem;width:1.2rem}#main_navbar .navbar-item:last-of-type{margin-top:auto}#main_navbar .navbar-item.badge::after{right:0;top:0;position:absolute;content:attr(data-notifications);display:flex;justify-content:center;align-items:center;padding:.4rem;line-height:0;height:calc(1em + .4rem);background:#00C853;color:rgba(var(--foreground-color),1);border-radius:2rem;transition:transform .3s}#contacts #all_contacts,.back{background-color:rgba(var(--foreground-color),1)}#main_navbar .navbar-item.badge.active::after,#main_navbar .navbar-item.badge[data-notifications=""]::after,#main_navbar .navbar-item.badge[data-notifications="0"]::after{transform:scale(0)}#auto_complete_contact{position:relative;justify-content:flex-start;padding-bottom:0}#mail_contact_list{max-height:40vh;overflow-y:auto;position:absolute;top:100%;background:rgba(var(--foreground-color),1);z-index:1;border-radius:.4rem;box-shadow:0 .1rem .1rem rgba(0,0,0,.1),0 .2rem .5rem rgba(0,0,0,.16);width:100%}#mail_contact_list .contact{grid-template-columns:auto 1fr;grid-template-areas:"dp ." "dp ."}#mail_contact_list sm-menu{display:none}#contacts header{position:relative;gap:.5rem}#contacts header sm-input{margin:0;width:100%}#contacts header sm-input .icon{stroke:rgba(var(--text-color),.5);height:.9rem;width:.9rem}#contacts header sm-input::part(input){border-radius:3rem;padding:.5rem 1rem}#contacts #all_contacts{position:absolute;top:0;bottom:0;left:0;right:0;height:100%;width:100%;z-index:1;transition:transform .3s;transform:translateX(-100%)}#selected_contacts{padding:1.5rem;background:rgba(var(--text-color),.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:100vh}#contacts header .grid,#mails header .grid{grid-template-columns:1fr auto;gap:.5rem}#contacts header .grid .icon,#mails header .grid .icon{height:2.2rem;width:2.2rem;padding:.4rem;cursor:pointer}#contacts header sm-button,#mails header sm-button{margin:0 0 0 auto}#contacts header sm-button .icon,#mails header sm-button .icon{height:.9rem;width:.9rem;align-self:center;stroke-width:8;margin-left:0;margin-right:.5rem}#chat_page{overflow-y:hidden}#chat{height:100vh}#chat header{padding:.5rem 1rem}#chat header .back-button{padding:.1rem;stroke-width:8;margin-right:.5rem}#chat header .initial{margin-right:1rem}#chat header h4{font-weight:500;font-size:.9rem}#chat #scroll_to_bottom{position:fixed;right:0;bottom:4rem;width:2.6rem;height:2.6rem;padding:.9rem;border-radius:4rem;z-index:1;margin:1.5rem;stroke-width:8;cursor:pointer;transform:scale(0);transition:transform .3s}#chat footer #toggle_emoji{align-self:center;padding:.6rem;width:2.6rem;height:2.6rem;border-radius:2rem;cursor:pointer}#chat footer #toggle_emoji path{fill:rgba(var(--text-color),.5)}#chat footer #toggle_emoji.active path{fill:var(--accent-color)}#chat footer .flex{align-items:flex-end;padding:1rem 1rem 1rem .4rem}#chat footer sm-textarea::part(textarea){background:rgba(var(--text-color),.1);padding-right:3rem;border-radius:2rem}#chat #send_message_button{position:absolute;right:1.5rem;transform:scale(0);z-index:1;align-self:center;height:2.4rem;width:2.4rem;padding:.5rem;cursor:pointer;stroke:none;fill:rgba(var(--text-color),.4);margin-left:1rem;transition:.3s}#chat #send_message_button.active{fill:var(--accent-color);transform:none}#chat #type_message{margin:0}#chat .message{position:relative;display:grid;grid-auto-flow:column;align-items:center;gap:.5rem;width:100%;font-size:.9rem;max-width:max-content;margin-bottom:.2rem;margin-top:.8rem}#chat .message .message-body{word-break:break-all;word-break:break-word;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;white-space:pre-wrap;box-shadow:0 1px .1rem rgba(0,0,0,.16);padding:.6em 1em;line-height:1.5}#settings_page,sm-tab-panels{overflow:hidden auto}#chat .message .message-body a{color:inherit}#chat .message .time{white-space:nowrap;font-size:.8em;opacity:.8}#chat .sent{margin-left:auto}#chat .sent::after{content:"";position:absolute;left:100%;top:0;width:0;height:0;border-style:solid;border-width:.5em .3em 0 0;border-color:var(--accent-color) transparent transparent}#chat .sent .message-body{color:#f0f0f0;border-radius:1.5em 0 1.5em 1.5em}#chat .sent .time{grid-column:1}#chat .received::after{content:"";position:absolute;left:-.5em;top:0;width:0;height:0;border-style:solid;border-width:0 .5em .5em 0;border-color:transparent rgba(var(--text-color),.1) transparent transparent}#chat .received .message-body{background:rgba(var(--text-color),.1);border-radius:0 1.5em 1.5em}#chat .received+.received,#chat .sent+.sent{margin-top:0}#chat .received+.received::after,#chat .sent+.sent::after{display:none}#chat .received+.received .message-body,#chat .sent+.sent .message-body{border-radius:1.5em}#chat .unconfirmed{opacity:.7;transform-origin:left;animation:slide-up .3s forwards}@keyframes slide-up{from{transform:translate(-2rem,2rem) scale(.8)}to{transform:none}}#chat_container{flex:1;padding:0 1rem}#emoji_picker{display:grid;background:rgba(var(--text-color),.06);border-radius:1rem;margin:0 1rem;grid-template-columns:repeat(auto-fill,minmax(3rem,1fr));box-shadow:0 .2rem .8rem rgba(0,0,0,.3);padding:1rem;overflow-y:auto;flex-wrap:wrap;max-height:min(16rem,30vh)}.emoji{font-size:1.6rem;cursor:pointer;padding:.4rem;border-radius:.6rem;user-select:none;text-align:center}.big-emoji::after{display:none}.big-emoji .message-body{background:0 0!important;box-shadow:none!important;padding:0!important;font-size:2.6rem}#new_conversation,#no_mails{height:100%;justify-content:center;text-align:center;padding:1.5rem}#new_conversation p,#no_mails p{margin-top:.8rem}#no_mails .new-conversation{height:7rem;margin-bottom:1rem}.new-conversation{height:8rem;width:8rem;align-self:center;stroke-width:16;stroke:rgba(var(--text-color),.4)}#chat_container,#contacts_container,#dm_container,#inbox_mail_container,#mail,#sent_mail_container{width:100%;flex-direction:column;height:100%;overflow-y:auto}#dm_container:empty{display:none}#dm_container:not(:empty)~.empty-state{display:none}#dm_container,#inbox_mail_container,#sent_mail_container{padding-bottom:3.5rem}#chat,#mail{background:rgba(var(--foreground-color),1)}#mail{height:100vh;padding:0 1.5rem;align-items:flex-start}#mail .flex{margin-top:1rem}#mail .flex sm-button:first-of-type{margin-right:.5rem}#compose_mail_popup sm-input{margin-bottom:1rem}.sidebar-item{display:flex;align-items:center;padding:1rem 1.5rem;font-weight:500;opacity:.9}.sidebar-item .icon{margin-right:1em;width:1em}.back{padding:.7rem;height:2.4rem;width:2.4rem;margin-left:-.5rem;cursor:pointer;stroke-width:8;opacity:.8;-webkit-tap-highlight-color:transparent}.back:hover{opacity:1}#settings_page{height:100vh}#settings_page .flex sm-button{margin:0;margin-left:1rem}#settings_page sm-switch{padding-left:1rem}#settings_page sm-button{width:100%}#settings_page #settings_sidebar{padding:1rem 0}#settings_page #settings_panel{padding:0 1.5rem}#settings_page section{max-width:50ch;display:grid;gap:.3rem}#settings_page section:not(:last-of-type){margin-bottom:1.5rem}#settings_page section.setting-toggle{grid-template-columns:1fr auto}#settings_page section.setting-toggle sm-switch{grid-column:2;grid-row:1/3}#settings_page section.setting-toggle>h4,#settings_page section.setting-toggle>p{grid-column:1}#settings_page #sign_out::part(button){color:var(--error-color)}@media screen and (max-width:640px){.hide-on-mobile{position:fixed;max-height:0;opacity:0;pointer-events:none}#landing{grid-template-areas:"illustration" ".";height:100%}#sing_in{max-height:90vh}#landing_illustration{grid-area:illustration}#main_navbar{transform:translateX(-100%);transition:transform .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 header{position:sticky;top:0;padding:1.5rem 0;background:rgba(var(--foreground-color),1)}}@media only screen and (min-width:640px){#add_contact_popup::part(popup),sm-popup::part(popup){min-width:24rem}::-webkit-scrollbar{width:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color),.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color),.5)}.hide-on-desktop{display:none!important}.page{padding-bottom:0}.fab{position:absolute}.logo-section{padding:2rem 3rem 0;margin:.5rem 0}#landing{height:calc(100vh - 8rem);align-items:center;gap:4vw;grid-template-columns:1fr 1fr;padding:0 4vw}#landing .left h4{color:var(--accent-color)}#sign_in_popup .popup-header{padding-top:1.5rem}#main_navbar{position:relative;width:auto;background:rgba(var(--text-color),.06);padding-bottom:.5rem}#main_navbar .navbar-item{margin:0 .5rem;border-radius:.5rem}#main_navbar .navbar-item .icon{margin-right:0}#main_navbar .label{display:none}#compose_mail_popup::part(popup),#reply_mail_popup::part(popup){min-width:36rem}#main{width:100vw;height:100vh;grid-template-columns:auto 1fr}#chat .message .message-body{max-width:65ch}#chat_page,#mail_page{grid-template-columns:20rem 1fr;box-shadow:0 0 1rem rgba(0,0,0,.1);z-index:1}#contacts,#mails,#settings_sidebar{height:100vh;background-color:rgba(157,166,255,.063)}#settings_page{display:grid;height:100vh;box-shadow:0 0 1rem rgba(0,0,0,.1);grid-template-columns:14rem 1fr}#settings_page sm-button{width:max-content}#settings_page #settings_panel{padding:1.5rem}#settings_page .active{background:rgba(var(--text-color),.1)}.contact.active,.mail-card.active{background:rgba(var(--text-color),.06)}.card{display:inline-flex;width:auto}#settings_panel{overflow-y:auto;max-height:100vh}}@media only screen and (min-width:1280px){#landing{gap:4vw;padding:0 8vw}#landing .title-font{font-size:3rem}#main_navbar{width:12rem}#main_navbar .navbar-item .icon{margin-right:.8rem}#main_navbar .label{display:block}#chat_page,#mail_page{grid-template-columns:21rem 1fr}#chat header{padding:.5rem 1.5rem}#chat #chat_container{padding:1rem 5rem}}@media (hover:hover){.contact:hover,.mail-card:hover,.navbar-item:hover{background:rgba(var(--text-color),.06);cursor:pointer}.contact sm-menu{opacity:0;transition:opacity .3s}.contact:hover sm-menu,sm-menu:focus-within{opacity:1}.emoji:hover{background:rgba(var(--text-color),.1)}} \ No newline at end of file +#landing_page,.sign-in-box,body,body #scroll_to_bottom{background:rgba(var(--foreground-color),1)}p,textarea{line-height:1.6}*,::after,::before{padding:0;margin:0;box-sizing:border-box;font-family:Roboto,sans-serif}:root{scroll-behavior:smooth;font-size:clamp(16px,1.2vw,48px)}body,html{height:100%}body{--accent-color:#1976D2;--secondary-color:#ffac2e;--text-color:17,17,17;--text-color-light:100,100,100;--foreground-color:255,255,255;--background-color:#efefef;--error-color:red;color:rgba(var(--text-color),1)}body #scroll_to_bottom{box-shadow:0 .3rem .4rem rgba(0,0,0,.2)}body[data-theme=dark]{--secondary-color:#FDB956;--text-color:218,218,218;--text-color-light:170,170,170;--foreground-color:20,20,20}body[data-theme=dark] .initial{color:rgba(var(--text-color),1)!important;box-shadow:0 .1rem .1rem rgba(0,0,0,.16)}body[data-theme=dark] .message,h1,h2,h3,h4,h5,textarea{color:rgba(var(--text-color),1)}body[data-theme=dark] #scroll_to_bottom{background:linear-gradient(rgba(var(--text-color),.1),rgba(var(--text-color),.1)),rgba(var(--foreground-color),1);box-shadow:0 .4rem .4rem rgba(0,0,0,.3)}h1{font-size:3rem}h2{font-size:2rem}h3{font-size:1.5rem}h4{font-size:1.1rem}h5{font-size:.8rem}h1,h2,h3,h4,h5{font-weight:600}textarea{background:rgba(var(--text-color),.06);border:none;border-radius:.3rem;width:100%;padding:1rem;font-size:1rem;resize:none}textarea:focus{outline:0;box-shadow:0 0 0 .1rem var(--accent-color)}.flex{display:flex}.grid{display:grid}.grid-2{grid-template-columns:auto auto;gap:1em}.align-center{align-items:center}.justify-right{margin-left:auto}.direction-column{flex-direction:column}.rest{flex:1}.hide{opacity:0;pointer-events:none}.hide-completely{display:none!important}.no-transformations{transform:none!important}.breakable{overflow-wrap:break-word}.text-overflow{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sticky{position:sticky;top:1rem}.light-text{color:rgba(var(--text-color-light),1)}.accent-color{color:var(--accent-color)}.secondary-color{color:var(--secondary-color)}.fab{filter:drop-shadow(0 .4rem .3rem rgba(0, 0, 0, .2));margin-right:1rem;position:fixed;right:0;bottom:0;z-index:1}.fab .icon{margin-left:0!important;margin-right:.5rem;height:.9rem!important;stroke-width:8!important}a:any-link{word-wrap:break-word;color:var(--accent-color);font-weight:500}.solid-background{background:var(--background-color)!important}.normal-weight{font-weight:400}.icon{fill:none;stroke-width:6;stroke:rgba(var(--text-color),1);height:1.2rem;width:1.2rem;overflow:visible;stroke-linecap:round;stroke-linejoin:round}span.ripple{position:absolute;border-radius:50%;transform:scale(0);background:rgba(var(--text-color),.2);pointer-events:none}#landing_illustration,.contact,.initial,.interact,.logo-section{position:relative}.interact{overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:transparent}sm-popup sm-input+sm-input{margin-top:1rem}.popup-header{padding:.5rem 1.5rem 0;display:flex;align-items:center;width:100%}.popup-header .icon{padding:.7rem;height:2.4rem;width:2.4rem;stroke-width:8;transform:translateX(-.5rem);cursor:pointer;-webkit-tap-highlight-color:transparent}.popup-header .back{transform:none}.popup-header button,.popup-header sm-button{width:auto;margin-left:auto}.copy-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:auto}.copy-row .icon{cursor:pointer;padding:.4rem;height:1.8rem;width:1.8rem}.copy-row .copy{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.copy-row h4{margin-bottom:0!important}#confirmation_popup,#prompt_popup{flex-direction:column}#confirmation_popup h4,#prompt_popup h4{font-weight:500;margin-bottom:.5rem}#confirmation_popup sm-button,#prompt_popup sm-button{margin:0}#confirmation_popup .flex,#prompt_popup .flex{padding:0;margin-top:2rem}#confirmation_popup .flex sm-button:first-of-type,#prompt_popup .flex sm-button:first-of-type{margin-right:.6rem;margin-left:auto}.card,sm-button{margin:1rem 0}.page{align-items:flex-start;width:100%;height:100%}.card{display:flex;flex-direction:column}sm-button .icon{margin-right:.4rem}sm-button[variant=primary]{--foreground-color:255,255,255}sm-button[variant=primary] .icon{align-self:center;height:1rem;width:1rem;margin-left:.8rem;stroke-width:6;stroke:#fff}.logo-section{align-items:center;height:max-content;margin:.5rem 0}.logo-section h5{font-size:1.1rem!important;font-weight:500}.logo-section .main-logo{height:1.4rem;margin-right:.4rem;fill:rgba(var(--text-color),.8);stroke:none}.select-file input[type=file]{display:none}#landing{display:grid;border-radius:.6rem;width:100%;padding:0 1.5rem;height:100%;align-items:center}#landing .logo-section{padding:1.5rem;display:flex}#landing .title-font{line-height:1.2;font-weight:700;font-size:2.5rem}#landing .left h3,#landing .left h4,#landing .left p,.contact .last-message,.contact .name,.sign-in-box h3,.sign-in-box h4,.sign-in-box h5{font-weight:500}#landing .left{display:grid;flex-direction:column;padding-bottom:1.5rem;z-index:1}#landing .left h4{color:rgba(var(--foreground-color),1)}#landing .left sm-button{margin:1.5rem 0 2rem;width:max-content}#landing .left h3{margin-bottom:1rem}.logo-section{padding:1.5rem}#landing_illustration{width:100%}#sign_in_popup::part(popup-body){padding:0}.sign-in-box{width:100%;margin:0 -2rem;z-index:1;justify-self:center;padding:1.5rem;border-radius:.5rem}.sign-in-box sm-input{text-align:left}.sign-in-box sm-panel{width:100%}.sign-in-box sm-tab-header{margin:0;background:0 0;align-self:flex-start}.sign-in-box sm-tab-header::part(tab-header){padding-bottom:.4rem;gap:1.5rem}.sign-in-box sm-tab::part(tab){padding:.4rem 0}.sign-in-box sm-tab-panels{margin-top:1.5rem}.sign-in-box form{width:100%}.sign-in-box h2{margin-bottom:.5rem}.sign-in-box h4{margin-bottom:1.5rem}.sign-in-box h5{opacity:.8}.sign-in-box .copy-row h4{max-width:34ch}.sign-in-box .copy-row:not(:last-of-type){margin-bottom:1rem}.sign-in-box button{width:auto;margin-top:1rem;padding:.6rem 1.6rem}.sign-in-box p{max-width:35ch;margin-top:.5rem;margin-bottom:1.5rem}.sign-in-box #credentials_section{border-top:1px rgba(var(--text-color),.2) solid;margin-top:1rem;padding-top:1.5rem;animation:slide-down .3s forwards}.sign-in-box #sign_in_with{margin-top:2rem}@keyframes slide-down{from{transform:translateY(-1rem)}to{transform:none}}#loading_page{height:100vh;display:grid;place-content:center;justify-items:center}#loading_page svg{z-index:1;transform-origin:bottom;height:6rem;width:6rem;animation:bounce .5s infinite alternate ease-in}#loading_page .shadow{margin-top:-1rem;width:5rem;height:2rem;background:rgba(var(--text-color),.1);border-radius:50%;animation:scale .5s infinite alternate ease-in;margin-left:1rem}#loading_page h4{margin-top:2rem}@keyframes bounce{0%{transform:scaleY(1) translateY(-4rem)}90%{transform:scaleY(1) translateY(0)}100%{transform:scaleY(.8)}}@keyframes scale{0%{transform:scale(.5)}90%{transform:scale(1.05)}100%{transform:scale(1)}}.initial{justify-content:center;font-size:1.2rem;width:2.5rem;height:2.5rem;color:#fff;box-shadow:0 .1rem .1rem rgba(0,0,0,.06);border-radius:2rem;text-transform:uppercase}.contact{display:grid;gap:0 1rem;padding:.8rem 1.5rem;align-items:center}.contact.chat{grid-template-columns:auto 1fr auto;grid-template-areas:"dp . menu" "dp . ."}.contact:not(.chat){grid-template-columns:auto 1fr;grid-template-areas:"dp ."}.contact:focus{background:rgba(var(--text-color),.06);outline:0}.contact .initial{grid-area:dp}.contact .name{font-size:1rem;color:rgba(var(--text-color),.8)}.contact .last-message{grid-column:2/4;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:rgba(var(--text-color),.9)}.contact .time{font-weight:400;opacity:.8;grid-area:menu;align-self:flex-start}#warn_no_encryption,.date-card{padding:.4rem .8rem;background:rgba(var(--text-color),.1);font-weight:500;border-radius:.5rem;color:rgba(var(--text-color),.8);margin:1rem 0;justify-self:center;align-self:flex-start}.date-card{align-self:center}.contact.unread .initial::before,.mail-card.unread::before{content:"";position:absolute;padding:.4rem;border-radius:1rem;top:0;left:0;background:var(--accent-color)}.mail,.mail-card{position:relative}#contacts header,#mails header,.mail-card{padding:1rem 1.5rem}.contact.unread h4,.contact.unread h5,.contact.unread p,.mail-card.unread h4,.mail-card.unread h5,.mail-card.unread p{font-weight:700}.mail-card{display:flex;flex-direction:column}.mail-card .sender{color:rgba(var(--text-color),.9);font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:1rem}.mail-card .date{margin-left:auto;font-weight:500;white-space:nowrap}.mail-card .subject{font-size:1em;margin-top:.5rem;font-weight:500}.mail-card .description{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:.9em;margin-top:.2rem;color:rgba(var(--text-color),.8)}#chat .message .message-body,.mail .mail-content,.mail .mail-subject{overflow-wrap:break-word;word-wrap:break-word}@keyframes slide{from{opacity:0;transform:translateX(-1rem)}to{opacity:1;transform:none}}#mail_container{width:100%}.mail:not(:first-of-type){margin-top:2rem;padding-inline-start:1rem}.mail:not(:first-of-type)::before{content:"";position:absolute;left:0;top:0;width:.2rem;height:100%;background:rgba(var(--text-color),.2)}.mail header{align-self:start;margin-bottom:1rem;padding-bottom:.5rem;border-bottom:solid 1px rgba(var(--text-color),.2)}.mail header h4{font-weight:500}.mail header .flo-id{font-weight:400;max-width:90%}.mail .mail-subject{margin-bottom:.4em}.mail .mail-content{height:max-content;max-width:60ch;white-space:pre-wrap}.logo-section{display:grid;grid-template-columns:auto 1fr}#main_navbar{position:fixed;flex-direction:column;bottom:0;top:0;padding:0;width:max(18rem,80vw);height:100vh;background:rgba(var(--foreground-color),1)}#chat .sent .message-body,#main_navbar .active{background:var(--accent-color)}#main_navbar .logo-section{margin:1rem 0 1.5rem;padding:0 1rem}#main_navbar .active .icon{stroke:#fff}#main_navbar .active .label{color:#fff}#main_navbar .label{font-size:.9rem}#main_navbar .navbar-item{height:auto;justify-content:flex-start;flex-direction:row;flex:none;padding:1rem 1.2rem}#main_navbar .navbar-item .icon{margin-right:.8rem;height:1.2rem;width:1.2rem}#main_navbar .navbar-item:last-of-type{margin-top:auto}#main_navbar .navbar-item.badge::after{right:0;top:0;position:absolute;content:attr(data-notifications);display:flex;justify-content:center;align-items:center;padding:.4rem;line-height:0;height:calc(1em + .4rem);background:#00C853;color:rgba(var(--foreground-color),1);border-radius:2rem;transition:transform .3s}#contacts #all_contacts,.back{background-color:rgba(var(--foreground-color),1)}#main_navbar .navbar-item.badge.active::after,#main_navbar .navbar-item.badge[data-notifications=""]::after,#main_navbar .navbar-item.badge[data-notifications="0"]::after{transform:scale(0)}#auto_complete_contact{position:relative;justify-content:flex-start;padding-bottom:0}#mail_contact_list{max-height:40vh;overflow-y:auto;position:absolute;top:100%;background:rgba(var(--foreground-color),1);z-index:1;border-radius:.4rem;box-shadow:0 .1rem .1rem rgba(0,0,0,.1),0 .2rem .5rem rgba(0,0,0,.16);width:100%}#mail_contact_list .contact{grid-template-columns:auto 1fr;grid-template-areas:"dp ." "dp ."}#mail_contact_list sm-menu{display:none}#contacts header{position:relative;gap:.5rem}#contacts header sm-input{margin:0;width:100%}#contacts header sm-input .icon{stroke:rgba(var(--text-color),.5);height:.9rem;width:.9rem}#contacts header sm-input::part(input){border-radius:3rem;padding:.5rem 1rem}#contacts #all_contacts{position:absolute;top:0;bottom:0;left:0;right:0;height:100%;width:100%;z-index:1;transition:transform .3s;transform:translateX(-100%)}#selected_contacts{padding:1.5rem;background:rgba(var(--text-color),.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:100vh}#contacts header h4,#mails header h4{text-transform:capitalize}#contacts header .grid,#mails header .grid{grid-template-columns:1fr auto;gap:.5rem}#contacts header .grid .icon,#mails header .grid .icon{height:2.2rem;width:2.2rem;padding:.4rem;cursor:pointer}#contacts header sm-button,#mails header sm-button{margin:0 0 0 auto}#contacts header sm-button .icon,#mails header sm-button .icon{height:.9rem;width:.9rem;align-self:center;stroke-width:8;margin-left:0;margin-right:.5rem}#chat_page{overflow-y:hidden}#chat{height:100vh}#chat header{padding:.5rem 1rem}#chat header .back-button{padding:.1rem;stroke-width:8;margin-right:.5rem}#chat header .initial{margin-right:1rem}#chat header h4{font-weight:500;font-size:.9rem}#chat #scroll_to_bottom{position:fixed;right:0;bottom:4rem;width:2.6rem;height:2.6rem;padding:.9rem;border-radius:4rem;z-index:1;margin:1.5rem;stroke-width:8;cursor:pointer;transform:scale(0);transition:transform .3s}#chat footer #toggle_emoji{align-self:center;padding:.6rem;width:2.6rem;height:2.6rem;border-radius:2rem;cursor:pointer}#chat footer #toggle_emoji path{fill:rgba(var(--text-color),.5)}#chat footer #toggle_emoji.active path{fill:var(--accent-color)}#chat footer .flex{align-items:flex-end;padding:1rem 1rem 1rem .4rem}#chat footer sm-textarea::part(textarea){background:rgba(var(--text-color),.1);padding-right:3rem;border-radius:2rem}#chat #send_message_button{position:absolute;right:1.5rem;transform:scale(0);z-index:1;align-self:center;height:2.4rem;width:2.4rem;padding:.5rem;cursor:pointer;stroke:none;fill:rgba(var(--text-color),.4);margin-left:1rem;transition:.3s}#chat #send_message_button.active{fill:var(--accent-color);transform:none}#chat #type_message{margin:0}#chat .message{position:relative;display:grid;grid-auto-flow:column;align-items:center;gap:.5rem;width:100%;font-size:.9rem;max-width:max-content;margin-bottom:.2rem;margin-top:.8rem}#chat .message .message-body{display:inline-flex;align-items:center;flex-wrap:wrap;word-break:break-all;word-break:break-word;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto;white-space:pre-wrap;box-shadow:0 1px .1rem rgba(0,0,0,.16);padding:.6em 1em;line-height:1.5}#settings_page,sm-tab-panels{overflow:hidden auto}#chat .message .message-body a{color:inherit}#chat .message .message-body .text-emoji{align-self:center;font-size:1.4em;letter-spacing:0ch}#chat .message .time{white-space:nowrap;font-size:.8em;opacity:.8}#chat .sent{margin-left:auto}#chat .sent::after{content:"";position:absolute;left:100%;top:0;width:0;height:0;border-style:solid;border-width:.5em .3em 0 0;border-color:var(--accent-color) transparent transparent}#chat .sent .message-body{color:#f0f0f0;border-radius:1.5em 0 1.5em 1.5em}#chat .sent .time{grid-column:1}#chat .received::after{content:"";position:absolute;left:-.5em;top:0;width:0;height:0;border-style:solid;border-width:0 .5em .5em 0;border-color:transparent rgba(var(--text-color),.1) transparent transparent}#chat .received .message-body{background:rgba(var(--text-color),.1);border-radius:0 1.5em 1.5em}#chat .received+.received,#chat .sent+.sent{margin-top:0}#chat .received+.received::after,#chat .sent+.sent::after{display:none}#chat .received+.received .message-body,#chat .sent+.sent .message-body{border-radius:1.5em}#chat .unconfirmed{opacity:.7;transform-origin:right;animation:slide-up .3s forwards}@keyframes slide-up{from{transform:translateY(-2rem)}to{transform:none}}.big-emoji::after{display:none}.big-emoji .message-body{background:0 0!important;box-shadow:none!important;padding:0!important;font-size:2.6rem}#chat_container{flex:1;padding:0 1rem}#emoji_picker{display:grid;gap:1rem;background:rgba(var(--text-color),.06);border-radius:1rem;margin:0 1rem;box-shadow:0 .2rem .8rem rgba(0,0,0,.3);overflow-y:auto;max-height:30vh}#emoji_picker section{display:flex;flex-wrap:wrap;padding:1rem}#emoji_picker .section-header{position:sticky;top:0;background:linear-gradient(rgba(var(--text-color),.06),rgba(var(--text-color),.06)),rgba(var(--foreground-color),1);padding:1rem 0;width:100%;z-index:1}.emoji{font-size:1.6rem;cursor:pointer;padding:.4rem;border-radius:.6rem;user-select:none;text-align:center;min-width:3rem}#new_conversation,#no_mails{height:100%;justify-content:center;text-align:center;padding:1.5rem}#new_conversation p,#no_mails p{margin-top:.8rem}#no_mails .new-conversation{height:7rem;margin-bottom:1rem}.new-conversation{height:8rem;width:8rem;align-self:center;stroke-width:16;stroke:rgba(var(--text-color),.4)}#chat_container,#contacts_container,#dm_container,#inbox_mail_container,#mail,#sent_mail_container{width:100%;flex-direction:column;height:100%;overflow-y:auto}#dm_container:empty{display:none}#dm_container:not(:empty)~.empty-state{display:none}#dm_container,#inbox_mail_container,#sent_mail_container{padding-bottom:3.5rem}#chat,#mail{background:rgba(var(--foreground-color),1)}#mail{height:100vh;padding:0 1.5rem;align-items:flex-start}#mail .flex{margin-top:1rem}#mail .flex sm-button:first-of-type{margin-right:.5rem}#compose_mail_popup sm-input{margin-bottom:1rem}.sidebar-item{display:flex;align-items:center;padding:1rem 1.5rem;text-transform:capitalize;font-weight:500;opacity:.9}.sidebar-item .icon{margin-right:1em;width:1em}.back{padding:.7rem;height:2.4rem;width:2.4rem;margin-left:-.5rem;cursor:pointer;stroke-width:8;opacity:.8;-webkit-tap-highlight-color:transparent}.back:hover{opacity:1}#settings_page{height:100vh}#settings_page .flex sm-button{margin:0;margin-left:1rem}#settings_page sm-switch{padding-left:1rem}#settings_page sm-button{width:100%}#settings_page #settings_title{text-transform:capitalize}#settings_page #settings_sidebar{padding:1rem 0}#settings_page #settings_panel{padding:0 1.5rem}#settings_page section{max-width:50ch;display:grid;gap:.3rem}#settings_page section:not(:last-of-type){margin-bottom:1.5rem}#settings_page section.setting-toggle{grid-template-columns:1fr auto}#settings_page section.setting-toggle sm-switch{grid-column:2;grid-row:1/3}#settings_page section.setting-toggle>h4,#settings_page section.setting-toggle>p{grid-column:1}#settings_page #sign_out::part(button){color:var(--error-color)}@media screen and (max-width:640px){.hide-on-mobile{position:fixed;max-height:0;opacity:0;pointer-events:none}#landing{grid-template-areas:"illustration" ".";height:100%}#sing_in{max-height:90vh}#landing_illustration{grid-area:illustration}#main_navbar{transform:translateX(-100%);transition:transform .3s;z-index:4}#contact_container,#dm_container{gap:.5rem}#chat header{padding:1rem}#chat header .initial{width:2rem;height:2rem}#chat .message{width:fit-content;max-width:90%}#settings_page header{position:sticky;top:0;padding:1.5rem 0;background:rgba(var(--foreground-color),1)}}@media only screen and (min-width:640px){#add_contact_popup::part(popup),sm-popup::part(popup){min-width:24rem}::-webkit-scrollbar{width:.5rem}::-webkit-scrollbar-thumb{background:rgba(var(--text-color),.3);border-radius:1rem}::-webkit-scrollbar-thumb:hover{background:rgba(var(--text-color),.5)}.hide-on-desktop{display:none!important}.page{padding-bottom:0}.fab{position:absolute}.logo-section{padding:2rem 3rem 0;margin:.5rem 0}#landing{height:calc(100vh - 8rem);align-items:center;gap:4vw;grid-template-columns:1fr 1fr;padding:0 4vw}#landing .left h4{color:var(--accent-color)}#sign_in_popup .popup-header{padding-top:1.5rem}#main_navbar{position:relative;width:auto;background:rgba(var(--text-color),.05);padding-bottom:.5rem}#main_navbar .navbar-item{margin:0 .5rem;border-radius:.5rem}#main_navbar .navbar-item .icon{margin-right:0}#main_navbar .label{display:none}#compose_mail_popup::part(popup),#reply_mail_popup::part(popup){min-width:36rem}#main{width:100vw;height:100vh;grid-template-columns:auto 1fr}#emoji_picker{max-height:18rem}#chat .message .message-body{max-width:65ch}#chat_page,#mail_page{grid-template-columns:20rem 1fr;box-shadow:0 0 1rem rgba(0,0,0,.1);z-index:1}#contacts,#mails,#settings_sidebar{height:100vh;background-color:rgba(157,166,255,.063)}#settings_page{display:grid;height:100vh;box-shadow:0 0 1rem rgba(0,0,0,.1);grid-template-columns:14rem 1fr}#settings_page sm-button{width:max-content}#settings_page #settings_panel{padding:1.5rem}#settings_page .active{background:rgba(var(--text-color),.1)}.contact.active,.mail-card.active{background:rgba(var(--text-color),.06)}.card{display:inline-flex;width:auto}#settings_panel{overflow-y:auto;max-height:100vh}}@media only screen and (min-width:1280px){#landing{gap:4vw;padding:0 8vw}#landing .title-font{font-size:3rem}#main_navbar{width:12rem}#main_navbar .navbar-item .icon{margin-right:.8rem}#main_navbar .label{display:block}#chat_page,#mail_page{grid-template-columns:21rem 1fr}#chat header{padding:.5rem 1.5rem}#chat #chat_container{padding:1rem 5rem}}@media (hover:hover){.contact:hover,.mail-card:hover,.navbar-item:hover{background:rgba(var(--text-color),.06);cursor:pointer}.contact sm-menu{opacity:0;transition:opacity .3s}.contact:hover sm-menu,sm-menu:focus-within{opacity:1}.emoji:hover{background:rgba(var(--text-color),.1)}} \ No newline at end of file diff --git a/css/main.scss b/css/main.scss index 6d5c1f6..d8e1545 100644 --- a/css/main.scss +++ b/css/main.scss @@ -498,11 +498,17 @@ sm-button[variant="primary"]{ position: relative; display: grid; gap: 0 1rem; - grid-template-columns: auto 1fr auto; - grid-template-areas: 'dp . menu' - 'dp . menu'; padding: 0.8rem 1.5rem; align-items: center; + &.chat{ + grid-template-columns: auto 1fr auto; + grid-template-areas: 'dp . menu' + 'dp . .'; + } + &:not(.chat){ + grid-template-columns: auto 1fr; + grid-template-areas: 'dp .'; + } &:focus{ background: rgba(var(--text-color), 0.06); outline: none; @@ -516,6 +522,7 @@ sm-button[variant="primary"]{ color: rgba(var(--text-color), 0.8); } .last-message{ + grid-column: 2/4; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; @@ -546,7 +553,7 @@ sm-button[variant="primary"]{ .contact.unread .initial::before{ content: ''; position: absolute; - padding: 0.3rem; + padding: 0.4rem; border-radius: 1rem; top: 0; left: 0; @@ -911,6 +918,9 @@ sm-button[variant="primary"]{ margin-bottom: 0.2rem; margin-top: 0.8rem; .message-body{ + display: inline-flex; + align-items: center; + flex-wrap: wrap; overflow-wrap: break-word; word-wrap: break-word; word-break: break-all; @@ -925,6 +935,11 @@ sm-button[variant="primary"]{ a{ color: inherit; } + .text-emoji{ + align-self: center; + font-size: 1.4em; + letter-spacing: 0ch; + } } .time{ white-space: nowrap; @@ -985,42 +1000,18 @@ sm-button[variant="primary"]{ } .unconfirmed{ opacity: 0.7; - transform-origin: left; + transform-origin: right; animation: slide-up 0.3s forwards; } } @keyframes slide-up{ from{ - transform: translate(-2rem, 2rem) scale(0.8); + transform: translateY(-2rem); } to{ transform: none; } } -#chat_container{ - flex: 1; - padding: 0 1rem; -} -#emoji_picker{ - display: grid; - background: rgba(var(--text-color), 0.06); - border-radius: 1rem; - margin: 0 1rem; - grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr)); - box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.3); - padding: 1rem; - overflow-y: auto; - flex-wrap: wrap; - max-height: min(16rem, 30vh); -} -.emoji{ - font-size: 1.6rem; - cursor: pointer; - padding: 0.4rem; - border-radius: 0.6rem; - user-select: none; - text-align: center; -} .big-emoji{ &::after{ display: none; @@ -1032,6 +1023,42 @@ sm-button[variant="primary"]{ font-size: 2.6rem; } } +#chat_container{ + flex: 1; + padding: 0 1rem; +} +#emoji_picker{ + display: grid; + gap: 1rem; + background: rgba(var(--text-color), 0.06); + border-radius: 1rem; + margin: 0 1rem; + box-shadow: 0 0.2rem 0.8rem rgba(0, 0, 0, 0.3); + overflow-y: auto; + max-height: 30vh; + section{ + display: flex; + flex-wrap: wrap; + padding: 1rem; + } + .section-header{ + position: sticky; + top: 0; + background: linear-gradient(rgba(var(--text-color), 0.06), rgba(var(--text-color), 0.06)), rgba(var(--foreground-color), 1); + padding: 1rem 0; + width: 100%; + z-index: 1; + } +} +.emoji{ + font-size: 1.6rem; + cursor: pointer; + padding: 0.4rem; + border-radius: 0.6rem; + user-select: none; + text-align: center; + min-width: 3rem; +} #new_conversation, #no_mails{ height: 100%; justify-content: center; @@ -1194,6 +1221,10 @@ sm-tab-panels{ transition: transform 0.3s; z-index: 4; } + #dm_container, + #contact_container{ + gap: 0.5rem; + } #chat{ header{ padding: 1rem; @@ -1264,7 +1295,7 @@ sm-tab-panels{ #main_navbar{ position: relative; width: auto; - background: rgba(var(--text-color), 0.06); + background: rgba(var(--text-color), 0.05); padding-bottom: 0.5rem; .navbar-item{ margin: 0 0.5rem; @@ -1289,6 +1320,9 @@ sm-tab-panels{ height: 100vh; grid-template-columns: auto 1fr; } + #emoji_picker{ + max-height: 18rem; + } #chat{ .message{ .message-body{ diff --git a/index.html b/index.html index 56834e6..b729fda 100644 --- a/index.html +++ b/index.html @@ -107,7 +107,7 @@ Copy - + Sign in with this private key @@ -245,8 +245,6 @@

-
-
@@ -1133,12 +1131,6 @@ cardContainer.setAttribute("name", name || 'Unknown') cardContainer.setAttribute("flo-id", floID) cardContainer.querySelector('.name').textContent = name || 'Unknown' - messenger.getChat(floID).then(chat => { - const lastMessage = Object.values(chat).pop() - console.log(chat, lastMessage) - cardContainer.querySelector('.last-message').textContent = lastMessage.message - cardContainer.querySelector('.time').textContent = getFormatedTime(lastMessage.time, true) - }) let initial = card.querySelector('.initial') initial.textContent = name ? name.charAt(0) : 'U' let color = randomColor() @@ -1152,19 +1144,20 @@ getRef('mail_contact_list').append(duplicateCard); } else{ + + messenger.getChat(floID).then(chat => { + const lastMessage = Object.values(chat).pop() + cardContainer.innerHTML += ` +
${lastMessage.message}
+
${getFormatedTime(lastMessage.time, true)}
` + }) cardContainer.classList.add('chat') getRef('dm_container').append(card); } }, messageBubble(floID, message, timestamp, category, unconfirmed = false){ let card = getRef('message_template').content.cloneNode(true), - cardContainer = card.querySelector('.message'), - time = new Date(timestamp).toString(), - minutes = String(new Date(timestamp).getMinutes()), - hours = new Date(timestamp).getHours(), - year = new Date(timestamp).getFullYear() - minutes = minutes.length === 1 ? `0${minutes}` : minutes - let finalHours = hours - 12 > 0 ? `${hours - 12}:${minutes} pm` : `${hours}:${minutes} am` + cardContainer = card.querySelector('.message') cardContainer.id = `${floID}_${timestamp}` if(unconfirmed) @@ -1179,29 +1172,42 @@ cardContainer.children[0].append(anchorTag) } else{ - if(message.length === 2 && isEmoji(message)) + let [messageBody, isOnlyEmoji] = isEmoji(message) + if(isOnlyEmoji) cardContainer.classList.add('big-emoji') - cardContainer.children[0].textContent = message + cardContainer.children[0].append(messageBody) } + + let time = new Date(timestamp).toString(), + minutes = String(new Date(timestamp).getMinutes()), + hours = new Date(timestamp).getHours(), + year = new Date(timestamp).getFullYear() + minutes = minutes.length === 1 ? `0${minutes}` : minutes + let finalHours = hours - 12 > 0 ? `${hours - 12}:${minutes} pm` : `${hours}:${minutes} am` + cardContainer.children[1].textContent = finalHours + if(currentFloID !== floID){ currentDate = null currentFloID = floID + renderedDates.clear() } - if(`${time.slice(4, 10)} ${year}` !== currentDate){ + + if(!renderedDates.has(`${time.slice(4, 10)} ${year}`) && `${time.slice(4, 10)} ${year}` !== currentDate){ let dateCard = document.createElement('h5') dateCard.classList.add('date-card') dateCard.textContent = new Date().getFullYear() !== year ? `${time.slice(4, 10)} ${year}` : time.slice(4, 10) currentDate = `${time.slice(4, 10)} ${year}` let frag = document.createDocumentFragment() frag.append(dateCard, card) + renderedDates.set(currentDate, currentDate) return frag } else return card; }, } - let currentDate, currentFloID + let currentDate, currentFloID, renderedDates = new Map() const isValidUrl = (url) => { try { @@ -1213,21 +1219,34 @@ }; const isEmoji = (txt) => { - if(/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/.test(txt)) - return true - else - return false + const rx = /([\uD800-\uDBFF][\uDC00-\uDFFF](?:[\u200D\uFE0F][\uD800-\uDBFF][\uDC00-\uDFFF]){2,}|\uD83D\uDC69(?:\u200D(?:(?:\uD83D\uDC69\u200D)?\uD83D\uDC67|(?:\uD83D\uDC69\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D(?:\uD83D\uDC69\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]\uFE0F|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC6F\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3C-\uDD3E\uDDD6-\uDDDF])\u200D[\u2640\u2642]\uFE0F|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F\u200D[\u2640\u2642]|(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642])\uFE0F|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\uD83D\uDC69\u200D[\u2695\u2696\u2708]|\uD83D\uDC68(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708]))\uFE0F|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83D\uDC69\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|\uD83D\uDC68(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66\u200D\uD83D\uDC66|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92])|(?:\uD83C[\uDFFB-\uDFFF])\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]))|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDD1-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\u200D(?:(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC67|(?:(?:\uD83D[\uDC68\uDC69])\u200D)?\uD83D\uDC66)|\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F)/; + const res = txt.split(rx).filter(Boolean); + const messageBody = document.createDocumentFragment() + const length = res.length + let isOnlyEmoji = false + res.forEach(section => { + if(section.match(rx)){ + const span = document.createElement('span') + if(length === 1) + isOnlyEmoji = true + else + span.classList.add('text-emoji') + span.textContent = section + messageBody.append(span) + } + else + messageBody.append(section) + }) + return [messageBody, isOnlyEmoji] } function renderDirectUI(data) { - console.log(data) 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) - notify(`${Object.keys(data.messages).length} new message(s)`) - } + if(Object.keys(data.messages).length){ + document.title = `New message(s)` + } if(Object.keys(data.mails).length && activePage.button !== getRef('mail_page_button')){ getRef('mail_page_button').setAttribute('data-notifications', Object.keys(data.mails).length) notify(`${Object.keys(data.mails).length} new mail(s)`) @@ -1239,7 +1258,10 @@ } window.addEventListener('focus', e => { - console.log('focused') + if(activeChat.chatCard && activeChat.chatCard.classList.contains('active')) + setTimeout(() => { + activeChat.chatCard.classList.remove('unread') + }, 2000) }) window.addEventListener('blur', e => { console.log('blured') @@ -1386,7 +1408,8 @@ //Detect emoji clicks if(e.target.closest('.emoji')){ getRef('type_message').value += e.target.closest('.emoji').textContent - getRef('type_message').focusIn() + if(window.innerWidth > 640) + getRef('type_message').focusIn() } }) @@ -1404,10 +1427,10 @@ // code for adding group members } else{ - 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') + if(activeChat['chatCard'] === contact && window.innerWidth > 640) return + document.title = `FLO Messenger` + getRef('chat').classList.remove('hide-completely') viewConversation(contact) if(activeChat['chatCard']) activeChat['chatCard'].classList.remove('active') @@ -1423,18 +1446,67 @@ } }) - const emojis = ["๐Ÿ˜€", "๐Ÿ˜ƒ", "๐Ÿ˜„", "๐Ÿ˜", "๐Ÿ˜†", "๐Ÿ˜…", "๐Ÿ˜‚", "๐Ÿคฃ", "๐Ÿ˜Š", "๐Ÿ˜‡", "๐Ÿ™‚", "๐Ÿ™ƒ", "๐Ÿ˜‰", "๐Ÿ˜Œ", "๐Ÿ˜", "๐Ÿฅฐ", "๐Ÿ˜˜", "๐Ÿ˜—","๐Ÿ˜™", "๐Ÿ˜š", "๐Ÿ˜‹", "๐Ÿ˜›", "๐Ÿ˜", "๐Ÿ˜œ", "๐Ÿคช", "๐Ÿคจ", "๐Ÿง", - "๐Ÿค“", "๐Ÿ˜Ž", "๐Ÿคฉ", "๐Ÿฅณ", "๐Ÿ˜", "๐Ÿ˜’", "๐Ÿ˜ž", "๐Ÿ˜”", "๐Ÿ˜Ÿ", "๐Ÿ˜•", "๐Ÿ™", "โ˜น๏ธ", "๐Ÿ˜ฃ", "๐Ÿ˜–", "๐Ÿ˜ซ", "๐Ÿ˜ฉ", "๐Ÿฅบ", "๐Ÿ˜ข", "๐Ÿ˜ญ", "๐Ÿ˜ค", "๐Ÿ˜ ", "๐Ÿ˜ก", "๐Ÿคฌ", "๐Ÿคฏ", "๐Ÿ˜ณ", "๐Ÿฅต", "๐Ÿฅถ", - "๐Ÿ˜ฑ", "๐Ÿ˜จ", "๐Ÿ˜ฐ", "๐Ÿ˜ฅ", "๐Ÿ˜“", "๐Ÿค—", "๐Ÿค”", "๐Ÿคญ", "๐Ÿคซ", "๐Ÿคฅ", "๐Ÿ˜ถ", "๐Ÿ˜", "๐Ÿ˜‘", "๐Ÿ˜ฌ", "๐Ÿ™„", "๐Ÿ˜ฏ", "๐Ÿ˜ฆ", "๐Ÿ˜ง", "๐Ÿ˜ฎ", "๐Ÿ˜ฒ", "๐Ÿฅฑ", "๐Ÿ˜ด", "๐Ÿคค", "๐Ÿ˜ช", "๐Ÿ˜ต", "๐Ÿค", "๐Ÿฅด", - "๐Ÿคข", "๐Ÿคฎ", "๐Ÿคง", "๐Ÿ˜ท", "๐Ÿค’", "๐Ÿค•", "๐Ÿค‘", "๐Ÿค ", "๐Ÿ˜ˆ", "๐Ÿ‘ฟ", "๐Ÿ‘น", "๐Ÿ‘บ", "๐Ÿคก", "๐Ÿ’ฉ", "๐Ÿ‘ป", "๐Ÿ’€", "โ˜ ๏ธ", "๐Ÿ‘ฝ", "๐Ÿ‘พ", "๐Ÿค–", "๐ŸŽƒ", "๐Ÿ˜บ", "๐Ÿ˜ธ", "๐Ÿ˜น", "๐Ÿ˜ป", "๐Ÿ˜ผ", "๐Ÿ˜ฝ", - "๐Ÿ™€", "๐Ÿ˜ฟ", "๐Ÿ˜พ", - "๐Ÿ‘‹", "๐Ÿคš", "๐Ÿ–", "โœ‹", "๐Ÿ––", "๐Ÿ‘Œ", "๐Ÿค", "โœŒ๏ธ", "๐Ÿคž", "๐ŸคŸ", "๐Ÿค˜", "๐Ÿค™", "๐Ÿ‘ˆ", "๐Ÿ‘‰", "๐Ÿ‘†", "๐Ÿ–•", "๐Ÿ‘‡", "โ˜๏ธ", "๐Ÿ‘", "๐Ÿ‘Ž", "โœŠ", "๐Ÿ‘Š", "๐Ÿค›", "๐Ÿคœ", "๐Ÿ‘", "๐Ÿ™Œ", "๐Ÿ‘", "๐Ÿคฒ", "๐Ÿค", "๐Ÿ™", - "โœ๏ธ", "๐Ÿ’…", "๐Ÿคณ", "๐Ÿ’ช", "๐Ÿฆพ", "๐Ÿฆต", "๐Ÿฆฟ", "๐Ÿฆถ", "๐Ÿ‘ฃ", "๐Ÿ‘‚", "๐Ÿฆป", "๐Ÿ‘ƒ", "๐Ÿง ", "๐Ÿฆท", "๐Ÿฆด", "๐Ÿ‘€", "๐Ÿ‘…", "๐Ÿ‘„", "๐Ÿ’‹", "๐Ÿฉธ" - ]; + const emojis = [ + "<", "๐Ÿ˜€", "๐Ÿ˜ƒ", "๐Ÿ˜„", "๐Ÿ˜", "๐Ÿ˜†", "๐Ÿ˜…", "๐Ÿ˜‚", "๐Ÿคฃ", "๐Ÿ˜Š", "๐Ÿ˜‡", "๐Ÿ™‚", "๐Ÿ™ƒ", "๐Ÿ˜‰", "๐Ÿ˜Œ", "๐Ÿ˜", "๐Ÿฅฐ", "๐Ÿ˜˜", "๐Ÿ˜—","๐Ÿ˜™", "๐Ÿ˜š", "๐Ÿ˜‹", "๐Ÿ˜›", "๐Ÿ˜", "๐Ÿ˜œ", "๐Ÿคช", "๐Ÿคจ", "๐Ÿง", + "๐Ÿค“", "๐Ÿ˜Ž", "๐Ÿคฉ", "๐Ÿฅณ", "๐Ÿ˜", "๐Ÿ˜’", "๐Ÿ˜ž", "๐Ÿ˜”", "๐Ÿ˜Ÿ", "๐Ÿ˜•", "๐Ÿ™", "โ˜น๏ธ", "๐Ÿ˜ฃ", "๐Ÿ˜–", "๐Ÿ˜ซ", "๐Ÿ˜ฉ", "๐Ÿฅบ", "๐Ÿ˜ข", "๐Ÿ˜ญ", "๐Ÿ˜ค", "๐Ÿ˜ ", "๐Ÿ˜ก", "๐Ÿคฌ", "๐Ÿคฏ", "๐Ÿ˜ณ", "๐Ÿฅต", "๐Ÿฅถ", + "๐Ÿ˜ฑ", "๐Ÿ˜จ", "๐Ÿ˜ฐ", "๐Ÿ˜ฅ", "๐Ÿ˜“", "๐Ÿค—", "๐Ÿค”", "๐Ÿคญ", "๐Ÿคซ", "๐Ÿคฅ", "๐Ÿ˜ถ", "๐Ÿ˜", "๐Ÿ˜‘", "๐Ÿ˜ฌ", "๐Ÿ™„", "๐Ÿ˜ฏ", "๐Ÿ˜ฆ", "๐Ÿ˜ง", "๐Ÿ˜ฎ", "๐Ÿ˜ฒ", "๐Ÿฅฑ", "๐Ÿ˜ด", "๐Ÿคค", "๐Ÿ˜ช", "๐Ÿ˜ต", "๐Ÿค", "๐Ÿฅด", + "๐Ÿคข", "๐Ÿคฎ", "๐Ÿคง", "๐Ÿ˜ท", "๐Ÿค’", "๐Ÿค•", "๐Ÿค‘", "๐Ÿค ", "๐Ÿ˜ˆ", "๐Ÿ‘ฟ", "๐Ÿ‘น", "๐Ÿ‘บ", "๐Ÿคก", "๐Ÿ’ฉ", "๐Ÿ‘ป", "๐Ÿ’€", "โ˜ ๏ธ", "๐Ÿ‘ฝ", "๐Ÿ‘พ", "๐Ÿค–", "๐ŸŽƒ", "๐Ÿ˜บ", "๐Ÿ˜ธ", "๐Ÿ˜น", "๐Ÿ˜ป", "๐Ÿ˜ผ", "๐Ÿ˜ฝ", + "๐Ÿ™€", "๐Ÿ˜ฟ", "๐Ÿ˜พ", ">", + + "<", "๐Ÿ‘‹", "๐Ÿคš", "๐Ÿ–", "โœ‹", "๐Ÿ––", "๐Ÿ‘Œ", "๐Ÿค", "โœŒ๏ธ", "๐Ÿคž", "๐ŸคŸ", "๐Ÿค˜", "๐Ÿค™", "๐Ÿ‘ˆ", "๐Ÿ‘‰", "๐Ÿ‘†", "๐Ÿ–•", "๐Ÿ‘‡", "โ˜๏ธ", "๐Ÿ‘", "๐Ÿ‘Ž", "โœŠ", "๐Ÿ‘Š", "๐Ÿค›", "๐Ÿคœ", "๐Ÿ‘", "๐Ÿ™Œ", "๐Ÿ‘", "๐Ÿคฒ", "๐Ÿค", "๐Ÿ™", + "โœ๏ธ", "๐Ÿ’…", "๐Ÿคณ", "๐Ÿ’ช", "๐Ÿฆพ", "๐Ÿฆต", "๐Ÿฆฟ", "๐Ÿฆถ", "๐Ÿ‘ฃ", "๐Ÿ‘‚", "๐Ÿฆป", "๐Ÿ‘ƒ", "๐Ÿง ", "๐Ÿฆท", "๐Ÿฆด", "๐Ÿ‘€", "๐Ÿ‘…", "๐Ÿ‘„", "๐Ÿ’‹", "๐Ÿฉธ", ">", + + "<", + "๐Ÿ‘ถ", "๐Ÿ‘ง", "๐Ÿง’", "๐Ÿ‘ฆ", "๐Ÿ‘ฉ", "๐Ÿง‘", "๐Ÿ‘จ", "๐Ÿ‘ฉโ€๐Ÿฆฑ", "๐Ÿง‘โ€๐Ÿฆฑ", "๐Ÿ‘จโ€๐Ÿฆฑ", "๐Ÿ‘ฉโ€๐Ÿฆฐ", "๐Ÿง‘โ€๐Ÿฆฐ", "๐Ÿ‘จโ€๐Ÿฆฐ", "๐Ÿ‘ฑโ€โ™€๏ธ", "๐Ÿ‘ฑ", "๐Ÿ‘ฑโ€โ™‚๏ธ", "๐Ÿ‘ฉโ€๐Ÿฆณ", "๐Ÿง‘โ€๐Ÿฆณ", "๐Ÿ‘จโ€๐Ÿฆณ", "๐Ÿ‘ฉโ€๐Ÿฆฒ", "๐Ÿง‘โ€๐Ÿฆฒ", "๐Ÿ‘จโ€๐Ÿฆฒ", "๐Ÿง”", "๐Ÿ‘ต", "๐Ÿง“", "๐Ÿ‘ด", "๐Ÿ‘ฒ", "๐Ÿ‘ณโ€โ™€๏ธ", "๐Ÿ‘ณ", + "๐Ÿ‘ณโ€โ™‚๏ธ", "๐Ÿง•", "๐Ÿ‘ฎโ€โ™€๏ธ", "๐Ÿ‘ฎ", "๐Ÿ‘ฎโ€โ™‚๏ธ", "๐Ÿ‘ทโ€โ™€๏ธ", "๐Ÿ‘ท", "๐Ÿ‘ทโ€โ™‚๏ธ", "๐Ÿ’‚โ€โ™€๏ธ", "๐Ÿ’‚", "๐Ÿ’‚โ€โ™‚๏ธ", "๐Ÿ•ต๏ธโ€โ™€๏ธ", "๐Ÿ•ต๏ธ", "๐Ÿ•ต๏ธโ€โ™‚๏ธ", "๐Ÿ‘ฉโ€โš•๏ธ", "๐Ÿง‘โ€โš•๏ธ", "๐Ÿ‘จโ€โš•๏ธ", "๐Ÿ‘ฉโ€๐ŸŒพ", "๐Ÿง‘โ€๐ŸŒพ", "๐Ÿ‘จโ€๐ŸŒพ", "๐Ÿ‘ฉโ€๐Ÿณ", "๐Ÿง‘โ€๐Ÿณ", "๐Ÿ‘จโ€๐Ÿณ", "๐Ÿ‘ฉโ€๐ŸŽ“", "๐Ÿง‘โ€๐ŸŽ“", "๐Ÿ‘จโ€๐ŸŽ“", "๐Ÿ‘ฉโ€๐ŸŽค", "๐Ÿง‘โ€๐ŸŽค", "๐Ÿ‘จโ€๐ŸŽค", + "๐Ÿ‘ฉโ€๐Ÿซ", "๐Ÿง‘โ€๐Ÿซ", "๐Ÿ‘จโ€๐Ÿซ", "๐Ÿ‘ฉโ€๐Ÿญ", "๐Ÿง‘โ€๐Ÿญ", "๐Ÿ‘จโ€๐Ÿญ", "๐Ÿ‘ฉโ€๐Ÿ’ป", "๐Ÿง‘โ€๐Ÿ’ป", "๐Ÿ‘จโ€๐Ÿ’ป", "๐Ÿ‘ฉโ€๐Ÿ’ผ", "๐Ÿง‘โ€๐Ÿ’ผ", "๐Ÿ‘จโ€๐Ÿ’ผ", "๐Ÿ‘ฉโ€๐Ÿ”ง", "๐Ÿง‘โ€๐Ÿ”ง", "๐Ÿ‘จโ€๐Ÿ”ง", "๐Ÿ‘ฉโ€๐Ÿ”ฌ", "๐Ÿง‘โ€๐Ÿ”ฌ", "๐Ÿ‘จโ€๐Ÿ”ฌ", "๐Ÿ‘ฉโ€๐ŸŽจ", "๐Ÿง‘โ€๐ŸŽจ", "๐Ÿ‘จโ€๐ŸŽจ", "๐Ÿ‘ฉโ€๐Ÿš’", "๐Ÿง‘โ€๐Ÿš’", "๐Ÿ‘จโ€๐Ÿš’", "๐Ÿ‘ฉโ€โœˆ๏ธ", "๐Ÿง‘โ€โœˆ๏ธ", "๐Ÿ‘จโ€โœˆ๏ธ", + "๐Ÿ‘ฉโ€๐Ÿš€", "๐Ÿง‘โ€๐Ÿš€", "๐Ÿ‘จโ€๐Ÿš€", "๐Ÿ‘ฉโ€โš–๏ธ", "๐Ÿง‘โ€โš–๏ธ", "๐Ÿ‘จโ€โš–๏ธ", "๐Ÿ‘ฐโ€โ™€๏ธ", "๐Ÿ‘ฐ", "๐Ÿ‘ฐโ€โ™‚๏ธ", "๐Ÿคตโ€โ™€๏ธ", "๐Ÿคต", "๐Ÿคตโ€โ™‚๏ธ", "๐Ÿ‘ธ", "๐Ÿคด", "๐Ÿฆธโ€โ™€๏ธ", "๐Ÿฆธ", "๐Ÿฆธโ€โ™‚๏ธ", "๐Ÿฆนโ€โ™€๏ธ", "๐Ÿฆน", "๐Ÿฆนโ€โ™‚๏ธ", "๐Ÿคถ", "๐Ÿง‘โ€๐ŸŽ„", "๐ŸŽ…", "๐Ÿง™โ€โ™€๏ธ", "๐Ÿง™", "๐Ÿง™โ€โ™‚๏ธ", "๐Ÿงโ€โ™€๏ธ", "๐Ÿง", + "๐Ÿงโ€โ™‚๏ธ", "๐Ÿง›โ€โ™€๏ธ", "๐Ÿง›", "๐Ÿง›โ€โ™‚๏ธ", "๐ŸงŸโ€โ™€๏ธ", "๐ŸงŸ", "๐ŸงŸโ€โ™‚๏ธ", "๐Ÿงžโ€โ™€๏ธ", "๐Ÿงž", "๐Ÿงžโ€โ™‚๏ธ", "๐Ÿงœโ€โ™€๏ธ", "๐Ÿงœ", "๐Ÿงœโ€โ™‚๏ธ", "๐Ÿงšโ€โ™€๏ธ", "๐Ÿงš", "๐Ÿงšโ€โ™‚๏ธ", "๐Ÿ‘ผ", "๐Ÿคฐ", "๐Ÿคฑ", "๐Ÿ‘ฉโ€๐Ÿผ", "๐Ÿง‘โ€๐Ÿผ", "๐Ÿ‘จโ€๐Ÿผ", "๐Ÿ™‡โ€โ™€๏ธ", "๐Ÿ™‡", "๐Ÿ™‡โ€โ™‚๏ธ", "๐Ÿ’โ€โ™€๏ธ", "๐Ÿ’", "๐Ÿ’โ€โ™‚๏ธ", "๐Ÿ™…โ€โ™€๏ธ", "๐Ÿ™…", + "๐Ÿ™…โ€โ™‚๏ธ", "๐Ÿ™†โ€โ™€๏ธ", "๐Ÿ™†", "๐Ÿ™†โ€โ™‚๏ธ", "๐Ÿ™‹โ€โ™€๏ธ", "๐Ÿ™‹", "๐Ÿ™‹โ€โ™‚๏ธ", "๐Ÿงโ€โ™€๏ธ", "๐Ÿง", "๐Ÿงโ€โ™‚๏ธ", "๐Ÿคฆโ€โ™€๏ธ", "๐Ÿคฆ", "๐Ÿคฆโ€โ™‚๏ธ", "๐Ÿคทโ€โ™€๏ธ", "๐Ÿคท", "๐Ÿคทโ€โ™‚๏ธ", "๐Ÿ™Žโ€โ™€๏ธ", "๐Ÿ™Ž", "๐Ÿ™Žโ€โ™‚๏ธ", "๐Ÿ™โ€โ™€๏ธ", "๐Ÿ™", "๐Ÿ™โ€โ™‚๏ธ", "๐Ÿ’‡โ€โ™€๏ธ", "๐Ÿ’‡", "๐Ÿ’‡โ€โ™‚๏ธ", "๐Ÿ’†โ€โ™€๏ธ", "๐Ÿ’†", "๐Ÿ’†โ€โ™‚๏ธ", "๐Ÿง–โ€โ™€๏ธ", "๐Ÿง–", "๐Ÿง–โ€โ™‚๏ธ", + "๐Ÿ’…", "๐Ÿคณ", "๐Ÿ’ƒ", "๐Ÿ•บ", "๐Ÿ‘ฏโ€โ™€๏ธ", "๐Ÿ‘ฏ", "๐Ÿ‘ฏโ€โ™‚๏ธ", "๐Ÿ•ด", "๐Ÿ‘ฉโ€๐Ÿฆฝ", "๐Ÿง‘โ€๐Ÿฆฝ", "๐Ÿ‘จโ€๐Ÿฆฝ", "๐Ÿ‘ฉโ€๐Ÿฆผ", "๐Ÿง‘โ€๐Ÿฆผ", "๐Ÿ‘จโ€๐Ÿฆผ", "๐Ÿšถโ€โ™€๏ธ", "๐Ÿšถ", "๐Ÿšถโ€โ™‚๏ธ", "๐Ÿ‘ฉโ€๐Ÿฆฏ", "๐Ÿง‘โ€๐Ÿฆฏ", "๐Ÿ‘จโ€๐Ÿฆฏ", "๐ŸงŽโ€โ™€๏ธ", "๐ŸงŽ", "๐ŸงŽโ€โ™‚๏ธ", "๐Ÿƒโ€โ™€๏ธ", "๐Ÿƒ", "๐Ÿƒโ€โ™‚๏ธ", "๐Ÿงโ€โ™€๏ธ", "๐Ÿง", "๐Ÿงโ€โ™‚๏ธ", "๐Ÿ‘ญ", "๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘", "๐Ÿ‘ฌ", + "๐Ÿ‘ซ", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘ฉ", "๐Ÿ’‘", "๐Ÿ‘จโ€โค๏ธโ€๐Ÿ‘จ", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ‘จ", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘ฉ", "๐Ÿ’", "๐Ÿ‘จโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ", "๐Ÿ‘ฉโ€โค๏ธโ€๐Ÿ’‹โ€๐Ÿ‘จ", "๐Ÿ‘ช", "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ", "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ง", "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ", "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ", "๐Ÿ‘จโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง", "๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ฆ", "๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ง", "๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ", "๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ", "๐Ÿ‘จโ€๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ง", "๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆ", "๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ง", "๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ", "๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ", "๐Ÿ‘ฉโ€๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง", "๐Ÿ‘จโ€๐Ÿ‘ฆ", "๐Ÿ‘จโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ", "๐Ÿ‘จโ€๐Ÿ‘ง", "๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ฆ", + "๐Ÿ‘จโ€๐Ÿ‘งโ€๐Ÿ‘ง", "๐Ÿ‘ฉโ€๐Ÿ‘ฆ", "๐Ÿ‘ฉโ€๐Ÿ‘ฆโ€๐Ÿ‘ฆ", "๐Ÿ‘ฉโ€๐Ÿ‘ง", "๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ฆ", "๐Ÿ‘ฉโ€๐Ÿ‘งโ€๐Ÿ‘ง", "๐Ÿ‘ค", "๐Ÿ‘ฅ", ">", + + "<", + "๐Ÿงณ", "๐ŸŒ‚", "โ˜‚๏ธ", "๐Ÿงต", "๐Ÿงถ", "๐Ÿ‘“", "๐Ÿฅฝ", "๐Ÿฅผ", "๐Ÿฆบ", "๐Ÿ‘”", "๐Ÿ‘•", "๐Ÿ‘–", "๐Ÿงฃ", "๐Ÿงค", "๐Ÿงฅ", "๐Ÿงฆ", "๐Ÿ‘—", "๐Ÿ‘˜", "๐Ÿฅป", "๐Ÿฉฑ", "๐Ÿฉฒ", "๐Ÿฉณ", "๐Ÿ‘™", "๐Ÿ‘š", "๐Ÿ‘›", "๐Ÿ‘œ", "๐Ÿ‘", "๐ŸŽ’", "๐Ÿ‘ž", "๐Ÿ‘Ÿ", "๐Ÿฅพ", "๐Ÿฅฟ", + "๐Ÿ‘ ", "๐Ÿ‘ก", "๐Ÿฉฐ", "๐Ÿ‘ข", "๐Ÿ‘‘", "๐Ÿ‘’", "๐ŸŽฉ", "๐ŸŽ“", "๐Ÿงข", "๐Ÿ’„", "๐Ÿ’", "๐Ÿ’ผ", + ">", + + "<", "๐Ÿถ", "๐Ÿฑ", "๐Ÿญ", "๐Ÿน", "๐Ÿฐ", "๐ŸฆŠ", "๐Ÿป", "๐Ÿผ", "๐Ÿจ", "๐Ÿฏ", "๐Ÿฆ", "๐Ÿฎ", "๐Ÿท", "๐Ÿฝ", "๐Ÿธ", "๐Ÿต", "๐Ÿ™ˆ", "๐Ÿ™‰", "๐Ÿ™Š", "๐Ÿ’", "๐Ÿ”", "๐Ÿง", "๐Ÿฆ", "๐Ÿค", "๐Ÿฃ", "๐Ÿฅ", "๐Ÿฆ†", "๐Ÿฆ…", "๐Ÿฆ‰", + "๐Ÿฆ‡", "๐Ÿบ", "๐Ÿ—", "๐Ÿด", "๐Ÿฆ„", "๐Ÿ", "๐Ÿ›", "๐Ÿฆ‹", "๐ŸŒ", "๐Ÿž", "๐Ÿœ", "๐ŸฆŸ", "๐Ÿฆ—", "๐Ÿ•ท", "๐Ÿ•ธ", "๐Ÿฆ‚", "๐Ÿข", "๐Ÿ", "๐ŸฆŽ", "๐Ÿฆ–", "๐Ÿฆ•", "๐Ÿ™", "๐Ÿฆ‘", "๐Ÿฆ", "๐Ÿฆž", "๐Ÿฆ€", "๐Ÿก", "๐Ÿ ", "๐ŸŸ", + "๐Ÿฌ", "๐Ÿณ", "๐Ÿ‹", "๐Ÿฆˆ", "๐ŸŠ", "๐Ÿ…", "๐Ÿ†", "๐Ÿฆ“", "๐Ÿฆ", "๐Ÿฆง", "๐Ÿ˜", "๐Ÿฆ›", "๐Ÿฆ", "๐Ÿช", "๐Ÿซ", "๐Ÿฆ’", "๐Ÿฆ˜", "๐Ÿƒ", "๐Ÿ‚", "๐Ÿ„", "๐ŸŽ", "๐Ÿ–", "๐Ÿ", "๐Ÿ‘", "๐Ÿฆ™", "๐Ÿ", "๐ŸฆŒ", "๐Ÿ•", "๐Ÿฉ", + "๐Ÿฆฎ", "๐Ÿ•โ€๐Ÿฆบ", "๐Ÿˆ", "๐Ÿˆโ€", "๐Ÿ“", "๐Ÿฆƒ", "๐Ÿฆš", "๐Ÿฆœ", "๐Ÿฆข", "๐Ÿฆฉ", "๐Ÿ‡", "๐Ÿฆ", "๐Ÿฆจ", "๐Ÿฆก", "๐Ÿฆฆ", "๐Ÿฆฅ", "๐Ÿ", "๐Ÿ€", "๐Ÿฆ”", "๐Ÿพ", "๐Ÿ‰", "๐Ÿฒ", "๐ŸŒต", "๐ŸŽ„", "๐ŸŒฒ", "๐ŸŒณ", "๐ŸŒด", "๐ŸŒฑ", "๐ŸŒฟ", + "โ˜˜๏ธ", "๐Ÿ€", "๐ŸŽ", "๐ŸŽ‹", "๐Ÿƒ", "๐Ÿ‚", "๐Ÿ", "๐Ÿ„", "๐Ÿš", "๐ŸŒพ", "๐Ÿ’", "๐ŸŒท", "๐ŸŒน", "๐Ÿฅ€", "๐ŸŒบ", "๐ŸŒธ", "๐ŸŒผ", "๐ŸŒป", "๐ŸŒž", "๐ŸŒ", "๐ŸŒ›", "๐ŸŒœ", "๐ŸŒš", "๐ŸŒ•", "๐ŸŒ–", "๐ŸŒ—", "๐ŸŒ˜", "๐ŸŒ‘", "๐ŸŒ’", + "๐ŸŒ“", "๐ŸŒ”", "๐ŸŒ™", "๐ŸŒŽ", "๐ŸŒ", "๐ŸŒ", "๐Ÿช", "๐Ÿ’ซ", "โญ๏ธ", "๐ŸŒŸ", "โœจ", "โšก๏ธ", "โ˜„๏ธ", "๐Ÿ’ฅ", "๐Ÿ”ฅ", "๐ŸŒˆ", "โ˜€๏ธ", "โ›…๏ธ", "โ˜๏ธ", "โ„๏ธ", "โ˜ƒ๏ธ", "โ›„๏ธ", "๐Ÿ’จ", "๐Ÿ’ง", "๐Ÿ’ฆ", "โ˜”๏ธ", "โ˜‚๏ธ", "๐ŸŒŠ", ">", + + "<", "๐Ÿ", "๐ŸŽ", "๐Ÿ", "๐ŸŠ", "๐Ÿ‹", "๐ŸŒ", "๐Ÿ‰", "๐Ÿ‡", "๐Ÿ“", "๐Ÿˆ", "๐Ÿ’", "๐Ÿ‘", "๐Ÿฅญ", "๐Ÿ", "๐Ÿฅฅ", "๐Ÿฅ", "๐Ÿ…", "๐Ÿ†", "๐Ÿฅ‘", "๐Ÿฅฆ", "๐Ÿฅฌ", "๐Ÿฅ’", "๐ŸŒฝ", "๐Ÿฅ•", "๐Ÿง„", "๐Ÿง…", "๐Ÿฅ”", "๐Ÿ ", "๐Ÿฅ", + "๐Ÿฅฏ", "๐Ÿž", "๐Ÿฅ–", "๐Ÿฅจ", "๐Ÿง€", "๐Ÿฅš", "๐Ÿณ", "๐Ÿงˆ", "๐Ÿฅž", "๐Ÿง‡", "๐Ÿฅ“", "๐Ÿฅฉ", "๐Ÿ—", "๐Ÿ–", "๐Ÿฆด", "๐ŸŒญ", "๐Ÿ”", "๐ŸŸ", "๐Ÿ•", "๐Ÿฅช", "๐Ÿฅ™", "๐Ÿง†", "๐ŸŒฎ", "๐ŸŒฏ", "๐Ÿฅ—", "๐Ÿฅ˜", "๐Ÿฅซ", "๐Ÿ", "๐Ÿœ", + "๐Ÿฒ", "๐Ÿ›", "๐Ÿฃ", "๐Ÿฑ", "๐ŸฅŸ", "๐Ÿฆช", "๐Ÿค", "๐Ÿ™", "๐Ÿš", "๐Ÿ˜", "๐Ÿฅ", "๐Ÿฅ ", "๐Ÿฅฎ", "๐Ÿข", "๐Ÿก", "๐Ÿง", "๐Ÿจ", "๐Ÿฆ", "๐Ÿฅง", "๐Ÿง", "๐Ÿฐ", "๐ŸŽ‚", "๐Ÿฎ", "๐Ÿญ", "๐Ÿฌ", "๐Ÿซ", "๐Ÿฟ", "๐Ÿฉ", "๐Ÿช", + "๐ŸŒฐ", "๐Ÿฅœ", "๐Ÿฏ", "๐Ÿฅ›", "๐Ÿผ", "โ˜•๏ธ", "๐Ÿต", "๐Ÿงƒ", "๐Ÿฅค", "๐Ÿถ", "๐Ÿบ", "๐Ÿป", "๐Ÿฅ‚", "๐Ÿท", "๐Ÿฅƒ", "๐Ÿธ", "๐Ÿน", "๐Ÿง‰", "๐Ÿพ", "๐ŸงŠ", "๐Ÿฅ„", "๐Ÿด", "๐Ÿฝ", "๐Ÿฅฃ", "๐Ÿฅก", "๐Ÿฅข", "๐Ÿง‚", ">", + + "<", "โšฝ๏ธ", "๐Ÿ€", "๐Ÿˆ", "โšพ๏ธ", "๐ŸฅŽ", "๐ŸŽพ", "๐Ÿ", "๐Ÿ‰", "๐Ÿฅ", "๐ŸŽฑ", "๐Ÿช€", "๐Ÿ“", "๐Ÿธ", "๐Ÿ’", "๐Ÿ‘", "๐Ÿฅ", "๐Ÿ", "๐Ÿฅ…", "โ›ณ๏ธ", "๐Ÿช", "๐Ÿน", "๐ŸŽฃ", "๐Ÿคฟ", "๐ŸฅŠ", "๐Ÿฅ‹", "๐ŸŽฝ", "๐Ÿ›น", "๐Ÿ›ท", "๐ŸฅŒ", + "๐ŸŽฟ", "๐Ÿ‚", "๐Ÿช‚", "๐Ÿ‹๏ธโ€โ™€๏ธ", "๐Ÿ‹๏ธ", "๐Ÿ‹๏ธโ€โ™‚๏ธ", "๐Ÿคผโ€โ™€๏ธ", "๐Ÿคผ", "๐Ÿคผโ€โ™‚๏ธ", "๐Ÿคธโ€โ™€๏ธ", "๐Ÿคธ", "๐Ÿคธโ€โ™‚๏ธ", "โ›น๏ธโ€โ™€๏ธ", "โ›น๏ธ", "โ›น๏ธโ€โ™‚๏ธ", "๐Ÿคบ", "๐Ÿคพโ€โ™€๏ธ", "๐Ÿคพ", "๐Ÿคพโ€โ™‚๏ธ", "๐ŸŒ๏ธโ€โ™€๏ธ", "๐ŸŒ๏ธ", "๐ŸŒ๏ธโ€โ™‚๏ธ", "๐Ÿ‡", "๐Ÿง˜โ€โ™€๏ธ", "๐Ÿง˜", "๐Ÿง˜โ€โ™‚๏ธ", "๐Ÿ„โ€โ™€๏ธ", "๐Ÿ„", "๐Ÿ„โ€โ™‚๏ธ", "๐ŸŠโ€โ™€๏ธ", + "๐ŸŠ", "๐ŸŠโ€โ™‚๏ธ", "๐Ÿคฝโ€โ™€๏ธ", "๐Ÿคฝ", "๐Ÿคฝโ€โ™‚๏ธ", "๐Ÿšฃโ€โ™€๏ธ", "๐Ÿšฃ", "๐Ÿšฃโ€โ™‚๏ธ", "๐Ÿง—โ€โ™€๏ธ", "๐Ÿง—", "๐Ÿง—โ€โ™‚๏ธ", "๐Ÿšตโ€โ™€๏ธ", "๐Ÿšต", "๐Ÿšตโ€โ™‚๏ธ", "๐Ÿšดโ€โ™€๏ธ", "๐Ÿšด", "๐Ÿšดโ€โ™‚๏ธ", "๐Ÿ†", "๐Ÿฅ‡", "๐Ÿฅˆ", "๐Ÿฅ‰", "๐Ÿ…", "๐ŸŽซ", "๐ŸŽช", "๐Ÿคน", "๐Ÿคนโ€โ™‚๏ธ", "๐Ÿคนโ€โ™€๏ธ", "๐ŸŽญ", "๐Ÿฉฐ", "๐ŸŽจ", + "๐ŸŽฌ", "๐ŸŽค", "๐ŸŽง", "๐ŸŽผ", "๐ŸŽน", "๐Ÿฅ", "๐ŸŽท", "๐ŸŽบ", "๐ŸŽธ", "๐Ÿช•", "๐ŸŽป", "๐ŸŽฒ", "๐ŸŽฏ", "๐ŸŽณ", "๐ŸŽฎ", "๐ŸŽฐ", "๐Ÿงฉ", ">" + ]; let renderedEmojis = '' - emojis.forEach(emoji => { - renderedEmojis += `${emoji}` - }) + let emojiSectionCounter = 0 + let emojiSections = ['Smileys', 'Gestures and Body Parts', 'People and Fantasy', 'Clothing and Accessories', 'Animals & Nature', 'Food & Drink', 'Activity and Sports'] + renderedEmojis += ` +
+
Recent
+
` + for(emoji of emojis){ + if(emoji === '<'){ + renderedEmojis += `
+
${emojiSections[emojiSectionCounter]}
` + emojiSectionCounter++ + } + else if(emoji === '>') + renderedEmojis += `
` + else + renderedEmojis += `${emoji}` + } getRef('emoji_picker').innerHTML = renderedEmojis function toggleEmoji(button){ @@ -1741,10 +1813,30 @@ getRef('chat_container').scrollTo({top: getRef('chat_container').scrollHeight, behaviour: smooth ? 'smooth': ''}) } + let startIndex = 0, + endIndex = 0 function renderMessages(data, options) { - let {markUnread = true, updateChatCard = false} = options - for (let m in data) { - let {floID, message, time, category} = data[m] + let {markUnread = true, updateChatCard = false, reRender = false, lazyLoad = false} = options + let messages + if(reRender){ + activeChat['allMessages'] = Object.values(data) + startIndex = (activeChat['allMessages'].length - 10) > 0 ? activeChat['allMessages'].length - 10 : 0 + endIndex = activeChat['allMessages'].length + messages = activeChat['allMessages'] + } + else if(lazyLoad){ + messages = activeChat['allMessages'] + startIndex = startIndex > 10 ? startIndex -= 10 : 0 + markUnread = false + } + else{ + messages = Object.values(data) + startIndex = 0 + endIndex = messages.length + } + + for (i = startIndex; i < endIndex; i++) { + let {floID, message, time, category} = messages[i] //Stops message from rendering in wrong chat window if(activeChat['receiver'] && activeChat['receiver'] === floID) frag.append(render.messageBubble(floID, message, time, category)) @@ -1772,9 +1864,42 @@ chatCard.querySelector('.time').textContent = getFormatedTime(time, true) } } - getRef('chat_container').append(frag) - scrollToBottom() + endIndex = startIndex + if(!lazyLoad && !reRender){ + endIndex = messages.length + getRef('chat_container').append(frag) + } + if(reRender || lazyLoad){ + currentDate = null + getRef('chat_container').prepend(frag) + prevScroll = getRef('chat_container').scrollTop + } + if(reRender){ + scrollToBottom() + } } + + //checks for added elements in chat + const chatMutationObserver = new MutationObserver( + (mutations, observer) => { + for(const mutation of mutations) { + if (mutation.type === 'childList' && mutation.addedNodes.length) { + chatMessageObserver.observe(getRef('chat_container').firstElementChild) + } + } + } + ) + chatMutationObserver.observe(getRef('chat_container'), { attributes: true, childList: true }) + + //Lazy loading for chat messages + const chatMessageObserver = new IntersectionObserver( + (entries, observer) => { + if(entries[0].isIntersecting){ + renderMessages('', {lazyLoad: true}) + observer.disconnect() + } + } + ) async function viewConversation(contact) { getRef('chat_container').innerHTML = '' @@ -1790,9 +1915,7 @@ getRef("warn_no_encryption").classList.add("hide-completely"); else getRef("warn_no_encryption").classList.remove("hide-completely"); - renderMessages(await messenger.getChat(floID),{markUnread: false}) - scrollToBottom() - prevScroll = getRef('chat_container').scrollTop + renderMessages(await messenger.getChat(floID),{markUnread: false, reRender: true}) messenger.removeMark(floID, "unread"); } diff --git a/scripts/components.js b/scripts/components.js index 9e0dd89..14c5e42 100644 --- a/scripts/components.js +++ b/scripts/components.js @@ -662,6 +662,7 @@ customElements.define('sm-textarea', } set value(val) { this.shadowRoot.querySelector('textarea').value = val; + this.textareaBox.dataset.value = val this.checkInput() this.fireEvent() } @@ -2127,18 +2128,18 @@ customElements.define('sm-popup', class extends HTMLElement { this.popupHeader.addEventListener('touchstart', (e) => { this.handleTouchStart(e) - }) + }, {passive: true}) this.popupHeader.addEventListener('touchmove', (e) => { this.handleTouchMove(e) - }) + }, {passive: true}) this.popupHeader.addEventListener('touchend', (e) => { this.handleTouchEnd(e) - }) + }, {passive: true}) } disconnectedCallback() { - this.popupHeader.removeEventListener('touchstart', this.handleTouchStart) - this.popupHeader.removeEventListener('touchmove', this.handleTouchMove) - this.popupHeader.removeEventListener('touchend', this.handleTouchEnd) + this.popupHeader.removeEventListener('touchstart', this.handleTouchStart, {passive: true}) + this.popupHeader.removeEventListener('touchmove', this.handleTouchMove, {passive: true}) + this.popupHeader.removeEventListener('touchend', this.handleTouchEnd, {passive: true}) } }) @@ -2694,9 +2695,9 @@ customElements.define('sm-notifications', class extends HTMLElement { } else { notification.setAttribute('style', `transform: translateY(0); opacity: 1`) } - notification.addEventListener('touchstart', this.handleTouchStart) - notification.addEventListener('touchmove', this.handleTouchMove) - notification.addEventListener('touchend', this.handleTouchEnd) + notification.addEventListener('touchstart', this.handleTouchStart, {passive: true}) + notification.addEventListener('touchmove', this.handleTouchMove, {passive: true}) + notification.addEventListener('touchend', this.handleTouchEnd, {passive: true}) } removeNotification = (notification, toLeft) => { @@ -2829,6 +2830,7 @@ smMenu.innerHTML = ` .hide{ opacity: 0; pointer-events: none; + user-select: none; } .select{ position: relative; @@ -2941,6 +2943,9 @@ customElements.define('sm-menu', class extends HTMLElement { this.optionList.classList.add('no-transformations') this.open = true this.icon.classList.add('focused') + this.availableOptions.forEach(option => { + option.setAttribute('tabindex', '0') + }) } } collapse() { @@ -2949,6 +2954,9 @@ customElements.define('sm-menu', class extends HTMLElement { this.icon.classList.remove('focused') this.optionList.classList.add('hide') this.optionList.classList.remove('no-transformations') + this.availableOptions.forEach(option => { + option.removeAttribute('tabindex') + }) } } connectedCallback() { @@ -3067,7 +3075,6 @@ customElements.define('sm-menu-option', class extends HTMLElement { this.click() } }) - this.setAttribute('tabindex', '0') } })