<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">

    <title>Slots Ouro</title>


    <!--http://www.html5rocks.com/en/mobile/mobifying/-->
    <meta name="viewport"
          content="width=device-width,user-scalable=no,initial-scale=1, minimum-scale=1,maximum-scale=1"/>

    <!--https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/MetaTags.html-->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="format-detection" content="telephone=no">

    <!-- force webkit on 360 -->
    <meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <!-- force edge on IE -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="msapplication-tap-highlight" content="no">

    <!-- force full screen on some browser -->
    <meta name="full-screen" content="yes"/>
    <meta name="x5-fullscreen" content="true"/>
    <meta name="360-fullscreen" content="true"/>

    <!-- force screen orientation on some browser -->
    <meta name="screen-orientation" content="landscape"/>
    <meta name="x5-orientation" content="landscape">


    <meta name="x5-page-mode" content="app">
{{--    <script src="https://js.sentry-cdn.com/c23696b7dfeaa437a074140b8cb75021.min.js"></script>--}}
    <script type="text/javascript">

        window._item=@json($server);
        window._uinfo=@json($userData);
        window._old_obj='@json($loginData)';
        window._gameid={{$server['KindID']}}
        window.DOLLAR='{{$Dollar}}';
        window._lang='{{$clientLang}}';


        window.cdn_path="https://cdn.moeda777.com/game/land/";
        window._pt=function (t) {
            if(t.indexOf("http")===-1){
                t=window.cdn_path+t;
            }
            return t;
        }
        window.onBack=function(){
            parent.postMessage({cmd:"back"},"*")
        }

        window.onPay=function(){
            parent.postMessage({cmd:"pay"},"*")
        }


        window.disableLoader=true;
        var html = document.documentElement;
        html.style.fontSize = html.getBoundingClientRect().width / 10 + 'px';


    </script>
    <link rel="stylesheet" type="text/css" id="css" href="https://cdn.moeda777.com/game/land/style-mobile.25fc5.css"/>
    <style>
        #splash {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #171717 url(https://cdn.moeda777.com/24680/assets/loading/loading_{{$lang}}.jpg) no-repeat center;
            background-size: 100%;
        }
        .progress-indicator {
            top: 0.121rem;
            margin-left: 0.2rem;
            height: 0.4rem;
            border-radius: 0.4rem;
            width: 0%;
            background-image: linear-gradient(180deg, #FCD7A1 0%, #B25922 100%);
            position: absolute;
        }
        #app{
            position: fixed;
            width: 10rem;
            height: 100%;
            left: 50%;
            transform: translate3d(-50%, 0, 0);
            -webkit-transform: translate3d(-50%, 0, 0);
            overflow-x: hidden;
            overflow-y: scroll;
    }
    </style>
</head>
<body style="background-color: {{$loading_color}}; ">

<canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0" ></canvas>
<div  id="app" style="width: 10rem; ">
    <div  style="position: fixed; top: 0px; left: 0px; width: 10rem; height: 100vh; z-index: 99999; overflow: hidden; background: {{$loading_color}};">

        <img id="loading_bg"  src="//cdn.moeda777.com/24680/assets/loading/loading_bg_{{$loading_rand}}.jpg" alt="" style="position: absolute; top: 0px; left: 0px; width: 10rem;">

        <img  src="//cdn.moeda777.com/24680/assets/loading/{{$lang}}/act_{{$act_rand}}.png" style="position: absolute;margin-left:-5rem; top: 0; width: 10rem; height: 5rem;">
        <img  src="//cdn.moeda777.com/24680/assets/loading/loading_dot_bg.png" style="position: absolute;margin-left:-5rem; bottom: 1rem; width: 10rem; height: 4.44rem;">
        <div  style="position: absolute; bottom: 2.7rem; width: 6.66rem; height: 0.8325rem; left: 50%; margin-left: -3.33rem;">
            <img  src="//cdn.moeda777.com/24680/assets/loading/loading_bg.png" style="width: 100%; height: 100%;">
            <div  class="progress-indicator" style="width: 0.2rem;">
            <span  id="loading_txt" style="position: absolute; top: 0px; left: 0.2rem; height: 0.4rem; line-height: 0.4rem; color: rgb(255, 235, 191); font-size: 0.25rem;">Loading...</span>
                <img  src="//cdn.moeda777.com/24680/assets/loading/loading_flash2.png" style="position: absolute; right: -0.4rem; top: -0.2rem; width: 1rem; height: 0.8rem;">
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    const dom = document.getElementById('loading_bg');
    // onload监听，判断图片是否加载完成
    parent.postMessage({cmd:"closeLoading"},"*")
    dom.onload = function() {
    }
</script>
<script src="https://cdn.moeda777.com/game/land/src/settings.23831.js" charset="utf-8"></script>

<script src="https://cdn.moeda777.com/game/land/main.07d0e.js" charset="utf-8"></script>

<script type="text/javascript">

    var html = document.documentElement;
    function _onWindowResize() {

        var rect=html.getBoundingClientRect();
        html.style.fontSize = rect.width / 10 + 'px';

        const dpr = window.devicePixelRatio || 1

        var c2d = document.getElementById('Cocos2dGameContainer');
        if(c2d) {
            c2d.style.width = "100vw"
            c2d.style.height = "100vh"

        }
        var canvas = document.getElementById('GameCanvas');
        console.log(canvas.clientWidth,canvas.clientHeight,dpr)
        if(canvas) {
            canvas.style.width =  "100vw"
            canvas.style.height = "100vh"

            canvas.width=canvas.clientWidth*dpr
            canvas.height=canvas.clientHeight*dpr


        }
    }
    window.addEventListener('resize', _onWindowResize);
    _onWindowResize();

    var splash = document.getElementById('app');
    var loading_txt = document.getElementById('loading_txt');
    var progressBar = splash.querySelector('.progress-indicator');

    splash.style.display = 'block';
    progressBar.style.width =(0.15*6.26)+'rem';
    window.reportProgress=function(percent){
        // console.log(percent)
        if(percent>=1){
            setTimeout(function (){
                splash.style.display = 'none';
            },2000)
        }
        if(percent<0.7){
            percent=percent/0.7*0.3;
        }else{
            percent=0.3+(percent-0.7)/0.3*0.7;
        }
        percent = 0.2+0.8 * percent;
        // console.log(percent)
        loading_txt.innerText="Loading..."+(percent*100).toFixed(1)+"%"
        percent*=6.26
        if (progressBar) {
            progressBar.style.width = percent.toFixed(2) + 'rem';
        }
    }

    window.boot = function () {
        var settings = window._CCSettings;
        window._CCSettings = undefined;
        var onProgress = null;

        var RESOURCES = cc.AssetManager.BuiltinBundleName.RESOURCES;
        var INTERNAL = cc.AssetManager.BuiltinBundleName.INTERNAL;
        var MAIN = cc.AssetManager.BuiltinBundleName.MAIN;
        function setLoadingDisplay () {
            // Loading splash scene
            onProgress = function (finish, total) {
                var percent = (0.15+0.05 * finish / total) * 6.26;
                if (progressBar) {
                    progressBar.style.width = percent.toFixed(2) + 'rem';
                }
            };

            //cc.director.once(cc.Director.EVENT_AFTER_SCENE_LAUNCH, function () {
            //    splash.style.display = 'none';
            //});
        }

        var onStart = function () {

            cc.view.enableRetina(true);
            cc.view.resizeWithBrowserSize(true);

            if (cc.sys.isBrowser) {
                setLoadingDisplay();
            }

            if (cc.sys.isMobile) {
                if (settings.orientation === 'landscape') {
                    cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE);
                }
                else if (settings.orientation === 'portrait') {
                    cc.view.setOrientation(cc.macro.ORIENTATION_PORTRAIT);
                }
            }
            cc.view.enableAutoFullScreen(false);

            // Limit downloading max concurrent task to 2,
            // more tasks simultaneously may cause performance draw back on some android system / browsers.
            // You can adjust the number based on your own test result, you have to set it before any loading process to take effect.
            // if (cc.sys.isBrowser && cc.sys.os === cc.sys.OS_ANDROID) {
            //     cc.assetManager.downloader.maxConcurrency = 4;
            //     cc.assetManager.downloader.maxRequestsPerFrame = 4;
            // }
            cc.assetManager.downloader.maxConcurrency = 20;
            cc.assetManager.downloader.maxRequestsPerFrame = 20;

            var launchScene = settings.launchScene;
            var bundle = cc.assetManager.bundles.find(function (b) {
                return b.getSceneInfo(launchScene);
            });

            bundle.loadScene(launchScene, null, onProgress,
                function (err, scene) {
                    if (!err) {
                        cc.director.runSceneImmediate(scene);
                        if (cc.sys.isBrowser) {
                            // show canvas
                            var canvas = document.getElementById('GameCanvas');
                            canvas.style.visibility = '';
                            var div = document.getElementById('GameDiv');
                            if (div) {
                                div.style.backgroundImage = '';
                            }
                            console.log('Success to load scene: ' + launchScene);
                        }
                    }
                }
            );

        };

        var option = {
            id: 'GameCanvas',
            debugMode: settings.debug ? cc.debug.DebugMode.INFO : cc.debug.DebugMode.ERROR,
            showFPS: settings.debug,
            frameRate: 60,
            groupList: settings.groupList,
            collisionMatrix: settings.collisionMatrix,
        };

        cc.assetManager.init({
            bundleVers: settings.bundleVers,
            remoteBundles: settings.remoteBundles,
            server: settings.server
        });

        var bundleRoot = [INTERNAL];
        settings.hasResourcesBundle && bundleRoot.push(RESOURCES);

        var count = 0;
        function cb (err) {
            if (err) return console.error(err.message, err.stack);
            count++;
            if (count === bundleRoot.length + 1) {
                cc.assetManager.loadBundle(MAIN, function (err) {
                    if (!err) cc.game.run(option, onStart);
                });
            }
        }

        cc.assetManager.loadScript(settings.jsList.map(function (x) { return 'src/' + x;}), cb);

        for (var i = 0; i < bundleRoot.length; i++) {
            cc.assetManager.loadBundle(bundleRoot[i], cb);
        }
    };

    (function () {
        // open web debugger console
        if (typeof VConsole !== 'undefined') {
            window.vConsole = new VConsole();
        }

        var debug = window._CCSettings.debug;
        // var splash = document.getElementById('splash');
        // splash.style.display = 'block';

        function loadScript (moduleName, cb) {
            function scriptLoaded () {
                document.body.removeChild(domScript);
                domScript.removeEventListener('load', scriptLoaded, false);
                cb && cb();
            };
            var domScript = document.createElement('script');
            domScript.async = true;
            domScript.src = moduleName;
            domScript.addEventListener('load', scriptLoaded, false);
            document.body.appendChild(domScript);
        }

        loadScript(debug ? 'cocos2d-js.js' : 'https://cdn.moeda777.com/client/por/cocos2d-js-min.85909.js', function () {
            if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
                loadScript(debug ? 'physics.js' : 'https://cdn.moeda777.com/client/por/physics-min.ad9a7.js', window.boot);
            }
            else {
                window.boot();
            }
            cc.view.enableAutoFullScreen(false)
            cc.view.setOrientation(cc.macro.ORIENTATION_LANDSCAPE)
        });
    })();
</script>
</body>
</html>
