jquery实现手机端打地鼠打新冠病毒小游戏抽奖代码

代码语言:html

所属分类:游戏

代码描述:jquery实现手机端打地鼠打新冠病毒小游戏抽奖代码,点击开始游戏,在30秒内打死更多的病毒者就能获取奖励。

代码标签: jquery 手机端 打地鼠 新冠 病毒 游戏 抽奖

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!doctype html>
<html lang="en">

<head>
    <meta charset="UTF-8">
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>
    <meta name="viewport" content="width=device-width,maximum-scale=1.0,user-scalable=no,initial-scale=1.0">
    <script>
        //单位自适应
        (function (doc, win) {
            var docEl = doc.documentElement,
                resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
                recalc = function () {
                    var clientWidth = docEl.clientWidth;
                    if (!clientWidth) return;
                    if (clientWidth >= 640) {
                        docEl.style.fontSize = '100px';
                    } else {
                        docEl.style.fontSize = 100 * (clientWidth / 640) + 'px';
                    }
                };
            if (!doc.addEventListener) return;
            win.addEventListener(resizeEvt, recalc, false);
            doc.addEventListener('DOMContentLoaded', recalc, false);
        })(document, window);
    </script>
    <style type="text/css">
        html,
        body {
            margin: 0;
            padding: 0;
            position: relative;
        }

        .gameIndex {
            width: 100%;
            position: relative;
            background: url(//repo.bfw.wiki/bfwrepo/images/game/dadishu/2/Img/bg.jpg) no-repeat center/cover;
            display: block;
        }

        .btnImage {
            height: 0.56rem;
            width: 1.71rem;
            position: absolute;
        }

        .startBtn {
            top: 7.6rem;
            left: 1.2rem;
        }

        .ruleBtn {
            top: 7.6rem;
            left: 3.5rem;
        }

        .againBtn {
            top: 9rem;
            left: 1.2rem;
        }

        .recordBtn {
            top: 9rem;
            left: 3.5rem;
        }

        .gameRule {
            display: none;
            z-index: 10;
            width: 5.6rem;
            position: fixed;
            left: 50%;
            top: 1rem;
            margin-left: -2.8rem;
            text-align: center;
        }

        .gameHideBg {
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: none;
            z-index: 10;
            position: absolute;
        }

        .ruleImage {
            width: 90%;
            height: 90%;
        }

        #closeRule {
            position: absolute;
            width: 0.6rem;
            bottom: -0.5rem;
            left: 50%;
            margin-left: -0.3rem;
        }

        .gamePlay {
            width: 100%;
            position: relative;
            background: url(//repo.bfw.wiki/bfwrepo/images/game/dadishu/2/Img/bg2.jpg) no-repeat center/cover;
            display: none;
        }

        .timeRun {
            height: 0.7rem;
            position: absolute;
            top: 3.2rem;
            left: 50%;
            margin-left: -0.35rem;
            width: 0.7rem;
            background: url(//repo.bfw.wiki/bfwrepo/images/game/dadishu/2/Img/runtime.png) no-repeat center/cover;
            font-size: 0.35rem;
            color: #19591C;
            line-height: 0.7rem;
            text-align: center;
        }

        .scoreDiv {
            position: absolute;
            top: 4rem;
            right: 0.5rem;
            font-size: 0.3rem;
            color: #19591C;
        }

        .game.........完整代码请登录后点击上方下载按钮下载查看

网友评论0