ocrcc-chatbox/src/components/_chat.scss

397 lines
7.3 KiB
SCSS
Raw Normal View History

2020-02-25 04:20:40 +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;
}
.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;
font-size: 1rem;
border: none;
color: $white;
font-size: 1rem;
line-height: 1;
background-color: transparent;
padding: 5px;
2020-02-24 04:12:47 +00:00
#open-chatbox-label {
background: $theme-color;
padding: 0.75rem;
2020-02-24 04:12:47 +00:00
flex: 1 1 auto;
text-align: left;
margin-right: 0.25rem;
2020-02-25 04:20:40 +00:00
border: 1px solid $theme-color;
border-radius: 10px;
transition: all 0.2s ease-in-out;
2020-02-24 04:12:47 +00:00
}
.label-icon {
background: $theme-color;
height: 40px;
width: 40px;
border-radius: 40px;
display: flex;
justify-content: center;
align-items: center;
2020-02-25 04:20:40 +00:00
border: 1px solid $theme-color;
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;
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;
margin-bottom: 0.2rem;
justify-content: flex-end;
&-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;
font-size: 1rem;
padding: 0.5rem;
border-radius: 10px;
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 {
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid $dark-color !important;
background: $white;
border-radius: 40px;
height: 40px;
width: 40px;
margin-left: 0.2rem;
color: $dark-color;
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
}
}
&-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 {
background: $theme-light-color;
outline: none;
}
}
2020-02-24 04:12:47 +00:00
}
.btn-icon {
font-size: 1.5rem;
line-height: 1;
transform: rotateX(0deg);
transition: all 0.5s linear;
display: flex;
align-items: center;
justify-content: center;
}
.arrow {
margin-right: 0.5rem;
transform: translateY(5px);
&.opened {
color: $dark-color;
transform: rotateX(180deg) translateY(5px);
}
}
2020-02-01 05:30:58 +00:00
#ocrcc-chatbox {
font-family: $theme-font;
display: flex;
flex-direction: column;
height: calc(40vh + 180px);
2020-02-14 16:38:20 +00:00
max-height: 100vh;
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-02-01 05:30:58 +00:00
padding: 0.5rem;
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-02-24 04:12:47 +00:00
margin-bottom: 0.2rem;
border-radius: 10px;
2020-02-04 06:13:47 +00:00
}
.notices {
2020-02-24 04:12:47 +00:00
color: $gray-color;
2020-02-04 06:13:47 +00:00
font-size: 0.9rem;
2020-02-16 23:31:50 +00:00
> div {
2020-02-23 21:57:16 +00:00
margin-top: 0.5rem;
margin-bottom: 0.5rem;
2020-02-16 23:31:50 +00:00
}
2020-02-01 05:30:58 +00:00
}
.message {
2020-02-24 19:16:43 +00:00
margin-top: 0.5rem;
margin-bottom: 0.5rem;
2020-02-01 05:30:58 +00:00
.text {
width: fit-content;
2020-02-23 21:57:16 +00:00
}
&.from-bot {
2020-02-24 04:12:47 +00:00
color: $gray-color;
2020-02-23 21:57:16 +00:00
font-size: 0.9rem;
2020-02-01 05:30:58 +00:00
}
&.from-me {
display: flex;
justify-content: flex-end;
.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;
border-radius: 15px 15px 0 15px;
margin-left: 10%;
2020-02-23 21:57:16 +00:00
padding: 0.5rem 0.75rem;
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;
border-radius: 15px 15px 15px 0;
margin-right: 10%;
2020-02-23 21:57:16 +00:00
padding: 0.5rem 0.75rem;
2020-02-01 05:30:58 +00:00
}
}
}
.input-window {
flex: 0 0 auto;
form {
display: flex;
align-items: center;
margin-bottom: 0;
}
input[placeholder] {
text-overflow: ellipsis;
overflow: hidden;
}
2020-02-01 05:30:58 +00:00
input[type="text"] {
font-size: 1rem;
2020-02-24 04:12:47 +00:00
padding: 0.5rem;
2020-02-01 05:30:58 +00:00
border: none;
display: flex;
flex: 1 1 auto;
2020-02-24 04:12:47 +00:00
border: 1px solid $dark-color;
2020-02-26 01:21:09 +00:00
background: $white;
2020-02-01 05:30:58 +00:00
color: $dark-color;
font-family: $theme-font;
2020-02-24 04:12:47 +00:00
margin-right: 0.2rem;
2020-02-25 04:20:40 +00:00
transition: all 0.2s ease-in-out;
border-radius: 10px;
2020-02-01 05:30:58 +00:00
2020-02-26 00:50:43 +00:00
&:hover {
box-shadow: inset 0px 0px 0px 1px $dark-color;
}
2020-02-01 05:30:58 +00:00
&:focus {
2020-02-25 04:20:40 +00:00
outline: none;
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
background: $theme-light-color;
2020-02-01 05:30:58 +00:00
}
}
input[type="submit"] {
background-color: $theme-color;
height: 100%;
padding: 0.5rem 1rem;
font-size: 1rem;
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;
border-radius: 10px;
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-02-14 16:38:20 +00:00
.highlight-text {
color: $theme-color;
}
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;
}
#ocrcc-chatbox {
height: calc(180px + 60vh);
2020-02-25 04:20:40 +00:00
}
}