Add light box.

This commit is contained in:
BoHung Chiu 2021-06-16 15:46:14 +08:00
parent f48d96493a
commit 9d910fa16a
3 changed files with 73 additions and 1 deletions

View File

@ -626,6 +626,12 @@ extendPanelWidget();
} else {
$('.introtext').before($('.introimage'));
}
if( $('div[data-pp="2000"]').text() !== ''){
$('.black-screen').addClass('active');
}
$('.close-btn').click(function() {
$('.black-screen').removeClass('active');
})
});
$(window).resize(function() {
if ($(window).width() < 768) {

View File

@ -23,7 +23,65 @@
//RWD
@import "RWD";
.black-screen{
position: fixed;
width: 100%;
height: 100%;
opacity: 0;
top: -20000px;
background: rgba(0,0,0,.7);
z-index: 1000;
left: 0;
transition:opacity .3s ,top 0s .3s;
&.active{
opacity: 1;
top:0;
transition:opacity .3s;
.content{
transform:translate(-50%,-50%);
opacity: 1;
top:50%;
left: 50%;
// box-shadow: #dcabff 0px 0px 150px;
transition:opacity 1s .8s,top .5s .7s ;
}
}
.content{
background: #fff;
color:#666;
font-family: '微軟正黑體','sans-serif';
position: absolute;
opacity: 0;
left:-20000px;
top:60%;
transform:translate(-50%,-50%);
transform-origin:center;
width: 90%;
font-weight: bold;
transition:opacity .5s ,top .5s, left 0s .5s;
padding: 2px;
@media (min-width: 768px){
width: 40%;
padding: 30px;
}
@media (max-width: 767px){
padding: 30px 10px;
}
.close-btn{
position: absolute;
right: 0;
top:0;
padding: 5px 10px;
background: $theme-color-main;
color:#fff;
font-size: 18px;
transition:.3s;
&:hover{
background: $theme-color-second;
}
}
}
}
.dropdown-toggle:focus {
// outline: 2px solid #43B5FC;
outline: transparent;

View File

@ -56,6 +56,14 @@
<section class="extra-box col-sm-12" data-pp="23"></section>
</div>
</div>
<div class="black-screen">
<div class="content">
<div data-pp='2000'></div>
<a href='javascript:;' class="close-btn">
<i class="fa fa-times"></i>
</a >
</div>
</div>
<%= render_footer %>
</body>
</html>