console
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>遮罩弹出层从下到上滑出</title>
<style>
.main-box {
width: 750px;
height: 500px;
background-color: #8c3246;
}
.modal-mark {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #e9cc8e;
z-index: 12;
}
.info-box {
position: fixed;
bottom: 0;
border: 2px solid #2b2b2b;
margin: 0 auto;
color: #fff;
z-index: 999;
}
.openBG {
animation: slideBGtUp 0.5s ease-in both;
}
.closeBG {
animation: slideBGDown 0.5s ease-in both;
}
.open {
animation: slideContentUp 0.5s ease-in both;
}
.close {
animation: slideContentDown 0.5s ease-in both;
}
@keyframes slideBGtUp {
from {
background: transparent;
}
to {
background: rgba(0, 0, 0, 0.1);
}
}
@keyframes slideBGDown {
from {
background: rgba(0, 0, 0, 0.1);
}
to {
background: transparent;
}
}
@keyframes slideContentUp {
from {
height: 0;
}
to {
height: 800rpx;
}
}
@keyframes slideContentDown {
from {
height: 800rpx;
}
to {
height: 0;
}
}
</style>
</head>
<body>
<script src="/demos/googlegg.js">
</script>
<div class="vueBox">
<div class="main-box">
<div @click="joinGroup">立即参与</div>
<div class="modal-mark" v-if="isShow" @click="showMark"></div>
<div class="info-box" v-if="showInfo" :class="isShow ? 'openBG' : 'closeBG'">
<p>选择一个喜欢的去录制</p>
<div class="type-list">
<div>测试一</div>
<div>测试二</div>
<div>测试三</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
const vm = new Vue({
el: ".vueBox",
data: {
isShow:false,
showInfo:false
},
created: function () {
},
methods: {
joinGroup(){
this.isShow = !this.isShow;
this.showInfo = true;
},
showMark(){
this.isShow = false;
this.showInfo = false;
}
}
});
</script>
</body>
</html>