抽奖代码

<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
        <link rel="stylesheet" type="text/css" href="css/reset.css"/>
    <style type="text/css">
        *{
            box-sizing: border-box;
        }
        body{
            background: #eee;
        }
        .container{
          max-width: 500px;
          min-height: 100%;
          margin:0 auto;
          background:red;
          text-align: center;
        }
        .roll-container{
            margin-top:20px;
            padding:40px 40px;
            background: url(bg.png) no-repeat;
            background-size:100% 100% ;
        }
        .flex-row{
            display: flex;
            margin-bottom:10px;
        }
        .flex-col{
            position: relative;
            color:#fff;
            background: #fff;
            display: flex;
            align-items: center;
            justify-content: center;
            flex:1;
            border-radius:4px ;
         
        }
        .flex-col:not(:last-child){
            margin-right:10px;
        }
        .bc-red{
            background:red;
        }
        .bc-green{
            background: green;
        }
        .btn{
            cursor:pointer;
        }
        .btn:hover{
             
            
        }
        .pd-8{
            padding:8px;
        }
        .c-fff{
         color:#fff;
        }
        .jp-png{
            height:100%;
            width:100%;
            border-radius:4px;
        }
        .mask{
        width:100%;
        height:100%;
        position:absolute;
        left:0;
        top:0;
        background-color: rgba(252,211,4,0.5);
        display: none;
    }
    .active .mask{
        display: block;
    }
    </style>
    </head>
    <body>
         <div class="container">
            <h2 class="c-fff">抽奖</h2>
            <div class="pd-8">
                <div class="roll-container">
                    <div class="flex-row">
                        <div class="flex-col active"><img src="4.jpg" alt=""  class="jp-png"/> <div class="mask"></div></div>
                        <div class="flex-col"><img src="4.jpg" alt=""  class="jp-png"/> <div class="mask"></div></div>
                        <div class="flex-col"><img src="4.jpg" alt=""  class="jp-png"/> <div class="mask"></div></div>
                    </div>
                    <div class="flex-row">
                        <div class="flex-col"><img src="4.jpg" alt=""  class="jp-png"/><div class="mask"></div></div>
                        <div class="flex-col btn"><img src="11.jpg" alt=""  class="jp-png"/></div>
                        <div class="flex-col"><img src="4.jpg" alt=""  class="jp-png"/><div class="mask"></div></div>
                    </div>
                    <div class="flex-row">
                        <div class="flex-col"><img src="4.jpg" alt=""  class="jp-png"/><div class="mask"></div></div>
                        <div class="flex-col"><img src="4.jpg" alt=""  class="jp-png"/><div class="mask"></div></div>
                        <div class="flex-col"><img src="4.jpg" alt=""  class="jp-png"/><div class="mask"></div></div>
                    </div>
            </div>
                
            </div>
            
         </div>
        <script type="text/javascript">
            var col = document.querySelectorAll(".flex-col");
            drawSquare(col);
            function drawSquare(dom){
                 dom.forEach(function(ele){
                      ele.style.height=ele.getBoundingClientRect().width +'px';
                 })
            }
              window.addEventListener("resize", function(){
                drawSquare(col)
              });
        </script>
    </body>
</html>

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 驴得氺阅读 3,933评论 0 0
  • 放假回家,灿灿和姐姐在画画,阿嫲坐旁边看。灿灿指着阿嫲裤腿说:“阿嫲,你裤子上有一个洞!“ 边说边伸一个手指头进去...
    云在波心阅读 4,225评论 0 0
  • 今天看了《W》的6,7集,本来以为漫画男主穿到现实世界,然后开枪伤了漫画家就差不多了,可以完结了。但是后面还有十几...
    歌呗lrf阅读 1,094评论 0 0
  • 当有人问“你是谁?”,这显然幼儿园小朋友就能轻松应答。 当有人连续不停地追问“你是谁?”,你还会始终轻松应答吗? ...
    C_JY阅读 2,586评论 3 2

友情链接更多精彩内容