react-mgallery
Version:
React component for mobile web gallery
68 lines (58 loc) • 1.29 kB
text/less
.mgallery{
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
background-color: #000;
font-size: 16px;
&-container{
height: 100%;
display: flex;
}
&-item{
flex: 1;
height: 100%;
overflow: hidden;
transform: translate3d(0,0,0);// 优化安卓图片闪烁
img {
display: block;
max-width: 100%;
margin: 0 auto;
}
&:not(.long){
display: flex;
align-items: center;
justify-content: center;
img{
max-height: 100%;
}
}
}
&-dots{
position: absolute;
bottom: 1em;
width: 100%;
text-align: center;
i{
display: inline-block;
font-size: .3em;
height: 1em;
width: 1em;
border: 1px solid #999;
border-radius: 100%;
background-color: #666;
margin-right: 1em;
&.on{
border-color: #fff;
background-color: #fff;
}
}
}
}
.transition {
.mgallery {
&-scaler, &-container {
transition: transform .3s ease;
}
}
}