ui-lib/css/popup.scss
2023-04-10 17:30:17 +08:00

214 lines
6.3 KiB
SCSS

@import './functions/func.scss';
@import './variables/definition.scss';
$headerLineHeight: 24px;
$buttonHeight: 28px;
.popup-mask {
position: fixed;
@include inset(0, 0, 0, 0);
background-color: rgba(0 0 0 /20%);
display: flex;
justify-content: center;
align-items: center;
opacity: 0;
z-index: 200;
transition: opacity .12s ease;
& {
--corner-radius: 6px;
--loading-size: 20px;
--loading-border-radius: 10px;
}
&.popup-active .popup-container {
transform: scale(1.1);
}
.popup-container {
min-width: 400px;
max-width: 800px;
background-color: var(--bg-color);
border-radius: var(--corner-radius);
box-shadow: 0 2px 8px rgba(0 0 0 /11%);
transition: opacity .12s ease, transform .12s ease;
position: absolute;
display: flex;
flex-direction: column;
.popup-header {
flex: 0 0 auto;
padding: 10px 12px 6px;
border-radius: var(--corner-radius) var(--corner-radius) 0 0;
line-height: $headerLineHeight;
user-select: none;
background-color: var(--title-bg-color);
color: var(--title-color);
display: flex;
align-items: center;
>div {
flex: 1 1 auto;
font-size: 1rem;
}
>svg {
flex: 0 0 auto;
width: $headerLineHeight;
height: $headerLineHeight;
fill: var(--title-color);
padding: 4px;
cursor: pointer;
box-sizing: border-box;
transition: opacity .12s ease;
&:hover {
opacity: .8;
}
}
}
.popup-body {
margin: 6px 10px;
flex: 1 1 auto;
line-height: $headerLineHeight;
position: relative;
min-height: 100px;
>.popup-loading {
position: absolute;
@include inset(0, 0, -46px, 0);
visibility: hidden;
opacity: 0;
transition: visibility 0s linear .12s, opacity .12s ease;
background-color: var(--loading-bg-color);
display: flex;
justify-content: center;
align-items: center;
z-index: 1;
>div {
background-color: var(--loading-fore-color);
border-radius: var(--loading-border-radius);
>svg {
width: var(--loading-size);
height: var(--loading-size);
padding: 20px;
animation: loading-spinner 1.2s infinite linear;
}
}
}
>.message-wrapper {
display: flex;
margin: 10px;
>svg {
width: 40px;
height: 40px;
&+span {
padding-left: 16px;
}
}
}
.setting-wrapper {
--line-height: 28px;
>.setting-item {
display: flex;
align-items: center;
line-height: var(--line-height);
margin: 4px 0;
>.setting-label {
flex: 0 0 auto;
width: 120px;
text-align: right;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding-right: 10px;
&.setting-required::after {
content: '*';
color: var(--red-color);
font-weight: bold;
}
&+* {
flex: 1 1 auto;
margin-right: 10px;
box-sizing: border-box;
height: var(--line-height);
line-height: var(--line-height);
}
&+input[type="text"],
&+input[type="email"],
&+input[type="tel"],
&+textarea {
border: 1px solid var(--border-color);
border-radius: var(--border-radius);
text-indent: var(--text-indent);
transition: border-color .12s ease;
&:hover {
border-color: var(--focus-color);
}
&:focus,
&:focus-visible {
outline: none;
}
}
&+.drop-wrapper>.drop-header>.drop-text {
font-size: 12px;
}
&+.checkbox-wrapper {
padding: 0;
}
}
}
}
}
.popup-footer {
flex: 0 0 auto;
display: flex;
align-items: center;
justify-content: flex-end;
padding: 4px 10px 16px 2px;
.popup-button {
margin-left: 12px;
border: none;
height: $buttonHeight;
line-height: $buttonHeight;
color: var(--title-color);
border-radius: var(--corner-radius);
padding: 0 16px;
box-sizing: border-box;
min-width: 70px;
text-align: center;
cursor: pointer;
user-select: none;
background-color: var(--title-bg-color);
transition: opacity .12s ease;
&:hover {
opacity: .8;
}
&:focus,
&:focus-visible {
outline: none;
}
}
}
}
}