2019-04-30 11:11:25 +08:00
|
|
|
@keyframes bounceIn {
|
2019-12-06 09:58:08 +08:00
|
|
|
from,
|
|
|
|
20%,
|
|
|
|
40%,
|
|
|
|
60%,
|
|
|
|
80%,
|
|
|
|
to {
|
|
|
|
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
0% {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale3d(0.3, 0.3, 0.3);
|
|
|
|
}
|
|
|
|
|
|
|
|
20% {
|
|
|
|
transform: scale3d(1.1, 1.1, 1.1);
|
|
|
|
}
|
|
|
|
|
|
|
|
40% {
|
|
|
|
transform: scale3d(0.9, 0.9, 0.9);
|
|
|
|
}
|
|
|
|
|
|
|
|
60% {
|
|
|
|
opacity: 1;
|
|
|
|
transform: scale3d(1.03, 1.03, 1.03);
|
|
|
|
}
|
|
|
|
|
|
|
|
80% {
|
|
|
|
transform: scale3d(0.97, 0.97, 0.97);
|
|
|
|
}
|
|
|
|
|
|
|
|
to {
|
|
|
|
opacity: 1;
|
|
|
|
transform: scale3d(1, 1, 1);
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes bounceOut {
|
2019-12-06 09:58:08 +08:00
|
|
|
20% {
|
|
|
|
transform: scale3d(0.9, 0.9, 0.9);
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
50%,
|
|
|
|
55% {
|
|
|
|
opacity: 1;
|
|
|
|
transform: scale3d(1.1, 1.1, 1.1);
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
to {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale3d(0.3, 0.3, 0.3);
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Toast {
|
2021-09-23 21:15:55 +08:00
|
|
|
display: flex;
|
2021-11-24 21:49:08 +08:00
|
|
|
flex-flow: row nowrap;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: flex-start;
|
2021-09-23 21:15:55 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&-wrap {
|
|
|
|
pointer-events: none;
|
|
|
|
position: fixed;
|
|
|
|
z-index: $zindex-toast;
|
|
|
|
}
|
|
|
|
|
2021-09-24 11:22:46 +08:00
|
|
|
max-width: var(--Toast-width);
|
2019-12-06 09:58:08 +08:00
|
|
|
pointer-events: auto;
|
2020-12-21 10:08:40 +08:00
|
|
|
margin-bottom: var(--gap-xs);
|
2020-06-09 14:44:38 +08:00
|
|
|
|
2023-03-15 18:47:17 +08:00
|
|
|
padding: var(--Toast-paddingTop) var(--Toast-paddingRight)
|
|
|
|
var(--Toast-paddingBottom) var(--Toast-paddingLeft);
|
2020-12-21 10:08:40 +08:00
|
|
|
box-shadow: var(--Toast-box-shadow);
|
2023-03-15 18:47:17 +08:00
|
|
|
border-radius: var(--Toast-top-left-border-radius)
|
2023-04-21 15:27:49 +08:00
|
|
|
var(--Toast-top-right-border-radius) var(--Toast-bottom-right-border-radius)
|
2023-03-15 18:47:17 +08:00
|
|
|
var(--Toast-bottom-left-border-radius);
|
2020-12-21 10:08:40 +08:00
|
|
|
border: var(--Toast-border-width) solid;
|
|
|
|
color: var(--Toast-color);
|
2019-12-06 09:58:08 +08:00
|
|
|
position: relative;
|
2020-12-21 10:08:40 +08:00
|
|
|
opacity: var(--Toast-opacity);
|
2019-12-06 09:58:08 +08:00
|
|
|
opacity: 0;
|
|
|
|
transform: translateZ(0);
|
2022-05-18 10:03:56 +08:00
|
|
|
width: px2rem(400px);
|
2019-12-06 09:58:08 +08:00
|
|
|
|
|
|
|
&.in,
|
|
|
|
&.out {
|
|
|
|
animation-fill-mode: both;
|
2021-01-04 16:45:43 +08:00
|
|
|
animation-duration: var(--animation-duration);
|
2019-12-06 09:58:08 +08:00
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.in {
|
|
|
|
animation-name: bounceIn;
|
|
|
|
}
|
|
|
|
|
|
|
|
&.out {
|
|
|
|
animation-name: bounceOut;
|
|
|
|
}
|
|
|
|
|
2019-12-29 10:48:53 +08:00
|
|
|
&-close {
|
2021-09-24 11:22:46 +08:00
|
|
|
display: inline-flex;
|
2021-11-24 21:49:08 +08:00
|
|
|
font-size: var(--fontSizeLg);
|
|
|
|
line-height: var(--gap-xl);
|
|
|
|
height: var(--gap-xl);
|
|
|
|
color: var(--Toast-close-color);
|
|
|
|
margin-left: var(--gap-sm);
|
|
|
|
align-items: center;
|
|
|
|
cursor: pointer;
|
2019-12-29 10:48:53 +08:00
|
|
|
|
|
|
|
&:hover {
|
2023-04-21 15:27:49 +08:00
|
|
|
font-size: var(--fontSizeLg);
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Toast-close--onHover-color);
|
2019-12-29 10:48:53 +08:00
|
|
|
}
|
2021-11-24 21:49:08 +08:00
|
|
|
|
|
|
|
& > svg {
|
|
|
|
top: 0;
|
|
|
|
}
|
2019-12-29 10:48:53 +08:00
|
|
|
}
|
|
|
|
|
2021-11-24 21:49:08 +08:00
|
|
|
&-content {
|
|
|
|
flex: 1;
|
|
|
|
display: flex;
|
|
|
|
flex-flow: column nowrap;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: flex-start;
|
|
|
|
|
|
|
|
.#{$ns}Toast-title {
|
|
|
|
color: var(--text-color);
|
|
|
|
font-size: var(--fontSizeBase);
|
|
|
|
font-weight: 500;
|
|
|
|
line-height: var(--gap-xl);
|
|
|
|
margin-bottom: var(--gap-xs);
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Toast-body {
|
|
|
|
display: inline-block;
|
|
|
|
vertical-align: middle;
|
|
|
|
white-space: pre-wrap;
|
|
|
|
flex-grow: 1;
|
|
|
|
line-height: var(--gap-xl);
|
2021-12-06 10:21:05 +08:00
|
|
|
.#{$ns}Html {
|
|
|
|
word-break: break-word;
|
|
|
|
}
|
2021-11-24 21:49:08 +08:00
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
2020-06-09 14:44:38 +08:00
|
|
|
&-icon {
|
|
|
|
display: inline-flex;
|
2019-12-06 09:58:08 +08:00
|
|
|
text-rendering: auto;
|
|
|
|
-webkit-font-smoothing: antialiased;
|
2020-06-09 14:44:38 +08:00
|
|
|
vertical-align: middle;
|
2021-11-24 21:49:08 +08:00
|
|
|
margin-right: var(--gap-sm);
|
|
|
|
height: var(--gap-xl);
|
|
|
|
line-height: var(--gap-xl);
|
|
|
|
align-items: center;
|
2020-06-09 14:44:38 +08:00
|
|
|
|
|
|
|
> svg {
|
|
|
|
top: 0;
|
2020-12-21 10:08:40 +08:00
|
|
|
width: var(--Toast-icon-width);
|
|
|
|
height: var(--Toast-icon-height);
|
2020-06-09 14:44:38 +08:00
|
|
|
color: inherit;
|
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// colors
|
|
|
|
&--error {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Toast--danger-color);
|
|
|
|
background: var(--Toast--danger-bgColor);
|
2023-03-15 18:47:17 +08:00
|
|
|
font-size: var(--Toast--danger-fontSize);
|
|
|
|
font-weight: var(--Toast--danger-fontWeight);
|
|
|
|
background: var(--Toast--danger-bgColor);
|
|
|
|
border-width: var(--Toast--danger-top-border-width)
|
|
|
|
var(--Toast--danger-right-border-width)
|
|
|
|
var(--Toast--danger-bottom-border-width)
|
|
|
|
var(--Toast--danger-left-border-width);
|
|
|
|
border-style: var(--Toast--danger-top-border-style)
|
|
|
|
var(--Toast--danger-right-border-style)
|
|
|
|
var(--Toast--danger-bottom-border-style)
|
|
|
|
var(--Toast--danger-left-border-style);
|
|
|
|
border-color: var(--Toast--danger-top-border-color)
|
|
|
|
var(--Toast--danger-right-border-color)
|
|
|
|
var(--Toast--danger-bottom-border-color)
|
|
|
|
var(--Toast--danger-left-border-color);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&--warning {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Toast--warning-color);
|
|
|
|
background: var(--Toast--warning-bgColor);
|
2023-03-15 18:47:17 +08:00
|
|
|
font-size: var(--Toast--warning-fontSize);
|
|
|
|
font-weight: var(--Toast--warning-fontWeight);
|
|
|
|
background: var(--Toast--warning-bgColor);
|
|
|
|
border-width: var(--Toast--warning-top-border-width)
|
|
|
|
var(--Toast--warning-right-border-width)
|
|
|
|
var(--Toast--warning-bottom-border-width)
|
|
|
|
var(--Toast--warning-left-border-width);
|
|
|
|
border-style: var(--Toast--warning-top-border-style)
|
|
|
|
var(--Toast--warning-right-border-style)
|
|
|
|
var(--Toast--warning-bottom-border-style)
|
|
|
|
var(--Toast--warning-left-border-style);
|
|
|
|
border-color: var(--Toast--warning-top-border-color)
|
|
|
|
var(--Toast--warning-right-border-color)
|
|
|
|
var(--Toast--warning-bottom-border-color)
|
|
|
|
var(--Toast--warning-left-border-color);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&--info {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Toast--info-color);
|
2023-03-15 18:47:17 +08:00
|
|
|
font-size: var(--Toast--info-fontSize);
|
|
|
|
font-weight: var(--Toast--info-fontWeight);
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--Toast--info-bgColor);
|
2023-03-15 18:47:17 +08:00
|
|
|
border-width: var(--Toast--info-top-border-width)
|
|
|
|
var(--Toast--info-right-border-width)
|
|
|
|
var(--Toast--info-bottom-border-width)
|
|
|
|
var(--Toast--info-left-border-width);
|
|
|
|
border-style: var(--Toast--info-top-border-style)
|
|
|
|
var(--Toast--info-right-border-style)
|
|
|
|
var(--Toast--info-bottom-border-style)
|
|
|
|
var(--Toast--info-left-border-style);
|
|
|
|
border-color: var(--Toast--info-top-border-color)
|
|
|
|
var(--Toast--info-right-border-color)
|
|
|
|
var(--Toast--info-bottom-border-color)
|
|
|
|
var(--Toast--info-left-border-color);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
2019-12-06 09:58:08 +08:00
|
|
|
&--success {
|
2020-12-21 10:08:40 +08:00
|
|
|
color: var(--Toast--success-color);
|
2023-03-15 18:47:17 +08:00
|
|
|
font-size: var(--Toast--success-fontSize);
|
|
|
|
font-weight: var(--Toast--success-fontWeight);
|
2020-12-21 10:08:40 +08:00
|
|
|
background: var(--Toast--success-bgColor);
|
2023-03-15 18:47:17 +08:00
|
|
|
border-width: var(--Toast--success-top-border-width)
|
|
|
|
var(--Toast--success-right-border-width)
|
|
|
|
var(--Toast--success-bottom-border-width)
|
|
|
|
var(--Toast--success-left-border-width);
|
|
|
|
border-style: var(--Toast--success-top-border-style)
|
|
|
|
var(--Toast--success-right-border-style)
|
|
|
|
var(--Toast--success-bottom-border-style)
|
|
|
|
var(--Toast--success-left-border-style);
|
|
|
|
border-color: var(--Toast--success-top-border-color)
|
|
|
|
var(--Toast--success-right-border-color)
|
|
|
|
var(--Toast--success-bottom-border-color)
|
|
|
|
var(--Toast--success-left-border-color);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// positions
|
|
|
|
&-wrap--topRight {
|
2020-12-21 10:08:40 +08:00
|
|
|
top: var(--gap-base);
|
|
|
|
right: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap--topCenter {
|
2020-12-21 10:08:40 +08:00
|
|
|
top: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
left: 50%;
|
2022-02-17 17:42:40 +08:00
|
|
|
transform: translateX(-50%);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap--topLeft {
|
2020-12-21 10:08:40 +08:00
|
|
|
top: var(--gap-base);
|
|
|
|
left: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap--bottomLeft {
|
2020-12-21 10:08:40 +08:00
|
|
|
left: var(--gap-base);
|
|
|
|
bottom: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap--bottomCenter {
|
|
|
|
left: 50%;
|
2022-02-17 17:42:40 +08:00
|
|
|
transform: translateX(-50%);
|
2020-12-21 10:08:40 +08:00
|
|
|
bottom: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-wrap--bottomRight {
|
2020-12-21 10:08:40 +08:00
|
|
|
bottom: var(--gap-base);
|
|
|
|
right: var(--gap-base);
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|
2022-02-17 17:42:40 +08:00
|
|
|
|
|
|
|
&-wrap--center {
|
|
|
|
top: 50%;
|
|
|
|
left: 50%;
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.#{$ns}Toast-mobile {
|
|
|
|
.#{$ns}Toast {
|
|
|
|
background-color: rgba($color: #000000, $alpha: 0.9);
|
|
|
|
border-radius: px2rem(4px);
|
|
|
|
color: #fff;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
padding: var(--gap-base) var(--gap-md);
|
|
|
|
text-align: center;
|
2022-05-18 10:03:56 +08:00
|
|
|
width: auto;
|
2022-02-17 17:42:40 +08:00
|
|
|
|
|
|
|
&-title {
|
|
|
|
color: #fff;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-body {
|
|
|
|
line-height: px2rem(18px);
|
|
|
|
font-size: var(--fontSizeMd);
|
|
|
|
}
|
|
|
|
|
|
|
|
&-icon {
|
|
|
|
margin-right: 0 !important;
|
|
|
|
margin: var(--gap-base) 0;
|
|
|
|
width: px2rem(40px);
|
|
|
|
height: px2rem(40px);
|
|
|
|
|
|
|
|
> svg {
|
|
|
|
width: px2rem(40px);
|
|
|
|
height: px2rem(40px);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
& &--has-icon {
|
|
|
|
min-width: px2rem(120px);
|
|
|
|
padding-bottom: var(--gap-lg);
|
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
}
|