ocrcc-chatbox/src/components/_chat.scss

549 lines
10 KiB
SCSS
Raw Normal View History

2020-05-06 23:46:59 +00:00
* {
box-sizing: border-box;
}
2020-02-01 05:30:58 +00:00
2020-02-24 04:12:47 +00:00
@keyframes slideInUp {
from {
transform: translate3d(0, 100%, 0);
display: inherit;
visibility: visible;
}
to {
transform: translate3d(0, 0, 0);
}
}
@keyframes slideOutDown {
from {
transform: translate3d(0, 0, 0);
}
to {
display: none;
visibility: hidden;
transform: translate3d(0, 100%, 0);
}
}
.docked-widget {
position: fixed;
bottom: 10px;
right: 10px;
z-index: 9999;
width: 400px;
2020-03-15 04:47:19 +00:00
max-width: 100vw;
2020-05-06 23:46:59 +00:00
font-size: $base-font-size;
2020-02-24 04:12:47 +00:00
}
.dock {
cursor: pointer;
display: flex;
align-items: center;
justify-content: space-between;
width: 400px;
max-width: calc(100vw - 10px);
color: $white;
font-family: $theme-font;
2020-05-06 23:46:59 +00:00
font-size: 1em;
2020-02-24 04:12:47 +00:00
border: none;
color: $white;
2020-05-06 23:46:59 +00:00
font-size: 1em;
2020-02-24 04:12:47 +00:00
line-height: 1;
background-color: transparent;
2020-05-07 00:39:28 +00:00
padding: 5px;
2020-02-24 04:12:47 +00:00
#open-chatbox-label {
background: $theme-color;
2020-05-06 23:46:59 +00:00
padding: 0.75em;
2020-02-24 04:12:47 +00:00
flex: 1 1 auto;
text-align: left;
2020-05-06 23:46:59 +00:00
margin-right: 0.25em;
2020-04-29 03:54:23 +00:00
border: 1px solid $white;
2020-05-06 23:46:59 +00:00
border-radius: 0.625em;
transition: all 0.2s ease-in-out;
2020-02-24 04:12:47 +00:00
}
.label-icon {
background: $theme-color;
2020-05-06 23:46:59 +00:00
height: 2.625em;
width: 2.625em;
border-radius: 2.625em;
2020-02-24 04:12:47 +00:00
display: flex;
justify-content: center;
align-items: center;
2020-04-29 03:54:23 +00:00
border: 1px solid $white;
transition: all 0.2s ease-in-out;
2020-02-25 04:20:40 +00:00
}
&:hover {
#open-chatbox-label, .label-icon {
border: 1px solid $dark-color;
2020-02-26 00:50:43 +00:00
box-shadow: inset 0px 0px 0px 1px $dark-color;
2020-02-25 04:20:40 +00:00
}
}
&:focus {
outline: none;
#open-chatbox-label, .label-icon {
border: 1px solid $dark-color;
2020-02-26 00:50:43 +00:00
box-shadow: inset 0px 0px 0px 1px $dark-color;
2020-02-26 01:21:09 +00:00
background-color: $theme-highlight-color;
2020-02-25 04:20:40 +00:00
}
2020-02-24 04:12:47 +00:00
}
}
.widget {
width: 400px;
max-width: calc(100vw - 10px);
border-bottom: none;
2020-05-26 13:22:08 +00:00
margin: 0;
2020-02-24 04:12:47 +00:00
animation-duration: 0.2s;
animation-fill-mode: forwards;
&-entering {
animation-name: slideInUp;
}
&-entered {
display: inherit;
visibility: visible;
}
&-exiting {
animation-name: slideOutDown;
}
&-exited {
display: none;
visibility: hidden;
}
&-header {
display: flex;
align-items: center;
2020-05-06 23:46:59 +00:00
margin-bottom: 0.2em;
2020-02-24 04:12:47 +00:00
justify-content: flex-end;
2020-04-23 14:25:24 +00:00
flex: 0 0 auto;
2020-02-24 04:12:47 +00:00
&-title {
display: flex;
flex-grow: 1;
}
&-minimize {
cursor: pointer;
display: flex;
align-items: center;
justify-content: flex-start;
border: 1px solid $dark-color !important;
background: $white;
color: $dark-color;
flex: 1 1 auto;
font-family: $theme-font;
2020-05-06 23:46:59 +00:00
font-size: 1em;
padding: 0.5em;
border-radius: 0.625em;
transition: all 0.2s ease-in-out;
&:hover {
2020-02-26 00:50:43 +00:00
box-shadow: inset 0px 0px 0px 1px $dark-color;
}
&:focus {
outline: none;
2020-02-26 00:50:43 +00:00
box-shadow: inset 0px 0px 0px 1px $dark-color;
background-color: $theme-light-color;
}
2020-02-24 04:12:47 +00:00
}
&-close {
2020-05-06 23:46:59 +00:00
font-size: inherit;
2020-02-24 04:12:47 +00:00
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid $dark-color !important;
background: $white;
2020-05-06 23:46:59 +00:00
border-radius: 2.625em;
padding: 0.5em;
margin-left: 0.2em;
2020-02-24 04:12:47 +00:00
color: $dark-color;
transition: all 0.2s ease-in-out;
2020-05-06 23:46:59 +00:00
width: 2.625em;
&:hover {
2020-02-26 00:50:43 +00:00
box-shadow: inset 0px 0px 0px 1px $dark-color;
}
&:focus {
outline: none;
2020-02-26 00:50:43 +00:00
box-shadow: inset 0px 0px 0px 1px $dark-color;
background-color: $theme-light-color;
}
2020-02-24 04:12:47 +00:00
}
}
&-body {
background: white;
padding: 10px;
height: 150px;
}
&-footer {
background: green;
line-height: 30px;
padding-left: 10px;
}
2020-02-25 04:20:40 +00:00
button {
transition: all 0.2s ease-in-out;
&:hover {
2020-02-26 00:50:43 +00:00
box-shadow: inset 0px 0px 0px 1px $dark-color;
2020-02-25 04:20:40 +00:00
}
&:focus {
2020-03-25 23:01:29 +00:00
background-color: $theme-light-color;
2020-02-25 04:20:40 +00:00
outline: none;
}
}
2020-02-24 04:12:47 +00:00
}
.btn-icon {
2020-05-06 23:46:59 +00:00
font-size: 1.5em;
2020-02-24 04:12:47 +00:00
line-height: 1;
transform: rotateX(0deg);
transition: all 0.5s linear;
display: flex;
align-items: center;
justify-content: center;
}
.arrow {
2020-05-06 23:46:59 +00:00
margin-right: 0.5em;
transform: translateY(0.15em);
2020-02-24 04:12:47 +00:00
&.opened {
color: $dark-color;
2020-05-06 23:46:59 +00:00
transform: rotateX(180deg) translateY(0.15em);
2020-02-24 04:12:47 +00:00
}
}
2020-05-07 00:57:28 +00:00
#safesupport-chatbox {
2020-02-01 05:30:58 +00:00
font-family: $theme-font;
display: flex;
flex-direction: column;
height: calc(40vh + 180px);
2020-02-14 16:38:20 +00:00
max-height: 100vh;
2020-05-07 00:39:28 +00:00
padding: 5px;
2020-02-01 05:30:58 +00:00
2020-02-16 23:31:50 +00:00
a {
color: inherit;
2020-02-25 04:20:40 +00:00
transition: all 0.2s ease-in-out;
&:hover, &:focus {
color: $theme-color;
}
2020-02-16 23:31:50 +00:00
}
2020-02-01 05:30:58 +00:00
.message-window {
2020-02-24 04:12:47 +00:00
background-color: $white;
border: 1px solid $dark-color;
2020-02-14 16:38:20 +00:00
flex: 1 1 auto;
2020-05-06 23:46:59 +00:00
padding: 0.5em;
overflow: scroll;
2020-02-01 05:30:58 +00:00
display: flex;
flex-direction: column-reverse;
2020-02-04 06:13:47 +00:00
justify-content: space-between;
2020-05-06 23:46:59 +00:00
margin-bottom: 0.2em;
border-radius: 0.625em;
2020-02-04 06:13:47 +00:00
}
.notices {
2020-02-24 04:12:47 +00:00
color: $gray-color;
2020-05-06 23:46:59 +00:00
font-size: 0.9em;
2020-02-16 23:31:50 +00:00
> div {
2020-05-06 23:46:59 +00:00
margin-top: 0.5em;
margin-bottom: 0.5em;
2020-02-16 23:31:50 +00:00
}
2020-02-01 05:30:58 +00:00
}
.message {
2020-05-06 23:46:59 +00:00
margin-top: 0.5em;
margin-bottom: 0.5em;
2020-02-01 05:30:58 +00:00
.text {
width: fit-content;
2020-04-29 03:54:23 +00:00
line-height: 1.2;
2020-02-23 21:57:16 +00:00
}
.buttons {
display: flex;
align-items: center;
button {
background-color: transparent;
2020-05-06 23:46:59 +00:00
padding: 0.25em 0.5em;
font-size: 0.9em;
color: inherit;
font-weight: bold;
font-family: $theme-font;
cursor: pointer;
display: flex;
flex: 0 1 auto;
border: 1px solid $theme-color;
transition: all 0.2s ease-in-out;
2020-05-06 23:46:59 +00:00
border-radius: 0.625em;
margin-left: 0.25em;
&:hover {
border: 1px solid $dark-color;
box-shadow: inset 0px 0px 0px 1px $dark-color;
}
&:focus {
outline: none;
color: $white;
border: 1px solid $dark-color;
box-shadow: inset 0px 0px 0px 1px $dark-color;
background-color: $theme-highlight-color;
}
}
}
2020-02-23 21:57:16 +00:00
&.from-bot {
2020-02-24 04:12:47 +00:00
color: $gray-color;
2020-05-06 23:46:59 +00:00
font-size: 0.9em;
2020-02-01 05:30:58 +00:00
}
&.from-me {
display: flex;
justify-content: flex-end;
2020-04-23 04:04:48 +00:00
&.placeholder {
opacity: 0.5;
}
2020-02-01 05:30:58 +00:00
.text {
2020-02-23 21:57:16 +00:00
border: 1px solid $theme-color;
2020-02-01 05:30:58 +00:00
background-color: $theme-color;
color: $white;
2020-05-07 00:39:28 +00:00
border-radius: 1em 1em 0 1em;
2020-02-01 05:30:58 +00:00
margin-left: 10%;
2020-05-07 00:39:28 +00:00
padding: 0.3em 0.6em;
2020-02-01 05:30:58 +00:00
}
2020-03-15 04:47:19 +00:00
a {
color: $white;
&:hover, &:focus {
color: $light-purple;
}
}
2020-02-01 05:30:58 +00:00
}
&.from-support {
display: flex;
justify-content: flex-start;
.text {
2020-02-24 04:12:47 +00:00
border: 1px solid $light-color;
background-color: $light-color;
2020-02-01 05:30:58 +00:00
color: $dark-color;
2020-05-07 00:39:28 +00:00
border-radius: 1em 1em 1em 0;
2020-02-01 05:30:58 +00:00
margin-right: 10%;
2020-05-06 23:46:59 +00:00
padding: 0.5em 0.75em;
2020-02-01 05:30:58 +00:00
}
2020-03-15 04:47:19 +00:00
a {
color: $dark-color;
&:hover, &:focus {
color: $medium-purple;
}
}
2020-02-01 05:30:58 +00:00
}
}
.input-window {
flex: 0 0 auto;
form {
display: flex;
align-items: center;
margin-bottom: 0;
}
input[type="submit"] {
background-color: $theme-color;
height: 100%;
2020-05-06 23:46:59 +00:00
padding: 0.5em 1em;
font-size: 1em;
2020-02-01 05:30:58 +00:00
color: $white;
font-weight: bold;
font-family: $theme-font;
cursor: pointer;
display: flex;
2020-02-25 04:20:40 +00:00
flex: 0 1 auto;
border: 1px solid $theme-color;
transition: all 0.2s ease-in-out;
2020-05-06 23:46:59 +00:00
border-radius: 0.625em;
2020-02-25 04:20:40 +00:00
&:hover {
border: 1px solid $dark-color;
2020-02-26 00:50:43 +00:00
box-shadow: inset 0px 0px 0px 1px $dark-color;
2020-02-25 04:20:40 +00:00
}
&:focus {
outline: none;
border: 1px solid $dark-color;
2020-02-26 00:50:43 +00:00
box-shadow: inset 0px 0px 0px 1px $dark-color;
2020-02-26 01:21:09 +00:00
background-color: $theme-highlight-color;
2020-02-25 04:20:40 +00:00
}
2020-02-01 05:30:58 +00:00
}
2020-03-25 23:01:29 +00:00
.message-input-container {
display: flex;
flex: 1 1 auto;
position: relative;
input[type="text"] {
2020-05-06 23:46:59 +00:00
font-size: 1em;
padding: 0.5em;
2020-03-25 23:01:29 +00:00
padding-right: 32px;
border: none;
display: flex;
flex: 1 1 auto;
background: $white;
color: $dark-color;
font-family: $theme-font;
2020-05-06 23:46:59 +00:00
margin-right: 0.2em;
2020-03-25 23:01:29 +00:00
transition: all 0.2s ease-in-out;
2020-05-06 23:46:59 +00:00
border-radius: 0.625em;
2020-03-25 23:01:29 +00:00
border: 1px solid $dark-color;
&:hover {
box-shadow: inset 0px 0px 0px 1px $dark-color;
}
&:focus {
outline: none;
box-shadow: inset 0px 0px 0px 1px $dark-color;
background: $theme-light-color;
}
}
.emoji-button-container {
position: absolute;
right: 6px;
top: 0;
bottom: 0;
height: 100%;
display: flex;
align-items: center;
justify-content: flex-start;
button {
transition: all 0.2s ease-in-out;
&:hover {
box-shadow: none;
}
&:focus {
outline: none;
}
&#emoji-button {
background: transparent;
border: none;
padding: 0;
margin-right: 3px;
transition: all 0.2s ease-in-out;
&:hover {
svg path#icon {
fill: $theme-color;
}
}
&:focus {
svg path#icon {
fill: $theme-highlight-color;
}
}
}
}
}
.emoji-picker {
animation-duration: 0.2s;
animation-fill-mode: forwards;
position: absolute;
bottom: 32px;
right: -4px;
&-entering {
animation-name: slideInUp;
opacity: 0.5;
}
&-entered {
display: inherit;
visibility: visible;
opacity: 1;
}
&-exiting {
animation-name: slideOutDown;
opacity: 0.5;
}
&-exited {
display: none;
visibility: hidden;
opacity: 0;
}
}
}
2020-02-01 05:30:58 +00:00
}
2020-02-14 16:38:20 +00:00
.highlight-text {
color: $theme-color;
}
2020-03-25 23:01:29 +00:00
.pos-relative {
position: relative;
}
}
.hidden {
display: none;
2020-02-25 04:20:40 +00:00
}
@media screen and (max-width: 420px){
.docked-widget {
right: 0;
left: 0;
bottom: 0;
}
.dock, .widget {
width: 100vw;
max-width: 100vw;
2020-05-06 23:46:59 +00:00
padding: 5px;
2020-02-25 04:20:40 +00:00
}
2020-05-07 00:57:28 +00:00
#safesupport-chatbox {
height: calc(180px + 60vh);
2020-02-25 04:20:40 +00:00
}
}
2020-03-13 04:05:12 +00:00
2020-03-25 23:01:29 +00:00
@media screen and (max-width: 360px){
2020-05-07 00:57:28 +00:00
#safesupport-chatbox .input-window .message-input-container .emoji-picker {
2020-03-25 23:01:29 +00:00
position: fixed;
left: 5px;
right: 5px;
bottom: 42px;
}
2020-03-13 04:05:12 +00:00
}