小程序简易弹框

小程序的简单弹框例子

//wxml 布局文件
<view class="tips" wx:if="{{showGuide}}">
    <view class="tips_hd luminous-font">
      <view class="tip">小游戏欢迎你</view>      
      <view class="tip">开始游戏哦</view>
    </view>
    <view class="tips_ft">       
      <button bindtap="startGame" class="start-btn"><image class="start-img"src="/resources/images/index/btn_bg.png"></image>开始狼人杀</button> 
    </view>
</view>

//wxss 样式文件
.tips {
    position: absolute;
    top: 5%;
    bottom: 12%;
    left: 10%;
    right: 10%;
    z-index: 999;
    height: 85%;
    padding: 32rpx 20rpx;
    background: rgba(0,0,0,0.8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: column;
    border-radius: 10px;
    box-shadow: 0px 0px 40px blue;
}

.tips_hd {
    font-size: 11pt;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 76rpx;
    margin-top: 40rpx;
}

.tips_hd .tip {
    font-size: 17pt;
    display: flex;
    align-items: center;
    justify-content: center;
    
}
.luminous-font {
text-shadow: 0 0 10px #02AEFF,0 0 20px #02AEFF,0 0 30px #02AEFF,0 0 40px #02AEFF,0 0 70px #02AEFF,0 0 80px #02AEFF,0 0 100px #02AEFF,0 0 150px #02AEFF;
}

.tips .tips_ft {
    display: flex; 
    flex-direction: row;
    justify-content: space-around;
    width: 100%; 
    margin-top: -100rpx;

}
.start-img{
    width:480rpx;
    height:160rpx;
    position:absolute;
    top:0;
    left:0;
    z-index:-10;
}
.start-btn{
    position:absolute;
    width:480rpx;
    height:160rpx;
    line-height:160rpx;
    border-radius:40rpx;
    background:transparent;
    color:#fff;
}
//js文件
 data: {
    showGuide:!0,
  },
 startGame: function () {
    this.setData({
      showGuide: !1
    });
  },


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • H5移动端知识点总结 阅读目录 移动开发基本知识点 calc基本用法 box-sizing的理解及使用 理解dis...
    Mx勇阅读 4,637评论 0 26
  • 移动开发基本知识点 一.使用rem作为单位 html { font-size: 100px; } @media(m...
    横冲直撞666阅读 3,521评论 0 6
  • 每天的学习记录,可能有的地方写的不对,因为刚学,以后发现错的话会回来改掉整体流程 https://develope...
    有点健忘阅读 4,803评论 0 7
  • 好久没有更新了,今天更新点东西。 大多数的商城类小程序都有这个功能,点击“全部订单”,“待付款”,“待发货”,“待...
    _vb阅读 1,008评论 0 2
  • 如果我的能力只能让我穷困潦倒,那穷困潦倒就是我的命运… 否则人生在世,就是要喝最烈的酒,泡最美的妹子,赌最好的未来...
    一往直前阅读 599评论 0 0