messenger/css/main.scss
sairaj mote 6a303fb2de 0.0.34
2020-09-02 18:30:06 +05:30

1100 lines
24 KiB
SCSS

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Roboto:wght@400;500;700&display=swap');
*,
::before,
::after{
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: 'Roboto', sans-serif;
}
:root{
scroll-behavior: smooth;
}
html, body{
height: 100%;
}
body{
--accent-color: #0268D1;
--secondary-color: #FDB956;
--text-color: 17, 17, 17;
--text-color-light: 100, 100, 100;
--foreground-color: 255, 255, 255;
--background-color: #efefef;
--error-color: red;
--hue: 210;
--saturation: 98%;
--lightness: 41%;
font-size: 16px;
color: rgba(var(--text-color), 1);
background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1920' height='1080' viewBox='0 0 1920 1080'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:%23a579cc;opacity:0.2;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3Ebg%3C/title%3E%3Cpath class='a' d='M623,1159c-87.68-165.38-129.16-438.77-9-634,37.72-61.28,92.93-117.41,455-293C1411,66.13,1582-16.8,1697-36c82.8-13.83,576.06-96.19,867,204,292.32,301.61,256.84,861.93,14,1172C2127.64,1915.05,909.4,1699.22,623,1159Z'/%3E%3Cpath class='a' d='M810,1133c-49.8-128.47-45-298.39,23-435,76.63-154,210-218.3,429-320,274.53-127.47,576.8-267.83,916-172,85.07,24,231.42,67.54,340,204,122.67,154.17,121.49,331.91,121,406-1.57,237.61-115.25,473.71-277,614C1914.69,1818,981.6,1575.63,810,1133Z'/%3E%3Cpath class='a' d='M1181,1142c-62.16-209.22,55-403,70-427,156.87-251,473.31-278.8,578-288,74.9-6.58,251.61-19.83,441,75,89.21,44.67,290.7,145.55,328,349,31.94,174.23-75.8,318.54-109,363-83.65,112-184,158.9-317,219-227.94,103-404.87,183-602,115-188.59-65-300.7-232.66-334-288C1217.51,1229.26,1196.3,1193.48,1181,1142Z'/%3E%3Cpath class='a' d='M1455,1182c-53.36-145,46.26-302.52,130-380,107.31-99.3,235.1-110.22,291-115,82.39-7,247.07-21.12,360,100,83.24,89.28,112.47,224.24,77,337-76.11,242-411.58,259.25-432,260C1861.81,1384.71,1532.47,1392.52,1455,1182Z'/%3E%3Cpath class='a' d='M1729,1156c-47.23-69.45-12.64-170.65,43-225,67.27-65.71,193.24-90.22,259-23,66.79,68.27,41.95,201-37,265C1916,1236.27,1782.44,1234.58,1729,1156Z'/%3E%3C/svg%3E") fixed no-repeat;
background-size: cover;
}
body[data-theme='dark']{
--accent-color: #3a9bff;
--text-color: 218, 218, 218;
--text-color-light: 170, 170, 170;
--foreground-color: 20, 20, 20;
--lightness: 60%;
.initial{
background: rgba(var(--text-color), 0.1);
color: rgba(var(--text-color), 1) !important;
box-shadow: 0 0.1rem 0.1rem #00000016, 0 0.1rem 0.3rem #00000040;
}
}
p{
line-height: 1.6;
}
h1{
font-size: 3rem;
}
h2{
font-size: 2rem;
}
h3{
font-size: 1.5rem;
}
h4{
font-size: 1.1rem;
}
h5{
font-size: 0.8rem;
}
h1, h2, h3, h4, h5{
color: rgba(var(--text-color), 1);
font-family: 'Poppins', sans-serif;
font-weight: 600;
}
textarea{
background: rgba(var(--text-color), 0.1);
border: none;
border-radius: 0.3rem;
width: 100%;
padding: 1rem;
font-size: 1rem;
&:focus{
outline: none;
box-shadow: 0 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{
box-shadow: 0 1rem 1rem #00000020;
margin-right: 1rem;
position: fixed;
bottom: 3.5rem;
right: 0;
z-index: 2;
.icon{
margin-left: 0 !important;
margin-right: 0.5rem;
height: 0.9rem !important;
stroke-width: 8 !important;
}
}
a:any-link{
text-decoration: none;
color: var(--accent-color);
text-transform: capitalize;
font-weight: 500;
}
.solid-background{
background: var(--background-color) !important;
}
.normal-weight{
font-weight: normal;
}
.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;
transition: transform 0.3s;
}
.page{
align-items: flex-start;
width: 100%;
height: 100%;
background: rgba(var(--foreground-color), 0.7);
}
.card{
display: flex;
flex-direction: column;
margin: 1rem 0;
}
sm-button{
--font-family: 'Poppins', sans-serif;
margin: 1rem 0;
.icon{
margin-right: 0.4rem;
}
}
sm-input{
margin-bottom: 1rem;
}
sm-button[variant="primary"]{
.icon{
align-self: center;
height: 1rem;
width: 1rem;
margin-left: 0.8rem;
stroke-width: 6;
stroke: rgba(var(--foreground-color), 1);
}
}
.back-button{
margin-right: 1rem;
}
.logo-section{
display: flex;
position: relative;
align-items: center;
height: max-content;
margin: 0.5rem 0;
h4{
font-weight: 500;
line-height: 1;
}
h5{
color: rgba(var(--text-color), 0.7);
}
.main-logo{
height: 1.4rem;
margin-right: 0.4rem;
fill: rgba(var(--text-color), 1);
stroke: none;
}
}
.select-file{
input[type="file"]{
display: none;
}
}
#confirmation, #prompt{
p{
max-width: 50ch;
}
h4{
margin-block-end: 1rem;
}
sm-button{
margin-block-start: 1.5rem;
margin-bottom: 0;
}
sm-button:first-of-type{
margin-inline-end: 0.5rem;
}
}
#sign_in{
display: grid;
border-radius: 0.6rem;
width: 100%;
padding: 0 1.5rem;
height: 100%;
align-items: flex-end;
.logo-section{
padding: 1.5rem;
display: flex;
}
sm-popup::part(heading){
font-size: 2rem;
font-weight: 600;
}
.title-font{
font-kerning: normal;
line-height: 1;
text-transform: uppercase;
font-weight: 900;
font-size: 2.5rem;
}
.left{
display: grid;
flex-direction: column;
padding-bottom: 1.5rem;
z-index: 1;
h4{
color: rgba(var(--foreground-color), 1);
}
sm-button{
margin-top: 3rem;
width: auto;
}
sm-button:last-of-type{
margin-left: auto;
}
sm-button:first-of-type:hover{
.icon{
transform: translateX(0.4rem);
}
}
h3{
margin-bottom: 1rem;
font-weight: 500;
}
p{
font-weight: 500;
}
}
}
#sign_in_page{
height: 100vh;
width: 100vw;
background: rgba(var(--foreground-color), 1);
overflow: hidden;
header{
padding: 1.5rem;
}
}
#sign_in_illustration{
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
svg{
height: 12rem;
width: 12rem;
stroke-linecap: round;
stroke-linejoin: round;
overflow: visible;
z-index: 2;
}
.circle{
position: absolute;
border-radius: 50%;
}
.circle:nth-of-type(1){
right: -10vh;
background: var(--secondary-color);
width: 20vh;
height: 20vh;
top: -10vh;
z-index: 1;
}
.circle:nth-of-type(2){
right: 20vh;
bottom: -30vh;
background: var(--accent-color);
width: 60vh;
height: 60vh;
}
}
#lock{
height: 12rem;
position: absolute;
top: -5rem;
left: 0;
}
#sign_in_popup{
position: relative;
width: 100%;
sm-button, sm-input{
display: flex;
min-width: 100%;
}
h4{
margin-top: 6rem;
line-height: 0.6;
font-weight: 500;
}
h2{
margin-bottom: 2rem;
}
p{
margin-bottom: 1rem;
}
}
#loading_page{
height: 100vh;
display: grid;
place-content: center;
justify-items: center;
svg{
z-index: 1;
transform-origin: bottom;
height: 6rem;
width: 6rem;
animation: bounce 0.5s infinite alternate ease-in;
}
.shadow{
margin-top: -1rem;
width: 5rem;
height: 2rem;
background: rgba(var(--text-color), 0.1);
border-radius: 50%;
animation: scale 0.5s infinite alternate ease-in;
margin-left: 1rem;
}
h4{
margin-top: 2rem;
}
}
@keyframes bounce{
0%{
transform: scaleY(1) translateY(-4rem);
}
90%{
transform: scaleY(1) translateY(0);
}
100%{
transform: scaleY(0.8) ;
}
}
@keyframes scale{
0%{
transform: scale(0.5);
}
90%{
transform: scale(1.05);
}
100%{
transform: scale(1);
}
}
.initial{
justify-content: center;
font-size: 1.6rem;
width: 3rem;
height: 3rem;
background: rgba(var(--foreground-color), 1);
box-shadow: 0 0.1rem 0.1rem #0000001a, 0 0.1rem 0.3rem #00000016;
border-radius: 2rem;
text-transform: uppercase;
}
.contact{
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;
&:focus{
background: rgba(var(--text-color), 0.06);
outline: none;
}
.initial{
grid-area: dp;
}
.name{
font-size: 1rem;
font-family: 'Poppins', sans-serif;
font-weight: 500;
text-transform: capitalize;
}
.address{
font-family: 'Poppins', sans-serif;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
font-weight: 400;
color: rgba(var(--text-color), 0.8);
}
sm-menu{
grid-area: menu;
}
}
#warn_no_encryption, .date-card{
padding: 0.4rem 0.8rem;
background: rgba(var(--text-color), 0.1);
font-weight: 500;
border-radius: 0.4rem;
color: rgba(var(--text-color), 0.8);
margin: 1rem 0;
justify-self: center;
align-self: flex-start;
}
.date-card{
align-self: center;
}
#send_message_button{
.icon{
margin: 0;
height: 1.2rem;
width: 1.2rem;
stroke: rgba(var(--foreground-color), 1);
}
}
.mail-card.unread::before,
.contact.unread::before{
content: '';
position: absolute;
width: 0.2rem;
height: 100%;
top: 0;
left: 0;
background: #00C853;
}
.mail-card.unread,
.contact.unread{
h4{
font-weight: 700;
}
font-weight: 600;
}
.mail-card{
position: relative;
display: flex;
flex-direction: column;
padding: 1rem 1.5rem;
.sender{
color: rgba(var(--text-color), 0.7);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-right: 1rem;
}
.date{
margin-left: auto;
white-space: nowrap;
}
.subject{
font-size: 1em;
margin-top: 0.3rem;
font-weight: 500;
}
.description{
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
font-size: 0.9em;
color: rgba(var(--text-color), 0.8);
}
}
@keyframes slide{
from{
opacity: 0;
transform: translateX(-1rem);
}
to{
opacity: 1;
transform: none;
}
}
#mail_container{
width: 100%;
}
.mail{
position: relative;
&:not(:first-of-type){
margin-top: 2rem;
padding-inline-start: 1rem;
}
&:not(:first-of-type)::before{
content: '';
position: absolute;
left: 0;
top: 0;
width: 0.2rem;
height: 100%;
background: rgba(var(--text-color), 0.2);
}
header{
align-self: start;
margin-bottom: 1rem;
padding-bottom: 0.5rem;
border-bottom: solid 1px rgba(var(--text-color), 0.2);
h4{
font-weight: 500;
}
.flo-id{
font-weight: 400;
max-width: 90%;
}
}
.mail-subject,
.mail-content{
overflow-wrap: break-word;
word-wrap: break-word;
}
.mail-subject{
margin-bottom: 0.4em;
}
.mail-content{
height: max-content;
max-width: 60ch;
white-space: pre-wrap;
}
}
.logo-section{
display: grid;
grid-template-columns: auto 1fr;
grid-template-areas: 'logo .' 'logo .';
svg{
grid-area: logo;
}
}
#main_navbar{
position: fixed;
bottom: 0;
padding: 0;
flex-wrap: wrap;
width: 100%;
background: rgba(var(--foreground-color), 0.9);
box-shadow: 0 -0.2rem 1rem #00000016;
height: 3.5rem;
align-items: center;
z-index: 4;
.logo-section{
padding: 0;
}
.navbar-item{
position: relative;
height: 100%;
flex: 1;
justify-content: center;
flex-direction: column;
opacity: 0.8;
.icon{
height: 1.2rem;
width: 1.2rem;
}
&.badge::after{
right: 0;
top: 0;
position: absolute;
content: attr(data-notifications);
display: flex;
justify-content: center;
align-items: center;
padding: 0.4rem;
line-height: 0;
height: calc(1em + 0.4rem);
background: #00C853;
color: rgba(var(--foreground-color), 1);
border-radius: 2rem;
transition: transform 0.3s;
}
&.badge.active::after,
&.badge[data-notifications="0"]::after,
&.badge[data-notifications=""]::after{
transform: scale(0);
}
}
.active{
opacity: 1;
h5{
color: var(--accent-color);
}
.icon{
stroke: var(--accent-color);
}
}
}
#compose_mail_popup, #add_contact_popup, #reply_mail_popup{
header{
width: 100%;
padding: 0 1.5rem;
align-self: flex-start;
.icon{
stroke-width: 8;
margin-right: 1rem;
height: 0.8rem;
cursor: pointer;
}
sm-button{
margin: 0 0 0 auto;
&::part(button){
padding: 0.5rem 1rem;
}
}
}
}
#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: 0.4rem;
box-shadow: 0 0.1rem 0.1rem #00000010, 0 0.2rem 0.5rem #00000020;
width: 100%;
.contact{
grid-template-columns: auto 1fr;
grid-template-areas: 'dp .' 'dp .';
}
sm-menu{
display: none;
}
}
#contacts, #mails{
position: relative;
grid-template-rows: max-content 1fr;
height: calc(100vh - 3.5rem);
header{
padding: 1rem 1.5rem;
sm-button{
margin: 0 0 0 auto;
.icon{
height: 0.9rem;
width: 0.9rem;
align-self: center;
stroke-width: 8;
margin-left: 0;
margin-right: 0.5rem;
}
&[variant="outlined"] .icon{
stroke: var(--accent-color);
}
}
}
}
#chat_page{
overflow-y: hidden;
}
#chat{
height: 100vh;
grid-template-rows: max-content 1fr max-content;
header{
padding: 0.5rem 1rem;
border-bottom: solid 1px rgba(var(--text-color), 0.16);
.back-button{
margin-right: 0.2rem;
}
.initial{
margin-right: 1rem;
}
h4{
font-weight: 500;
}
h5{
font-weight: 400;
}
sm-menu{
margin-left: 1rem;
}
}
footer{
align-items: flex-end;
padding: 0.5rem 1rem;
border-top: solid 1px rgba(var(--text-color), 0.16);
sm-button{
margin: 0;
margin-left: 1rem;
}
sm-button::part(button){
padding: 0.8rem;
}
sm-textarea{
margin: 0;
}
}
#type_message{
margin: 0;
}
.message{
position: relative;
display: inline-flex;
flex-direction: column;
padding: 0.4rem 0.8rem;
width: 100%;
font-size: 0.94rem;
max-width: max-content;
margin-bottom: 0.4rem;
margin-top: 0.8rem;
box-shadow: 0 1px 0.1rem #00000020;
overflow-wrap: break-word;
word-wrap: break-word;
white-space: pre-wrap;
.time{
align-self: flex-end;
margin-top: auto;
margin-left: 0.4rem;
font-size: 0.8em;
color: rgba(var(--text-color), 0.6);
}
}
.sent{
margin-left: auto;
background: rgba(var(--text-color), 0.06);
border-radius: 0.6rem 0 0.6rem 0.6rem;
}
.received{
border-radius: 0 0.6rem 0.6rem 0.6rem;
border: solid 1px rgba(var(--text-color), 0.1);
}
.sent + .sent,
.received + .received {
border-radius: 0.6rem;
margin-top: 0;
}
}
#chat_container{
padding: 0 1rem;
margin-bottom: 1rem;
}
#new_conversation, #no_mails{
height: 100%;
justify-content: center;
text-align: center;
padding: 1.5rem;
p{
margin-top: 0.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), 0.4);
}
#contacts_container,
#chat_container,
#inbox_mail_container,
#sent_mail_container,
#mail{
width: 100%;
flex-direction: column;
height: 100%;
overflow-y: auto;
}
#contacts_container:empty{
display: none;
}
#contacts_container:not(:empty) ~ .empty-state{
display: none;
}
sm-tab-panels{
overflow: hidden auto;
}
sm-tab-header{
--accent-color: rgba(var(--text-color), 0.7);
}
#inbox_mail_container,
#sent_mail_container
{
padding-bottom: 6rem;
}
#chat, #mail{
background: rgba(var(--foreground-color), 0.7);
}
#mail{
height: 100vh;
padding: 1.5rem;
align-items: flex-start;
.flex{margin-top: 1rem;
sm-button:first-of-type{
margin-right: 0.5rem;
}
}
}
#settings_page{
height: calc(100vh - 3.5rem);
overflow-y: auto;
padding: 1.5rem;
h4{
margin-bottom: 0.3rem;
text-transform: capitalize;
}
h4:not(:first-of-type){
margin-top: 1.5rem;
}
p{
max-width: 60ch;
}
header{
margin-bottom: 1.5rem;
}
.flex sm-button{
margin: 0;
margin-left: 1rem;
}
sm-switch{
padding-left: 1rem;
}
sm-button{
width: 100%;
}
}
@media screen and (max-width: 640px){
.hide-on-mobile{
position: fixed;
max-height: 0;
opacity: 0;
pointer-events: none;
}
#sign_in{
grid-template-areas: 'illustration' '.';
height: 100%;
}
#sign_in_illustration{
grid-area: illustration;
}
#chat{
header{
h5{
width: calc(100vw - 12rem);
}
}
.message{
width: fit-content;
max-width: 90%;
}
}
#settings_page{
padding-bottom: 3.5rem;
}
}
@media only screen and (min-width: 640px){
::-webkit-scrollbar{
width: 0.5rem;
}
::-webkit-scrollbar-thumb{
background: rgba(var(--text-color), 0.2);
&:hover{
background: rgba(var(--text-color), 0.5);
}
}
.hide-on-desktop{
display: none !important;
}
.page{
padding-bottom: 0;
}
.fab{
position: absolute;
bottom: 0;
}
.logo-section{
padding: 2rem 3rem;
margin-bottom: 2rem;
}
#sign_in{
align-items: center;
gap: 4vw;
grid-template-columns: 1.5fr 1fr;
padding: 0 4vw;
.left{
sm-button:last-of-type{
margin-left: 0.5rem;
}
h4{
color: var(--accent-color);
}
}
.circle:nth-of-type(1){
right: -40vh;
width: 80vh;
height: 80vh;
}
.circle:nth-of-type(2){
right: -70vh;
width: 140vh;
height: 140vh;
}
}
#sign_in_popup{
.icon{
width: 1.2rem;
height: 1.2rem;
cursor: pointer;
}
}
#main_navbar{
flex-direction: column;
position: relative;
padding: 0.5rem;
box-shadow: none;
height: auto;
.navbar-item{
height: auto;
justify-content: flex-start;
flex-direction: row;
flex: none;
padding: 1rem 0.5rem;
border-radius: 0.4rem;
.icon{
height: 1.2rem;
width: 2.4rem;
}
}
.logo-section{
padding: 0 1rem;
}
.active{
background: rgba(var(--text-color), 0.06);
border-radius: 0.4rem;
}
.label{
display: none;
}
}
#compose_mail_popup, #add_contact_popup, #reply_mail_popup{
header{
padding: 1.5rem 1.5rem 0 1.5rem;
}
}
#add_contact_popup::part(popup){
min-width: 24rem;
}
#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: 50ch ;
}
}
}
#chat_page, #mail_page{
grid-template-columns: 20rem 1fr;
}
#contacts, #mails{
height: 100vh;
background: rgba(var(--text-color), 0.04);
backdrop-filter: blur(1rem);
}
#settings_page{
height: 100vh;
section{
display: grid;
grid-template-columns: 1fr 1fr;
gap: 3rem;
grid-auto-flow: column;
}
sm-button{
width: max-content;
}
}
.contact.active,
.mail-card.active{
background: rgba(var(--text-color), 0.06);
}
.card{
display: inline-flex;
width: auto;
}
}
@media only screen and (min-width: 1280px){
#sign_in{
gap: 4vw;
padding: 0 12vw;
.title-font{
font-size: 4rem;
}
}
#main_navbar{
align-items: flex-start;
.navbar-item{
padding: 1rem 0.8rem;
width: 100%;
.icon{
width: 2rem;
margin-right: 0.8rem;
}
}
.label{
display: block;
}
}
#chat_page, #mail_page{
grid-template-columns: 22rem 1fr;
}
#chat{
header{
padding: 0.5rem 1.5rem;
}
#chat_container{
padding: 1rem 1.5rem;
}
}
}
@media only screen and (min-width: 1920px){
}
@media only screen and (min-width: 2048px){
body{
font-size: 20px;
}
}
@media (hover: hover){
.contact:hover, .mail-card:hover, .navbar-item:hover{
background: rgba(var(--text-color), 0.06);
cursor: pointer;
}
.contact sm-menu{
opacity: 0;
}
.contact:hover sm-menu,
sm-menu:focus-within{
opacity: 1;
}
}