pocketbase/ui/src/scss/_overlay_panel.scss

272 lines
6.2 KiB
SCSS

.overlay-panel {
$padding: var(--baseSpacing);
$compactPadding: calc(#{$padding} - 7px);
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
align-self: flex-end;
margin-left: auto; // push to right edge
background: var(--baseColor);
height: 100%;
width: 580px;
max-width: 100%;
word-wrap: break-word;
@include shadowize();
.overlay-panel-section {
position: relative;
width: 100%;
margin: 0;
padding: $padding;
transition: box-shadow var(--baseAnimationSpeed);
&:empty {
display: none;
}
&:first-child {
border-top-left-radius: inherit;
border-top-right-radius: inherit;
}
&:last-child {
border-bottom-left-radius: inherit;
border-bottom-right-radius: inherit;
}
.btn {
flex-grow: 0;
}
}
img {
max-width: 100%;
}
hr {
background: var(--baseAlt2Color);
}
// header
.panel-header {
position: relative;
z-index: 2;
display: flex;
flex-wrap: wrap;
align-items:center;
column-gap: 10px;
row-gap: var(--baseSpacing);
padding: $compactPadding $padding;
& > * {
margin-top: 0;
margin-bottom: 0;
}
.btn-back {
margin-left: -10px; // visual alignment
}
.overlay-close {
$size: 35px;
z-index: 3;
outline: 0;
position: absolute;
right: 100%;
top: 20px;
margin: 0;
display: inline-flex;
align-items: center;
justify-content: center;
width: $size;
height: $size;
cursor: pointer;
text-align: center;
font-size: 1.6rem;
line-height: 1;
border-top-left-radius: 50%;
border-bottom-left-radius: 50%;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
color: #fff;
background: var(--primaryColor);
opacity: 0.5;
transition: opacity var(--baseAnimationSpeed);
user-select: none;
i {
font-size: inherit;
}
&:hover,
&:focus-visible,
&:active {
opacity: 0.7;
}
&:active {
transition-duration: var(--activeAnimationSpeed);
opacity: 1;
}
}
.btn-close {
margin-right: -10px;
}
.tabs-header {
margin-bottom: -23px;
}
}
// content
.panel-content {
@extend .content;
z-index: auto; // not fixed to allow overlapping
flex-grow: 1;
overflow-x: hidden;
overflow-y: auto; /* fallback */
overflow-y: overlay;
}
.panel-header ~ .panel-content {
padding-top: 5px;
}
// footer
.panel-footer {
z-index: 2;
column-gap: var(--smSpacing);
display: flex;
align-items:center;
justify-content: flex-end;
border-top: 1px solid var(--baseAlt2Color);
padding: $compactPadding $padding;
}
// scroll markers
&.scrollable {
.panel-header {
box-shadow: 0px 4px 5px 0px rgba(#000, 0.05);
}
.panel-footer {
box-shadow: 0px -4px 5px 0px rgba(#000, 0.05);
}
&.scroll-top-reached .panel-header {
box-shadow: none;
}
&.scroll-bottom-reached .panel-footer {
box-shadow: none;
}
}
// sizes
&.overlay-panel-xl {
width: 850px;
}
&.overlay-panel-lg {
width: 700px;
}
&.overlay-panel-sm {
width: 460px;
}
// popup style
&.popup {
height: auto;
max-height: 100%;
align-self: center;
border-radius: var(--baseRadius);
margin: 0 auto;
.panel-footer {
background: var(--bodyColor);
}
}
&.hide-content {
.panel-content {
display: none;
}
}
&.colored-header {
.panel-header {
background: var(--bodyColor);
border-bottom: 1px solid var(--baseAlt1Color);
.tabs-header {
border-bottom: 0;
}
}
.panel-header ~ .panel-content {
padding-top: calc(var(--baseSpacing) - 5px);
}
}
&.compact-header {
.panel-header {
row-gap: var(--smSpacing);
}
}
&.image-preview {
width: auto;
min-width: 300px;
max-width: 70%;
max-height: 90%;
.panel-header {
position: absolute;
z-index: 99;
.overlay-close {
left: 100%;
right: auto;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-top-right-radius: 50%;
border-bottom-right-radius: 50%;
i {
margin-right: 5px;
}
}
}
.panel-header,
.panel-footer {
padding: 10px 15px;
}
.panel-content {
padding: 0;
text-align: center;
}
img {
max-width: 100%;
border-top-left-radius: var(--baseRadius);
border-top-right-radius: var(--baseRadius);
}
}
@media (max-width: 900px) {
.overlay-panel-section {
padding: var(--smSpacing);
}
}
}
.overlay-panel-container {
display: flex;
position: fixed;
z-index: 1000;
flex-direction: row;
align-items: center;
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
margin: 0;
padding: 0;
outline: 0;
.overlay {
position: absolute;
z-index: 0;
left: 0;
top: 0;
width: 100%;
height: 100%;
user-select: none;
background: var(--overlayColor);
}
&.padded {
padding: 10px;
}
}
.overlay-panel-wrapper {
position: relative;
z-index: 1000;
outline: 0;
}