amis/scss/components/_image-gallery.scss
吴多益 33686a375e
SCSS 基于 CSS custom properties 重构,支持通过配置来控制展现风格 (#1190)
* 使用自定义 css 属性初步,支持大部分组件的展现

* button 大部分可以看了

* cxd 和 dark 大部分正常

* 修复一些细节样式错误;补充 css 变量的文档

* 修复几个脚本发现的错误

* 完善一下注释

* 修复一些样式不一致问题

* 修复可能存在的 css xss

* 恢复 font-variant 功能

* 修复绝大部分 @if 相关的问题

* 恢复之前的注释

* 修复小错误,并将所有 background-color 改成 background,这样就能设置渐变色

* 修复 button group 在 cxd 下不一致问题

* 缩小查看配置和复制配置的宽度,留出更多空间

* 修复一些潜在的错误

* 恢复 utilities 中 label 背景色的设置

* 修复错误的 css 变量

* 补充 IE11 Variables Polyfill
2020-12-21 10:08:40 +08:00

206 lines
3.3 KiB
SCSS

@keyframes disappear {
to {
opacity: 0;
}
}
@keyframes appear {
from {
opacity: 0;
}
}
.#{$ns}ImageGallery {
display: flex;
flex-direction: column;
background: transparent;
border: none;
border-radius: 0;
max-width: 1010px !important;
&-close {
position: absolute;
right: 0;
top: 0;
color: rgba(255, 255, 255, 0.8);
cursor: pointer;
&:hover {
color: #fff;
}
> svg {
width: px2rem(16px);
height: px2rem(16px);
}
}
&-title {
height: px2rem(30px);
vertical-align: top;
line-height: px2rem(30px);
font-size: px2rem(12px);
color: var(--white);
text-align: center;
}
&-main {
background: #000;
flex-basis: 0;
flex-grow: 1;
height: 0;
position: relative;
display: flex;
justify-content: center;
align-items: center;
user-select: none;
> img {
display: block;
max-width: 100%;
max-height: 100%;
}
}
&-prevBtn,
&-nextBtn {
> svg {
width: px2rem(48px);
height: px2rem(48px);
}
position: absolute;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
color: #999;
text-shadow: rgba(0, 0, 0, 0.3) 0px 0px 4px;
&:hover {
color: #fff;
text-shadow: rgba(0, 0, 0, 0.5) 0px 0px 4px;
}
animation-name: disappear;
animation-delay: 3s;
animation-duration: 0.35s;
animation-fill-mode: both;
&.is-disabled {
pointer-events: none;
}
}
&-main:hover &-prevBtn,
&-main:hover &-nextBtn {
animation-name: appear;
animation-delay: 0s;
animation-duration: 0.35s;
}
&-prevBtn {
left: px2rem(20px);
}
&-nextBtn {
right: px2rem(20px);
}
&-footer {
height: px2rem(74px);
background: #222;
display: flex;
flex-direction: row;
user-select: none;
}
&-prevList,
&-nextList {
width: px2rem(20px);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
background: rgba(0, 0, 0, 0.3);
color: #fff;
&.is-disabled {
background: rgba(0, 0, 0, 0.3);
color: rgba(255, 255, 255, 0.1);
pointer-events: none;
}
&:hover {
background: rgba(0, 0, 0, 1);
color: #fff;
}
}
&-itemsWrap {
flex-grow: 1;
flex-basis: 0;
width: 0;
overflow: hidden;
align-items: center;
justify-content: center;
display: flex;
}
&-items {
display: inline-block;
white-space: nowrap;
}
&-item {
margin: 10px 5px;
width: 54px;
height: 54px;
display: inline-flex;
position: relative;
border: 1px solid #666;
justify-content: center;
align-items: center;
cursor: pointer;
> img {
display: block;
max-width: 100%;
max-height: 100%;
}
@supports (object-fit: cover) {
> img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
&:after {
position: absolute;
content: '';
display: block;
background: rgba(0, 0, 0, 0.5);
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
&:hover {
border: 1px solid #e5e5e5;
&:after {
display: none;
}
}
&.is-active {
border: 1px solid #108cee;
&:after {
display: none;
}
}
}
}