Файловый менеджер - Редактировать - /home/jogoso94/public_html/jogos/sweety_memory/js/main.js
�азад
/* Platform.js Copyright 2014-2020 Benjamin Tan Copyright 2011-2013 John-David Dalton Available under MIT license */ (function() { function a(e) { e = String(e); return e.charAt(0).toUpperCase() + e.slice(1) } function b(e, v) { var A = -1, B = e ? e.length : 0; if ("number" == typeof B && -1 < B && B <= D) for (; ++A < B;) v(e[A], A, e); else g(e, v) } function c(e) { e = q(e); return /^(?:webOS|i(?:OS|P))/.test(e) ? e : a(e) } function g(e, v) { for (var A in e) z.call(e, A) && v(e[A], A, e) } function m(e) { return null == e ? a(e) : H.call(e).slice(8, -1) } function f(e, v) { var A = null != e ? typeof e[v] : "number"; return !/^(?:boolean|number|string|undefined)$/.test(A) && ("object" == A ? !!e[v] : !0) } function k(e) { return String(e).replace(/([ -])(?!$)/g, "$1?") } function n(e, v) { var A = null; b(e, function(B, C) { A = v(A, B, C, e) }); return A } function q(e) { return String(e).replace(/^ +| +$/g, "") } function r(e) { function v(L) { return n(L, function(J, I) { var M = I.pattern || k(I); !J && (J = RegExp("\\b" + M + " *\\d+[.\\w_]*", "i").exec(e) || RegExp("\\b" + M + " *\\w+-[\\w]*", "i").exec(e) || RegExp("\\b" + M + "(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)", "i").exec(e)) && ((J = String(I.label && !RegExp(M, "i").test(I.label) ? I.label : J).split("/"))[1] && !/[\d.]+/.test(J[0]) && (J[0] += " " + J[1]), I = I.label || I, J = c(J[0].replace(RegExp(M, "i"), I).replace(RegExp("; *(?:" + I + "[_-])?", "i"), " ").replace(RegExp("(" + I + ")[-_.]?(\\w)", "i"), "$1 $2"))); return J }) } function A(L) { return n(L, function(J, I) { return J || (RegExp(I + "(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)", "i").exec(e) || 0)[1] || null }) } var B = l, C = e && "object" == typeof e && "String" != m(e); C && (B = e, e = null); var N = B.navigator || {}, w = N.userAgent || ""; e || (e = w); var aa = C ? !!N.likeChrome : /\bChrome\b/.test(e) && !/internal|\n/i.test(H.toString()), ba = C ? "Object" : "ScriptBridgingProxyObject", V = C ? "Object" : "Environment", R = C && B.java ? "JavaPackage" : m(B.java), ca = C ? "Object" : "RuntimeObject"; V = (R = /\bJava/.test(R) && B.java) && m(B.environment) == V; var da = R ? "a" : "\u03b1", ea = R ? "b" : "\u03b2", W = B.document || {}, P = B.operamini || B.opera, S = y.test(S = C && P ? P["[[Class]]"] : m(P)) ? S : P = null, d, T = e; C = []; var U = null, Q = e == w; w = Q && P && "function" == typeof P.version && P.version(); var G = function(L) { return n(L, function(J, I) { return J || RegExp("\\b" + (I.pattern || k(I)) + "\\b", "i").exec(e) && (I.label || I) }) }([{ label: "EdgeHTML", pattern: "Edge" }, "Trident", { label: "WebKit", pattern: "AppleWebKit" }, "iCab", "Presto", "NetFront", "Tasman", "KHTML", "Gecko" ]), p = function(L) { return n(L, function(J, I) { return J || RegExp("\\b" + (I.pattern || k(I)) + "\\b", "i").exec(e) && (I.label || I) }) }(["Adobe AIR", "Arora", "Avant Browser", "Breach", "Camino", "Electron", "Epiphany", "Fennec", "Flock", "Galeon", "GreenBrowser", "iCab", "Iceweasel", "K-Meleon", "Konqueror", "Lunascape", "Maxthon", { label: "Microsoft Edge", pattern: "(?:Edge|Edg|EdgA|EdgiOS)" }, "Midori", "Nook Browser", "PaleMoon", "PhantomJS", "Raven", "Rekonq", "RockMelt", { label: "Samsung Internet", pattern: "SamsungBrowser" }, "SeaMonkey", { label: "Silk", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Sleipnir", "SlimBrowser", { label: "SRWare Iron", pattern: "Iron" }, "Sunrise", "Swiftfox", "Vivaldi", "Waterfox", "WebPositive", { label: "Yandex Browser", pattern: "YaBrowser" }, { label: "UC Browser", pattern: "UCBrowser" }, "Opera Mini", { label: "Opera Mini", pattern: "OPiOS" }, "Opera", { label: "Opera", pattern: "OPR" }, "Chromium", "Chrome", { label: "Chrome", pattern: "(?:HeadlessChrome)" }, { label: "Chrome Mobile", pattern: "(?:CriOS|CrMo)" }, { label: "Firefox", pattern: "(?:Firefox|Minefield)" }, { label: "Firefox for iOS", pattern: "FxiOS" }, { label: "IE", pattern: "IEMobile" }, { label: "IE", pattern: "MSIE" }, "Safari" ]), F = v([{ label: "BlackBerry", pattern: "BB10" }, "BlackBerry", { label: "Galaxy S", pattern: "GT-I9000" }, { label: "Galaxy S2", pattern: "GT-I9100" }, { label: "Galaxy S3", pattern: "GT-I9300" }, { label: "Galaxy S4", pattern: "GT-I9500" }, { label: "Galaxy S5", pattern: "SM-G900" }, { label: "Galaxy S6", pattern: "SM-G920" }, { label: "Galaxy S6 Edge", pattern: "SM-G925" }, { label: "Galaxy S7", pattern: "SM-G930" }, { label: "Galaxy S7 Edge", pattern: "SM-G935" }, "Google TV", "Lumia", "iPad", "iPod", "iPhone", "Kindle", { label: "Kindle Fire", pattern: "(?:Cloud9|Silk-Accelerated)" }, "Nexus", "Nook", "PlayBook", "PlayStation Vita", "PlayStation", "TouchPad", "Transformer", { label: "Wii U", pattern: "WiiU" }, "Wii", "Xbox One", { label: "Xbox 360", pattern: "Xbox" }, "Xoom"]), K = function(L) { return n(L, function(J, I, M) { return J || (I[F] || I[/^[a-z]+(?: +[a-z]+\b)*/i.exec(F)] || RegExp("\\b" + k(M) + "(?:\\b|\\w*\\d)", "i").exec(e)) && M }) }({ Apple: { iPad: 1, iPhone: 1, iPod: 1 }, Alcatel: {}, Archos: {}, Amazon: { Kindle: 1, "Kindle Fire": 1 }, Asus: { Transformer: 1 }, "Barnes & Noble": { Nook: 1 }, BlackBerry: { PlayBook: 1 }, Google: { "Google TV": 1, Nexus: 1 }, HP: { TouchPad: 1 }, HTC: {}, Huawei: {}, Lenovo: {}, LG: {}, Microsoft: { Xbox: 1, "Xbox One": 1 }, Motorola: { Xoom: 1 }, Nintendo: { "Wii U": 1, Wii: 1 }, Nokia: { Lumia: 1 }, Oppo: {}, Samsung: { "Galaxy S": 1, "Galaxy S2": 1, "Galaxy S3": 1, "Galaxy S4": 1 }, Sony: { PlayStation: 1, "PlayStation Vita": 1 }, Xiaomi: { Mi: 1, Redmi: 1 } }), t = function(L) { return n(L, function(J, I) { var M = I.pattern || k(I); if (!J && (J = RegExp("\\b" + M + "(?:/[\\d.]+|[ \\w.]*)", "i").exec(e))) { var O = J, X = I.label || I, Y = { "10.0": "10", "6.4": "10 Technical Preview", "6.3": "8.1", "6.2": "8", "6.1": "Server 2008 R2 / 7", "6.0": "Server 2008 / Vista", "5.2": "Server 2003 / XP 64-bit", "5.1": "XP", "5.01": "2000 SP1", "5.0": "2000", "4.0": "NT", "4.90": "ME" }; M && X && /^Win/i.test(O) && !/^Windows Phone /i.test(O) && (Y = Y[/[\d.]+$/.exec(O)]) && (O = "Windows " + Y); O = String(O); M && X && (O = O.replace(RegExp(M, "i"), X)); J = O = c(O.replace(/ ce$/i, " CE").replace(/\bhpw/i, "web").replace(/\bMacintosh\b/, "Mac OS").replace(/_PowerPC\b/i, " OS").replace(/\b(OS X) [^ \d]+/i, "$1").replace(/\bMac (OS X)\b/, "$1").replace(/\/(\d)/, " $1").replace(/_/g, ".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i, "").replace(/\bx86\.64\b/gi, "x86_64").replace(/\b(Windows Phone) OS\b/, "$1").replace(/\b(Chrome OS \w+) [\d.]+\b/, "$1").split(" on ")[0]) } return J }) }(["Windows Phone", "KaiOS", "Android", "CentOS", { label: "Chrome OS", pattern: "CrOS" }, "Debian", { label: "DragonFly BSD", pattern: "DragonFly" }, "Fedora", "FreeBSD", "Gentoo", "Haiku", "Kubuntu", "Linux Mint", "OpenBSD", "Red Hat", "SuSE", "Ubuntu", "Xubuntu", "Cygwin", "Symbian OS", "hpwOS", "webOS ", "webOS", "Tablet OS", "Tizen", "Linux", "Mac OS X", "Macintosh", "Mac", "Windows 98;", "Windows " ]); G && (G = [G]); /\bAndroid\b/.test(t) && !F && (d = /\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(e)) && (F = q(d[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i, "") || null); K && !F ? F = v([K]) : K && F && (F = F.replace(RegExp("^(" + k(K) + ")[-_.\\s]", "i"), K + " ").replace(RegExp("^(" + k(K) + ")[-_.]?(\\w)", "i"), K + " $2")); if (d = /\bGoogle TV\b/.exec(F)) F = d[0]; /\bSimulator\b/i.test(e) && (F = (F ? F + " " : "") + "Simulator"); "Opera Mini" == p && /\bOPiOS\b/.test(e) && C.push("running in Turbo/Uncompressed mode"); "IE" == p && /\blike iPhone OS\b/.test(e) ? (d = r(e.replace(/like iPhone OS/, "")), K = d.manufacturer, F = d.product) : /^iP/.test(F) ? (p || (p = "Safari"), t = "iOS" + ((d = / OS ([\d_]+)/i.exec(e)) ? " " + d[1].replace(/_/g, ".") : "")) : "Konqueror" == p && /^Linux\b/i.test(t) ? t = "Kubuntu" : K && "Google" != K && (/Chrome/.test(p) && !/\bMobile Safari\b/i.test(e) || /\bVita\b/.test(F)) || /\bAndroid\b/.test(t) && /^Chrome/.test(p) && /\bVersion\//i.test(e) ? (p = "Android Browser", t = /\bAndroid\b/.test(t) ? t : "Android") : "Silk" == p ? (/\bMobi/i.test(e) || (t = "Android", C.unshift("desktop mode")), /Accelerated *= *true/i.test(e) && C.unshift("accelerated")) : "UC Browser" == p && /\bUCWEB\b/.test(e) ? C.push("speed mode") : "PaleMoon" == p && (d = /\bFirefox\/([\d.]+)\b/.exec(e)) ? C.push("identifying as Firefox " + d[1]) : "Firefox" == p && (d = /\b(Mobile|Tablet|TV)\b/i.exec(e)) ? (t || (t = "Firefox OS"), F || (F = d[1])) : !p || (d = !/\bMinefield\b/i.test(e) && /\b(?:Firefox|Safari)\b/.exec(p)) ? (p && !F && /[\/,]|^[^(]+?\)/.test(e.slice(e.indexOf(d + "/") + 8)) && (p = null), (d = F || K || t) && (F || K || /\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(t)) && (p = /[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(t) ? t : d) + " Browser")) : "Electron" == p && (d = (/\bChrome\/([\d.]+)\b/.exec(e) || 0)[1]) && C.push("Chromium " + d); w || (w = A(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)", "Version", k(p), "(?:Firefox|Minefield|NetFront)" ])); if (d = "iCab" == G && 3 < parseFloat(w) && "WebKit" || /\bOpera\b/.test(p) && (/\bOPR\b/.test(e) ? "Blink" : "Presto") || /\b(?:Midori|Nook|Safari)\b/i.test(e) && !/^(?:Trident|EdgeHTML)$/.test(G) && "WebKit" || !G && /\bMSIE\b/i.test(e) && ("Mac OS" == t ? "Tasman" : "Trident") || "WebKit" == G && /\bPlayStation\b(?! Vita\b)/i.test(p) && "NetFront") G = [d]; "IE" == p && (d = (/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(e) || 0)[1]) ? (p += " Mobile", t = "Windows Phone " + (/\+$/.test(d) ? d : d + ".x"), C.unshift("desktop mode")) : /\bWPDesktop\b/i.test(e) ? (p = "IE Mobile", t = "Windows Phone 8.x", C.unshift("desktop mode"), w || (w = (/\brv:([\d.]+)/.exec(e) || 0)[1])) : "IE" != p && "Trident" == G && (d = /\brv:([\d.]+)/.exec(e)) && (p && C.push("identifying as " + p + (w ? " " + w : "")), p = "IE", w = d[1]); if (Q) { if (f(B, "global")) if (R && (d = R.lang.System, T = d.getProperty("os.arch"), t = t || d.getProperty("os.name") + " " + d.getProperty("os.version")), V) { try { w = B.require("ringo/engine").version.join("."), p = "RingoJS" } catch (L) { (d = B.system) && d.global.system == B.system && (p = "Narwhal", t || (t = d[0].os || null)) } p || (p = "Rhino") } else "object" == typeof B.process && !B.process.browser && (d = B.process) && ("object" == typeof d.versions && ("string" == typeof d.versions.electron ? (C.push("Node " + d.versions.node), p = "Electron", w = d.versions.electron) : "string" == typeof d.versions.nw && (C.push("Chromium " + w, "Node " + d.versions.node), p = "NW.js", w = d.versions.nw)), p || (p = "Node.js", T = d.arch, t = d.platform, w = (w = /[\d.]+/.exec(d.version)) ? w[0] : null)); else m(d = B.runtime) == ba ? (p = "Adobe AIR", t = d.flash.system.Capabilities.os) : m(d = B.phantom) == ca ? (p = "PhantomJS", w = (d = d.version || null) && d.major + "." + d.minor + "." + d.patch) : "number" == typeof W.documentMode && (d = /\bTrident\/(\d+)/i.exec(e)) ? (w = [w, W.documentMode], (d = +d[1] + 4) != w[1] && (C.push("IE " + w[1] + " mode"), G && (G[1] = ""), w[1] = d), w = "IE" == p ? String(w[1].toFixed(1)) : w[0]) : "number" == typeof W.documentMode && /^(?:Chrome|Firefox)\b/.test(p) && (C.push("masking as " + p + " " + w), p = "IE", w = "11.0", G = ["Trident"], t = "Windows"); t = t && c(t) } w && (d = /(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(w) || /(?:alpha|beta)(?: ?\d)?/i.exec(e + ";" + (Q && N.appMinorVersion)) || /\bMinefield\b/i.test(e) && "a") && (U = /b/i.test(d) ? "beta" : "alpha", w = w.replace(RegExp(d + "\\+?$"), "") + ("beta" == U ? ea : da) + (/\d+\+?/.exec(d) || "")); if ("Fennec" == p || "Firefox" == p && /\b(?:Android|Firefox OS|KaiOS)\b/.test(t)) p = "Firefox Mobile"; else if ("Maxthon" == p && w) w = w.replace(/\.[\d.]+/, ".x"); else if (/\bXbox\b/i.test(F)) "Xbox 360" == F && (t = null), "Xbox 360" == F && /\bIEMobile\b/.test(e) && C.unshift("mobile mode"); else if (!/^(?:Chrome|IE|Opera)$/.test(p) && (!p || F || /Browser|Mobi/.test(p)) || "Windows CE" != t && !/Mobi/i.test(e)) if ("IE" == p && Q) try { null === B.external && C.unshift("platform preview") } catch (L) { C.unshift("embedded") } else(/\bBlackBerry\b/.test(F) || /\bBB10\b/.test(e)) && (d = (RegExp(F.replace(/ +/g, " *") + "/([.\\d]+)", "i").exec(e) || 0)[1] || w) ? (d = [d, /BB10/.test(e)], t = (d[1] ? (F = null, K = "BlackBerry") : "Device Software") + " " + d[0], w = null) : this != g && "Wii" != F && (Q && P || /Opera/.test(p) && /\b(?:MSIE|Firefox)\b/i.test(e) || "Firefox" == p && /\bOS X (?:\d+\.){2,}/.test(t) || "IE" == p && (t && !/^Win/.test(t) && 5.5 < w || /\bWindows XP\b/.test(t) && 8 < w || 8 == w && !/\bTrident\b/.test(e))) && !y.test(d = r.call(g, e.replace(y, "") + ";")) && d.name && (d = "ing as " + d.name + ((d = d.version) ? " " + d : ""), y.test(p) ? (/\bIE\b/.test(d) && "Mac OS" == t && (t = null), d = "identify" + d) : (d = "mask" + d, p = S ? c(S.replace(/([a-z])([A-Z])/g, "$1 $2")) : "Opera", /\bIE\b/.test(d) && (t = null), Q || (w = null)), G = ["Presto"], C.push(d)); else p += " Mobile"; if (d = (/\bAppleWebKit\/([\d.]+\+?)/i.exec(e) || 0)[1]) { d = [parseFloat(d.replace(/\.(\d)$/, ".0$1")), d]; if ("Safari" == p && "+" == d[1].slice(-1)) p = "WebKit Nightly", U = "alpha", w = d[1].slice(0, -1); else if (w == d[1] || w == (d[2] = (/\bSafari\/([\d.]+\+?)/i.exec(e) || 0)[1])) w = null; d[1] = (/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(e) || 0)[1]; 537.36 == d[0] && 537.36 == d[2] && 28 <= parseFloat(d[1]) && "WebKit" == G && (G = ["Blink"]); Q && (aa || d[1]) ? (G && (G[1] = "like Chrome"), d = d[1] || (d = d[0], 530 > d ? 1 : 532 > d ? 2 : 532.05 > d ? 3 : 533 > d ? 4 : 534.03 > d ? 5 : 534.07 > d ? 6 : 534.1 > d ? 7 : 534.13 > d ? 8 : 534.16 > d ? 9 : 534.24 > d ? 10 : 534.3 > d ? 11 : 535.01 > d ? 12 : 535.02 > d ? "13+" : 535.07 > d ? 15 : 535.11 > d ? 16 : 535.19 > d ? 17 : 536.05 > d ? 18 : 536.1 > d ? 19 : 537.01 > d ? 20 : 537.11 > d ? "21+" : 537.13 > d ? 23 : 537.18 > d ? 24 : 537.24 > d ? 25 : 537.36 > d ? 26 : "Blink" != G ? "27" : "28")) : (G && (G[1] = "like Safari"), d = (d = d[0], 400 > d ? 1 : 500 > d ? 2 : 526 > d ? 3 : 533 > d ? 4 : 534 > d ? "4+" : 535 > d ? 5 : 537 > d ? 6 : 538 > d ? 7 : 601 > d ? 8 : 602 > d ? 9 : 604 > d ? 10 : 606 > d ? 11 : 608 > d ? 12 : "12")); G && (G[1] += " " + (d += "number" == typeof d ? ".x" : /[.+]/.test(d) ? "" : "+")); "Safari" == p && (!w || 45 < parseInt(w)) ? w = d : "Chrome" == p && /\bHeadlessChrome/i.test(e) && C.unshift("headless") } "Opera" == p && (d = /\bzbov|zvav$/.exec(t)) ? (p += " ", C.unshift("desktop mode"), "zvav" == d ? (p += "Mini", w = null) : p += "Mobile", t = t.replace(RegExp(" *" + d + "$"), "")) : "Safari" == p && /\bChrome\b/.exec(G && G[1]) ? (C.unshift("desktop mode"), p = "Chrome Mobile", w = null, /\bOS X\b/.test(t) ? (K = "Apple", t = "iOS 4.3+") : t = null) : /\bSRWare Iron\b/.test(p) && !w && (w = A("Chrome")); w && 0 == w.indexOf(d = /[\d.]+$/.exec(t)) && -1 < e.indexOf("/" + d + "-") && (t = q(t.replace(d, ""))); t && -1 != t.indexOf(p) && !RegExp(p + " OS").test(t) && (t = t.replace(RegExp(" *" + k(p) + " *"), "")); G && !/\b(?:Avant|Nook)\b/.test(p) && (/Browser|Lunascape|Maxthon/.test(p) || "Safari" != p && /^iOS/.test(t) && /\bSafari\b/.test(G[1]) || /^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(p) && G[1]) && (d = G[G.length - 1]) && C.push(d); C.length && (C = ["(" + C.join("; ") + ")"]); K && F && 0 > F.indexOf(K) && C.push("on " + K); F && C.push((/^on /.test(C[C.length - 1]) ? "" : "on ") + F); if (t) { var Z = (d = / ([\d.+]+)$/.exec(t)) && "/" == t.charAt(t.length - d[0].length - 1); t = { architecture: 32, family: d && !Z ? t.replace(d[0], "") : t, version: d ? d[1] : null, toString: function() { var L = this.version; return this.family + (L && !Z ? " " + L : "") + (64 == this.architecture ? " 64-bit" : "") } } }(d = /\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(T)) && !/\bi686\b/i.test(T) ? (t && (t.architecture = 64, t.family = t.family.replace(RegExp(" *" + d), "")), p && (/\bWOW64\b/i.test(e) || Q && /\w(?:86|32)$/.test(N.cpuClass || N.platform) && !/\bWin64; x64\b/i.test(e)) && C.unshift("32-bit")) : t && /^OS X/.test(t.family) && "Chrome" == p && 39 <= parseFloat(w) && (t.architecture = 64); e || (e = null); B = {}; B.description = e; B.layout = G && G[0]; B.manufacturer = K; B.name = p; B.prerelease = U; B.product = F; B.ua = e; B.version = p && w; B.os = t || { architecture: null, family: null, version: null, toString: function() { return "null" } }; B.parse = r; B.toString = function() { return this.description || "" }; B.version && C.unshift(w); B.name && C.unshift(p); t && p && (t != String(t).split(" ")[0] || t != p.split(" ")[0] && !F) && C.push(F ? "(" + t + ")" : "on " + t); C.length && (B.description = C.join(" ")); return B } var h = { "function": !0, object: !0 }, l = h[typeof window] && window || this, u = h[typeof exports] && exports; h = h[typeof module] && module && !module.nodeType && module; var x = u && h && "object" == typeof global && global; !x || x.global !== x && x.window !== x && x.self !== x || (l = x); var D = Math.pow(2, 53) - 1, y = /\bOpera/; x = Object.prototype; var z = x.hasOwnProperty, H = x.toString, E = r(); "function" == typeof define && "object" == typeof define.amd && define.amd ? (l.platform = E, define(function() { return E })) : u && h ? g(E, function(e, v) { u[v] = e }) : l.platform = E }).call(this); function buildIOSMeta() { for (var a = [{ name: "viewport", content: "width=device-width, height=device-height, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" }, { name: "apple-mobile-web-app-capable", content: "yes" }, { name: "apple-mobile-web-app-status-bar-style", content: "black" }], b = 0; b < a.length; b++) { var c = document.createElement("meta"); c.name = a[b].name; c.content = a[b].content; var g = window.document.head.querySelector('meta[name="' + c.name + '"]'); g && g.parentNode.removeChild(g); window.document.head.appendChild(c) } } function hideIOSFullscreenPanel() { jQuery(".xxx-ios-fullscreen-message").css("display", "none"); jQuery(".xxx-ios-fullscreen-scroll").css("display", "none"); jQuery(".xxx-game-iframe-full").removeClass("xxx-game-iframe-iphone-se") } function buildIOSFullscreenPanel() { jQuery("body").append('<div class="xxx-ios-fullscreen-message"><div class="xxx-ios-fullscreen-swipe"></div></div><div class="xxx-ios-fullscreen-scroll"></div>') } function showIOSFullscreenPanel() { jQuery(".xxx-ios-fullscreen-message").css("display", "block"); jQuery(".xxx-ios-fullscreen-scroll").css("display", "block") } function __iosResize() { window.scrollTo(0, 0); console.log(window.devicePixelRatio); console.log(window.innerWidth); console.log(window.innerHeight); if ("iPhone" === platform.product) switch (window.devicePixelRatio) { case 2: switch (window.innerWidth) { case 568: 320 !== window.innerHeight && jQuery(".xxx-game-iframe-full").addClass("xxx-game-iframe-iphone-se"); break; case 667: 375 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 808: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; default: hideIOSFullscreenPanel() } break; case 3: switch (window.innerWidth) { case 736: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 724: 375 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; case 808: 414 === window.innerHeight ? hideIOSFullscreenPanel() : showIOSFullscreenPanel(); break; default: hideIOSFullscreenPanel() } break; default: hideIOSFullscreenPanel() } } function iosResize() { __iosResize(); setTimeout(function() { __iosResize() }, 500) } function iosInIframe() { try { return window.self !== window.top } catch (a) { return !0 } } $(document).ready(function() { platform && "iPhone" === platform.product && "safari" !== platform.name.toLowerCase() && !iosInIframe() && (buildIOSFullscreenPanel(), buildIOSMeta()) }); jQuery(window).resize(function() { platform && "iPhone" === platform.product && "safari" !== platform.name.toLowerCase() && !iosInIframe() && iosResize() }); (function() { var a = "undefined" !== typeof window && "undefined" !== typeof window.document ? window.document : {}, b = "undefined" !== typeof module && module.exports, c = function() { for (var f, k = ["requestFullscreen exitFullscreen fullscreenElement fullscreenEnabled fullscreenchange fullscreenerror".split(" "), "webkitRequestFullscreen webkitExitFullscreen webkitFullscreenElement webkitFullscreenEnabled webkitfullscreenchange webkitfullscreenerror".split(" "), "webkitRequestFullScreen webkitCancelFullScreen webkitCurrentFullScreenElement webkitCancelFullScreen webkitfullscreenchange webkitfullscreenerror".split(" "), "mozRequestFullScreen mozCancelFullScreen mozFullScreenElement mozFullScreenEnabled mozfullscreenchange mozfullscreenerror".split(" "), "msRequestFullscreen msExitFullscreen msFullscreenElement msFullscreenEnabled MSFullscreenChange MSFullscreenError".split(" ") ], n = 0, q = k.length, r = {}; n < q; n++) if ((f = k[n]) && f[1] in a) { for (n = 0; n < f.length; n++) r[k[0][n]] = f[n]; return r } return !1 }(), g = { change: c.fullscreenchange, error: c.fullscreenerror }, m = { request: function(f) { return new Promise(function(k, n) { var q = function() { this.off("change", q); k() }.bind(this); this.on("change", q); f = f || a.documentElement; Promise.resolve(f[c.requestFullscreen]())["catch"](n) }.bind(this)) }, exit: function() { return new Promise(function(f, k) { if (this.isFullscreen) { var n = function() { this.off("change", n); f() }.bind(this); this.on("change", n); Promise.resolve(a[c.exitFullscreen]())["catch"](k) } else f() }.bind(this)) }, toggle: function(f) { return this.isFullscreen ? this.exit() : this.request(f) }, onchange: function(f) { this.on("change", f) }, onerror: function(f) { this.on("error", f) }, on: function(f, k) { var n = g[f]; n && a.addEventListener(n, k, !1) }, off: function(f, k) { var n = g[f]; n && a.removeEventListener(n, k, !1) }, raw: c }; c ? (Object.defineProperties(m, { isFullscreen: { get: function() { return !!a[c.fullscreenElement] } }, element: { enumerable: !0, get: function() { return a[c.fullscreenElement] } }, isEnabled: { enumerable: !0, get: function() { return !!a[c.fullscreenEnabled] } } }), b ? module.exports = m : window.screenfull = m) : b ? module.exports = { isEnabled: !1 } : window.screenfull = { isEnabled: !1 } })(); var s_iScaleFactor = 1, s_iOffsetX, s_iOffsetY, s_bIsIphone = !1, s_bFocus = !0; (function(a) { (jQuery.browser = jQuery.browser || {}).mobile = /android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(ad|hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|symbian|tablet|treo|up\.(browser|link)|vodafone|wap|webos|windows (ce|phone)|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|e\-|e\/|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(di|rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|xda(\-|2|g)|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)) })(navigator.userAgent || navigator.vendor || window.opera); $(window).resize(function() { sizeHandler() }); function trace(a) { console.log(a) } function isChrome() { return /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) } function isIpad() { var a = -1 !== navigator.userAgent.toLowerCase().indexOf("ipad"); return !a && navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && 2 < navigator.maxTouchPoints ? !0 : a } function isMobile() { return isIpad() ? !0 : jQuery.browser.mobile } function isIOS() { for (var a = "iPad Simulator;iPhone Simulator;iPod Simulator;iPad;iPhone;iPod".split(";"); a.length;) if (navigator.platform === a.pop()) return s_bIsIphone = !0; return s_bIsIphone = !1 } function getSize(a) { var b = a.toLowerCase(), c = window.document, g = c.documentElement; if (void 0 === window["inner" + a]) a = g["client" + a]; else if (window["inner" + a] != g["client" + a]) { var m = c.createElement("body"); m.id = "vpw-test-b"; m.style.cssText = "overflow:scroll"; var f = c.createElement("div"); f.id = "vpw-test-d"; f.style.cssText = "position:absolute;top:-1000px"; f.innerHTML = "<style>@media(" + b + ":" + g["client" + a] + "px){body#vpw-test-b div#vpw-test-d{" + b + ":7px!important}}</style>"; m.appendChild(f); g.insertBefore(m, c.head); a = 7 == f["offset" + a] ? g["client" + a] : window["inner" + a]; g.removeChild(m) } else a = window["inner" + a]; return a } window.addEventListener("orientationchange", onOrientationChange); function onOrientationChange() { window.matchMedia("(orientation: portrait)").matches && sizeHandler(); window.matchMedia("(orientation: landscape)").matches && sizeHandler() } function getIOSWindowHeight() { return document.documentElement.clientWidth / window.innerWidth * window.innerHeight } function getHeightOfIOSToolbars() { var a = (0 === window.orientation ? screen.height : screen.width) - getIOSWindowHeight(); return 1 < a ? a : 0 } function sizeHandler() { window.scrollTo(0, 1); if ($("#canvas")) { var a = null !== platform.name && "safari" === platform.name.toLowerCase() ? getIOSWindowHeight() : getSize("Height"); var b = getSize("Width"); s_bFocus && _checkOrientation(b, a); var c = Math.min(a / CANVAS_HEIGHT, b / CANVAS_WIDTH), g = Math.round(CANVAS_WIDTH * c); c = Math.round(CANVAS_HEIGHT * c); if (c < a) { var m = a - c; c += m; g += CANVAS_WIDTH / CANVAS_HEIGHT * m } else g < b && (m = b - g, g += m, c += CANVAS_HEIGHT / CANVAS_WIDTH * m); m = a / 2 - c / 2; var f = b / 2 - g / 2, k = CANVAS_WIDTH / g; if (f * k < -EDGEBOARD_X || m * k < -EDGEBOARD_Y) c = Math.min(a / (CANVAS_HEIGHT - 2 * EDGEBOARD_Y), b / (CANVAS_WIDTH - 2 * EDGEBOARD_X)), g = Math.round(CANVAS_WIDTH * c), c = Math.round(CANVAS_HEIGHT * c), m = (a - c) / 2, f = (b - g) / 2, k = CANVAS_WIDTH / g; s_iOffsetX = -1 * f * k; s_iOffsetY = -1 * m * k; 0 <= m && (s_iOffsetY = 0); 0 <= f && (s_iOffsetX = 0); null !== s_oInterface && s_oInterface.refreshButtonPos(s_iOffsetX, s_iOffsetY); null !== s_oMenu && s_oMenu.refreshButtonPos(s_iOffsetX, s_iOffsetY); s_bIsIphone ? (canvas = document.getElementById("canvas"), s_oStage.canvas.width = 2 * g, s_oStage.canvas.height = 2 * c, canvas.style.width = g + "px", canvas.style.height = c + "px", s_oStage.scaleX = s_oStage.scaleY = 2 * Math.min(g / CANVAS_WIDTH, c / CANVAS_HEIGHT)) : s_bMobile || isChrome() ? ($("#canvas").css("width", g + "px"), $("#canvas").css("height", c + "px")) : (s_oStage.canvas.width = g, s_oStage.canvas.height = c, s_iScaleFactor = Math.min(g / CANVAS_WIDTH, c / CANVAS_HEIGHT), s_oStage.scaleX = s_oStage.scaleY = s_iScaleFactor); 0 > m || (m = (a - c) / 2); $("#canvas").css("top", m + "px"); $("#canvas").css("left", f + "px"); fullscreenHandler() } } function _checkOrientation(a, b) { s_bMobile && ENABLE_CHECK_ORIENTATION && (a > b ? "landscape" === $(".orientation-msg-container").attr("data-orientation") ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate()) : "portrait" === $(".orientation-msg-container").attr("data-orientation") ? ($(".orientation-msg-container").css("display", "none"), s_oMain.startUpdate()) : ($(".orientation-msg-container").css("display", "block"), s_oMain.stopUpdate())) } function createBitmap(a, b, c) { var g = new createjs.Bitmap(a), m = new createjs.Shape; b && c ? m.graphics.beginFill("#fff").drawRect(0, 0, b, c) : m.graphics.beginFill("#ff0").drawRect(0, 0, a.width, a.height); g.hitArea = m; return g } function createSprite(a, b, c, g, m, f) { a = null !== b ? new createjs.Sprite(a, b) : new createjs.Sprite(a); b = new createjs.Shape; b.graphics.beginFill("#000000").drawRect(-c, -g, m, f); a.hitArea = b; return a } function randomFloatBetween(a, b, c) { "undefined" === typeof c && (c = 2); return parseFloat(Math.min(a + Math.random() * (b - a), b).toFixed(c)) } function shuffle(a) { for (var b = a.length, c, g; 0 !== b;) g = Math.floor(Math.random() * b), --b, c = a[b], a[b] = a[g], a[g] = c; return a } function bubbleSort(a) { do { var b = !1; for (var c = 0; c < a.length - 1; c++) a[c] > a[c + 1] && (b = a[c], a[c] = a[c + 1], a[c + 1] = b, b = !0) } while (b) } function compare(a, b) { return a.index > b.index ? -1 : a.index < b.index ? 1 : 0 } function formatTime(a) { a /= 1E3; var b = Math.floor(a / 60); a = Math.floor(a - 60 * b); var c = ""; c = 10 > b ? c + ("0" + b + ":") : c + (b + ":"); return 10 > a ? c + ("0" + a) : c + a } function NoClickDelay(a) { this.element = a; window.Touch && this.element.addEventListener("touchstart", this, !1) } function shuffle(a) { for (var b = a.length, c, g; 0 < b;) g = Math.floor(Math.random() * b), b--, c = a[b], a[b] = a[g], a[g] = c; return a } NoClickDelay.prototype = { handleEvent: function(a) { switch (a.type) { case "touchstart": this.onTouchStart(a); break; case "touchmove": this.onTouchMove(a); break; case "touchend": this.onTouchEnd(a) } }, onTouchStart: function(a) { a.preventDefault(); this.moved = !1; this.element.addEventListener("touchmove", this, !1); this.element.addEventListener("touchend", this, !1) }, onTouchMove: function(a) { this.moved = !0 }, onTouchEnd: function(a) { this.element.removeEventListener("touchmove", this, !1); this.element.removeEventListener("touchend", this, !1); if (!this.moved) { a = document.elementFromPoint(a.changedTouches[0].clientX, a.changedTouches[0].clientY); 3 == a.nodeType && (a = a.parentNode); var b = document.createEvent("MouseEvents"); b.initEvent("click", !0, !0); a.dispatchEvent(b) } } }; (function() { function a(c) { var g = { focus: "visible", focusin: "visible", pageshow: "visible", blur: "hidden", focusout: "hidden", pagehide: "hidden" }; c = c || window.event; c.type in g ? document.body.className = g[c.type] : (document.body.className = this[b] ? "hidden" : "visible", "hidden" === document.body.className ? (s_oMain.stopUpdate(), s_bFocus = !1) : (s_oMain.startUpdate(), s_bFocus = !0)) } var b = "hidden"; b in document ? document.addEventListener("visibilitychange", a) : (b = "mozHidden") in document ? document.addEventListener("mozvisibilitychange", a) : (b = "webkitHidden") in document ? document.addEventListener("webkitvisibilitychange", a) : (b = "msHidden") in document ? document.addEventListener("msvisibilitychange", a) : "onfocusin" in document ? document.onfocusin = document.onfocusout = a : window.onpageshow = window.onpagehide = window.onfocus = window.onblur = a })(); function playSound(a, b, c) { return !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (s_aSounds[a].play(), s_aSounds[a].volume(b), s_aSounds[a].loop(c), s_aSounds[a]) : null } function stopSound(a) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].stop() } function setVolume(a, b) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].volume(b) } function setMute(a, b) { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || s_aSounds[a].mute(b) } function ctlArcadeResume() { null !== s_oMain && s_oMain.startUpdate() } function ctlArcadePause() { null !== s_oMain && s_oMain.stopUpdate() } function getParamValue(a) { for (var b = window.location.search.substring(1).split("&"), c = 0; c < b.length; c++) { var g = b[c].split("="); if (g[0] == a) return g[1] } } function fullscreenHandler() { ENABLE_FULLSCREEN && screenfull.isEnabled && (s_bFullscreen = screenfull.isFullscreen, null !== s_oInterface && s_oInterface.resetFullscreenBut(), null !== s_oMenu && s_oMenu.resetFullscreenBut()) } if (screenfull.isEnabled) screenfull.on("change", function() { s_bFullscreen = screenfull.isFullscreen; null !== s_oInterface && s_oInterface.resetFullscreenBut(); null !== s_oMenu && s_oMenu.resetFullscreenBut() }); function CSpriteLibrary() { var a = {}, b, c, g, m, f, k; this.init = function(n, q, r) { b = {}; g = c = 0; m = n; f = q; k = r }; this.addSprite = function(n, q) { if (!a.hasOwnProperty(n)) { var r = new Image; a[n] = b[n] = { szPath: q, oSprite: r, bLoaded: !1 }; c++ } }; this.getSprite = function(n) { return a.hasOwnProperty(n) ? a[n].oSprite : null }; this._onSpritesLoaded = function() { c = 0; f.call(k) }; this._onSpriteLoaded = function() { m.call(k); ++g === c && this._onSpritesLoaded() }; this.loadSprites = function() { for (var n in b) b[n].oSprite.oSpriteLibrary = this, b[n].oSprite.szKey = n, b[n].oSprite.onload = function() { this.oSpriteLibrary.setLoaded(this.szKey); this.oSpriteLibrary._onSpriteLoaded(this.szKey) }, b[n].oSprite.onerror = function(q) { var r = q.currentTarget; setTimeout(function() { b[r.szKey].oSprite.src = b[r.szKey].szPath }, 500) }, b[n].oSprite.src = b[n].szPath }; this.setLoaded = function(n) { a[n].bLoaded = !0 }; this.isLoaded = function(n) { return a[n].bLoaded }; this.getNumSprites = function() { return c } } var CANVAS_WIDTH = 1920, CANVAS_HEIGHT = 1080, EDGEBOARD_X = 220, EDGEBOARD_Y = 220, DISABLE_SOUND_MOBILE = !1, FONT_GAME = "walibi0615bold", STATE_LOADING = 0, STATE_MENU = 1, STATE_HELP = 1, STATE_GAME = 3, ON_MOUSE_DOWN = 0, ON_MOUSE_UP = 1, ON_MOUSE_OVER = 2, ON_MOUSE_OUT = 3, ON_DRAG_START = 4, ON_DRAG_END = 5, CARD_WIDTH = 160, CARD_HEIGHT = 252, MAX_CARDS = 50, SCORE_MATCH_CARD, SCORE_TIME_LEFT_MULT, TIME_FOR_MATCH_MULT, TIME_SHOW_NO_MATCH, NUM_BACKGROUNDS = 6, TIME_SHOW_CARDS, ENABLE_FULLSCREEN, ENABLE_CHECK_ORIENTATION, TEXT_GAMEOVER = "GAME OVER", TEXT_PLAY = "PLAY", TEXT_LEVEL_SCORE = "LEVEL SCORE", TEXT_LEVELCOMPLETED = "STAGE CLEARED!", TEXT_TIMELEFT = "Time ", TEXT_SCORE = "Score ", TEXT_MATCH_SCORE = "SCORE MATCHING", TEXT_TIMEBONUS = "TIME BONUS", TEXT_TOTALSCORE = "TOTAL SCORE", TEXT_VICTORY = "CONGRATULATIONS!!", TEXT_PLAY_AGAIN = "PLAY AGAIN", TEXT_DEVELOPED = "DEVELOPED BY", TEXT_PRELOADER_CONTINUE = "START", TEXT_SHARE_IMAGE = "200x200.jpg", TEXT_SHARE_TITLE = "Congratulations!", TEXT_SHARE_MSG1 = "You collected <strong>", TEXT_SHARE_MSG2 = " points</strong>!<br><br>Share your score with your friends!", TEXT_SHARE_SHARE1 = "My score is ", TEXT_SHARE_SHARE2 = " points! Can you do better?"; function CPreloader() { var a, b, c, g, m, f, k, n, q, r; this._init = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("progress_bar", "./sprites/progress_bar.png"); s_oSpriteLibrary.addSprite("200x200", "./sprites/200x200.jpg"); s_oSpriteLibrary.addSprite("but_start", "./sprites/but_start.png"); s_oSpriteLibrary.loadSprites(); r = new createjs.Container; s_oStage.addChild(r) }; this.unload = function() { r.removeAllChildren(); q.unload() }; this._onImagesLoaded = function() {}; this._onAllImagesLoaded = function() { this.attachSprites(); s_oMain.preloaderReady() }; this.attachSprites = function() { var h = new createjs.Shape; h.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); r.addChild(h); h = s_oSpriteLibrary.getSprite("200x200"); k = createBitmap(h); k.regX = .5 * h.width; k.regY = .5 * h.height; k.x = CANVAS_WIDTH / 2; k.y = CANVAS_HEIGHT / 2 - 140; r.addChild(k); n = new createjs.Shape; n.graphics.beginFill("rgba(0,0,0,0.01)").drawRoundRect(k.x - 100, k.y - 100, 200, 200, 10); r.addChild(n); k.mask = n; h = s_oSpriteLibrary.getSprite("progress_bar"); g = createBitmap(h); g.x = CANVAS_WIDTH / 2 - h.width / 2; g.y = CANVAS_HEIGHT / 2 + 90; r.addChild(g); a = h.width; b = h.height; m = new createjs.Shape; m.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(g.x, g.y, 1, b); r.addChild(m); g.mask = m; c = new createjs.Text("", "30px " + FONT_GAME, "#fff"); c.x = CANVAS_WIDTH / 2; c.y = CANVAS_HEIGHT / 2 + 140; c.textBaseline = "alphabetic"; c.textAlign = "center"; r.addChild(c); h = s_oSpriteLibrary.getSprite("but_start"); q = new CTextButton(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 2 + 40, h, TEXT_PRELOADER_CONTINUE, "Arial", "#000", 50, r); q.addEventListener(ON_MOUSE_UP, this._onButStartRelease, this); q.setVisible(!1); f = new createjs.Shape; f.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); r.addChild(f); createjs.Tween.get(f).to({ alpha: 0 }, 500).call(function() { createjs.Tween.removeTweens(f); r.removeChild(f) }) }; this._onButStartRelease = function() { s_oMain._onRemovePreloader() }; this.refreshLoader = function(h) { c.text = h + "%"; 100 === h && (s_oMain._onRemovePreloader(), c.visible = !1, g.visible = !1); m.graphics.clear(); h = Math.floor(h * a / 100); m.graphics.beginFill("rgba(0,0,0,0.01)").drawRect(g.x, g.y, h, b) }; this._init() } function CMain(a) { var b, c = 0, g = 0, m = STATE_LOADING, f, k; this.initContainer = function() { s_oStage = new createjs.Stage("canvas"); createjs.Touch.enable(s_oStage, !0); s_bMobile = isMobile(); !1 === s_bMobile && s_oStage.enableMouseOver(20); s_iPrevTime = (new Date).getTime(); createjs.Ticker.framerate = 30; createjs.Ticker.addEventListener("tick", this._update); navigator.userAgent.match(/Windows Phone/i) && (DISABLE_SOUND_MOBILE = !0); s_oSpriteLibrary = new CSpriteLibrary; f = new CPreloader; b = !0 }; this.soundLoaded = function() { c++; f.refreshLoader(Math.floor(c / g * 100)) }; this._initSounds = function() { Howler.mute(!s_bAudioActive); s_aSoundsInfo = []; s_aSoundsInfo.push({ path: "./sounds/", filename: "card", loop: !1, volume: 1, ingamename: "card" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "win", loop: !1, volume: 1, ingamename: "win" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "game_over", loop: !1, volume: 1, ingamename: "game_over" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "next_level", loop: !1, volume: 1, ingamename: "next_level" }); s_aSoundsInfo.push({ path: "./sounds/", filename: "right", loop: !1, volume: 1, ingamename: "right" }); g += s_aSoundsInfo.length; s_aSounds = []; for (var q = 0; q < s_aSoundsInfo.length; q++) this.tryToLoadSound(s_aSoundsInfo[q], !1) }; this.tryToLoadSound = function(q, r) { setTimeout(function() { s_aSounds[q.ingamename] = new Howl({ src: [q.path + q.filename + ".mp3"], autoplay: !1, preload: !0, loop: q.loop, volume: q.volume, onload: s_oMain.soundLoaded, onloaderror: function(h, l) { for (var u = 0; u < s_aSoundsInfo.length; u++) if (h === s_aSounds[s_aSoundsInfo[u].ingamename]._sounds[0]._id) { s_oMain.tryToLoadSound(s_aSoundsInfo[u], !0); break } }, onplayerror: function(h) { for (var l = 0; l < s_aSoundsInfo.length; l++) if (h === s_aSounds[s_aSoundsInfo[l].ingamename]._sounds[0]._id) { s_aSounds[s_aSoundsInfo[l].ingamename].once("unlock", function() { s_aSounds[s_aSoundsInfo[l].ingamename].play() }); break } } }) }, r ? 200 : 0) }; this._loadImages = function() { s_oSpriteLibrary.init(this._onImagesLoaded, this._onAllImagesLoaded, this); s_oSpriteLibrary.addSprite("but_menu_bg", "./sprites/but_menu_bg.png"); s_oSpriteLibrary.addSprite("but_exit", "./sprites/but_exit.png"); s_oSpriteLibrary.addSprite("bg_menu", "./sprites/bg_menu.jpg"); s_oSpriteLibrary.addSprite("audio_icon", "./sprites/audio_icon.png"); s_oSpriteLibrary.addSprite("bg_1", "./sprites/bg_1.jpg"); s_oSpriteLibrary.addSprite("bg_2", "./sprites/bg_2.jpg"); s_oSpriteLibrary.addSprite("bg_3", "./sprites/bg_3.jpg"); s_oSpriteLibrary.addSprite("bg_4", "./sprites/bg_4.jpg"); s_oSpriteLibrary.addSprite("bg_5", "./sprites/bg_5.jpg"); s_oSpriteLibrary.addSprite("bg_6", "./sprites/bg_6.jpg"); s_oSpriteLibrary.addSprite("card_spritesheet", "./sprites/card_spritesheet.png"); s_oSpriteLibrary.addSprite("msg_box", "./sprites/msg_box.png"); s_oSpriteLibrary.addSprite("but_credits", "./sprites/but_credits.png"); s_oSpriteLibrary.addSprite("logo_ctl", "./sprites/logo_ctl.png"); s_oSpriteLibrary.addSprite("but_fullscreen", "./sprites/but_fullscreen.png"); g += s_oSpriteLibrary.getNumSprites(); s_oSpriteLibrary.loadSprites() }; this._onImagesLoaded = function() { c++; f.refreshLoader(Math.floor(c / g * 100)) }; this._onAllImagesLoaded = function() {}; this.preloaderReady = function() { this._loadImages(); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || this._initSounds(); b = !0 }; this._onRemovePreloader = function() { f.unload(); this.gotoMenu() }; this.gotoMenu = function() { new CMenu; m = STATE_MENU }; this.gotoGame = function() { k = new CGame(n); m = STATE_GAME }; this.gotoHelp = function() { new CHelp; m = STATE_HELP }; this.stopUpdate = function() { b = !1; createjs.Ticker.paused = !0; $("#block_game").css("display", "block"); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || Howler.mute(!0) }; this.startUpdate = function() { s_iPrevTime = (new Date).getTime(); b = !0; createjs.Ticker.paused = !1; $("#block_game").css("display", "none"); (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) && s_bAudioActive && Howler.mute(!1) }; this._update = function(q) { if (!1 !== b) { var r = (new Date).getTime(); s_iTimeElaps = r - s_iPrevTime; s_iCntTime += s_iTimeElaps; s_iCntFps++; s_iPrevTime = r; 1E3 <= s_iCntTime && (s_iCurFps = s_iCntFps, s_iCntTime -= 1E3, s_iCntFps = 0); m === STATE_GAME && k.update(); s_oStage.update(q) } }; s_oMain = this; var n = a; ENABLE_FULLSCREEN = a.fullscreen; ENABLE_CHECK_ORIENTATION = a.check_orientation; s_bAudioActive = a.audio_enable_on_startup; TIME_SHOW_NO_MATCH = a.time_showing_card; this.initContainer() } var s_bMobile, s_bAudioActive = !0, s_iCntTime = 0, s_iTimeElaps = 0, s_iPrevTime = 0, s_iCntFps = 0, s_iCurFps = 0, s_oDrawLayer, s_oStage, s_oMain, s_oSpriteLibrary, s_oGameSettings, s_bFullscreen = !1, s_aSoundsInfo, s_aSounds; function CTextButton(a, b, c, g, m, f, k, n) { var q, r, h, l, u, x, D, y, z, H, E; this._init = function(e, v, A, B, C, N, w) { q = !1; r = 1; h = []; l = []; E = createBitmap(A); y = new createjs.Container; y.x = e; y.y = v; y.regX = A.width / 2; y.regY = A.height / 2; s_bMobile || (y.cursor = "pointer"); y.addChild(E); n.addChild(y); H = new CTLText(y, 12, 7, A.width - 20, A.height - 10, w, "center", "#000", C, 1, 0, 0, B, !0, !0, !1, !1); z = new CTLText(y, 10, 5, A.width - 20, A.height - 10, w, "center", N, C, 1, 0, 0, B, !0, !0, !1, !1); this._initListener() }; this.unload = function() { y.off("mousedown", u); y.off("pressup", x); n.removeChild(y) }; this.setVisible = function(e) { y.visible = e }; this.setScale = function(e) { r = y.scaleX = y.scaleY = e }; this.enable = function() { q = !1 }; this.disable = function() { q = !0 }; this._initListener = function() { u = y.on("mousedown", this.buttonDown); x = y.on("pressup", this.buttonRelease) }; this.addEventListener = function(e, v, A) { h[e] = v; l[e] = A }; this.addEventListenerWithParams = function(e, v, A, B) { h[e] = v; l[e] = A; D = B }; this.buttonRelease = function() { q || (y.scaleX = r, y.scaleY = r, h[ON_MOUSE_UP] && h[ON_MOUSE_UP].call(l[ON_MOUSE_UP], D)) }; this.buttonDown = function() { q || (y.scaleX = .9 * r, y.scaleY = .9 * r, h[ON_MOUSE_DOWN] && h[ON_MOUSE_DOWN].call(l[ON_MOUSE_DOWN])) }; this.setPosition = function(e, v) { y.x = e; y.y = v }; this.tweenPosition = function(e, v, A, B, C, N, w) { createjs.Tween.get(y).wait(B).to({ x: e, y: v }, A, C).call(function() { void 0 !== N && N.call(w) }) }; this.changeText = function(e) { z.refreshText(e); H.refreshText(e) }; this.setX = function(e) { y.x = e }; this.setY = function(e) { y.y = e }; this.getButtonImage = function() { return y }; this.getX = function() { return y.x }; this.getY = function() { return y.y }; this.getSprite = function() { return y }; this.getScale = function() { return y.scaleX }; this._init(a, b, c, g, m, f, k) } function CGfxButton(a, b, c, g) { var m, f, k, n = [], q, r, h; this._init = function(u, x, D) { m = !1; f = []; k = []; h = createBitmap(D); h.x = u; h.y = x; h.regX = D.width / 2; h.regY = D.height / 2; s_bMobile || (h.cursor = "pointer"); l.addChild(h); this._initListener() }; this.unload = function() { h.off("mousedown", q); h.off("pressup", r); l.removeChild(h) }; this.setVisible = function(u) { h.visible = u }; this._initListener = function() { q = h.on("mousedown", this.buttonDown); r = h.on("pressup", this.buttonRelease) }; this.addEventListener = function(u, x, D) { f[u] = x; k[u] = D }; this.addEventListenerWithParams = function(u, x, D, y) { f[u] = x; k[u] = D; n = y }; this.buttonRelease = function() { m || (h.scaleX = 1, h.scaleY = 1, f[ON_MOUSE_UP] && f[ON_MOUSE_UP].call(k[ON_MOUSE_UP], n)) }; this.buttonDown = function() { m || (h.scaleX = .9, h.scaleY = .9, f[ON_MOUSE_DOWN] && f[ON_MOUSE_DOWN].call(k[ON_MOUSE_DOWN], n)) }; this.setPosition = function(u, x) { h.x = u; h.y = x }; this.setX = function(u) { h.x = u }; this.setY = function(u) { h.y = u }; this.enable = function() { m = !1 }; this.disable = function() { m = !0 }; this.getButtonImage = function() { return h }; this.getX = function() { return h.x }; this.getY = function() { return h.y }; var l = g; this._init(a, b, c); return this } function CToggle(a, b, c, g, m) { var f, k, n, q, r, h, l; this._init = function(u, x, D, y, z) { l = void 0 !== z ? z : s_oStage; k = []; n = []; z = new createjs.SpriteSheet({ images: [D], frames: { width: D.width / 2, height: D.height, regX: D.width / 2 / 2, regY: D.height / 2 }, animations: { state_true: [0], state_false: [1] } }); f = y; h = createSprite(z, "state_" + f, D.width / 2 / 2, D.height / 2, D.width / 2, D.height); h.x = u; h.y = x; h.stop(); s_bMobile || (h.cursor = "pointer"); l.addChild(h); this._initListener() }; this.unload = function() { h.off("mousedown", q); h.off("pressup", r); l.removeChild(h) }; this._initListener = function() { q = h.on("mousedown", this.buttonDown); r = h.on("pressup", this.buttonRelease) }; this.addEventListener = function(u, x, D) { k[u] = x; n[u] = D }; this.setCursorType = function(u) { h.cursor = u }; this.setActive = function(u) { f = u; h.gotoAndStop("state_" + f) }; this.buttonRelease = function() { h.scaleX = 1; h.scaleY = 1; f = !f; h.gotoAndStop("state_" + f); k[ON_MOUSE_UP] && k[ON_MOUSE_UP].call(n[ON_MOUSE_UP], f) }; this.buttonDown = function() { h.scaleX = .9; h.scaleY = .9; k[ON_MOUSE_DOWN] && k[ON_MOUSE_DOWN].call(n[ON_MOUSE_DOWN]) }; this.setPosition = function(u, x) { h.x = u; h.y = x }; this._init(a, b, c, g, m) } function CMenu() { var a, b, c, g, m, f, k, n, q, r, h, l, u, x, D = null, y = null; this._init = function() { q = createBitmap(s_oSpriteLibrary.getSprite("bg_menu")); s_oStage.addChild(q); m = CANVAS_WIDTH / 2; f = CANVAS_HEIGHT - 70; var z = s_oSpriteLibrary.getSprite("but_menu_bg"); r = new CTextButton(m, f, z, TEXT_PLAY, FONT_GAME, "White", "24", s_oStage); r.setScale(2); r.addEventListener(ON_MOUSE_UP, this._onButPlayRelease, this); var H = s_oSpriteLibrary.getSprite("but_credits"); c = H.width / 2 + 10; g = H.height / 2 + 10; h = new CGfxButton(c, g, H, s_oStage); h.addEventListener(ON_MOUSE_UP, this._onButCreditsRelease, this); !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (z = s_oSpriteLibrary.getSprite("audio_icon"), k = CANVAS_WIDTH - z.height / 2 - 10, n = z.height / 2 + 10, l = new CToggle(k, n, z, s_bAudioActive, s_oStage), l.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this), a = k - z.width / 2 - 10) : a = CANVAS_WIDTH - z.height / 2 - 10; b = z.height / 2 + 10; z = window.document; H = z.documentElement; D = H.requestFullscreen || H.mozRequestFullScreen || H.webkitRequestFullScreen || H.msRequestFullscreen; y = z.exitFullscreen || z.mozCancelFullScreen || z.webkitExitFullscreen || z.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (D = !1); D && screenfull.isEnabled && (z = s_oSpriteLibrary.getSprite("but_fullscreen"), x = new CToggle(a, b, z, s_bFullscreen, s_oStage), x.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); u = new createjs.Shape; u.graphics.beginFill("black").drawRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT); s_oStage.addChild(u); createjs.Tween.get(u).to({ alpha: 0 }, 1E3).call(function() { u.visible = !1 }); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.unload = function() { r.unload(); r = null; h.unload(); if (!1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile) l.unload(), l = null; D && screenfull.isEnabled && x.unload(); s_oStage.removeAllChildren() }; this.refreshButtonPos = function(z, H) { r.setPosition(m, f - H); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || l.setPosition(k - z, H + n); D && screenfull.isEnabled && x.setPosition(a - z, b + H); h.setPosition(c + z, g + H) }; this._onButPlayRelease = function() { this.unload(); $(s_oMain).trigger("start_session"); s_oMain.gotoGame(); s_oMenu = null }; this._onButCreditsRelease = function() { new CCredits }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this.resetFullscreenBut = function() { D && screenfull.isEnabled && x.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? y.call(window.document) : D.call(window.document.documentElement); sizeHandler() }; s_oMenu = this; this._init() } var s_oMenu = null; function CGame(a) { var b = !0, c = 4, g = 0, m = 0, f, k, n = 0, q, r = 0, h = 0, l = [], u, x, D, y, z, H; this._init = function() { var E = { images: [s_oSpriteLibrary.getSprite("card_spritesheet")], frames: { width: CARD_WIDTH, height: CARD_HEIGHT, regX: CARD_WIDTH / 2, regY: CARD_HEIGHT / 2 }, animations: { card0: [0], card1: [1], card2: [2], card3: [3], card4: [4], card5: [5], card6: [6], card7: [7], card8: [9], card9: [10], card10: [11], card11: [12], card12: [13], card13: [14], card14: [15], card15: [16], back: [17] } }; this.spriteSheet = new createjs.SpriteSheet(E); u = new createjs.Container; s_oStage.addChild(u); H = new createjs.Container; s_oStage.addChild(H); x = new CInterface(formatTime(f)); D = new CNextLevel; y = new CGameOver; z = new CVictory; this.nextLevel() }; this.unload = function(E) { for (var e = 0; e < l.length; e++) l[e].unload(); s_oStage.removeAllChildren(); x.unload(); E && $(s_oMain).trigger("end_level", g); $(s_oMain).trigger("end_session"); $(s_oMain).trigger("share_event", n); s_oMain.gotoMenu() }; this.cardClicked = function(E, e) { !0 === E.isFolded() && !1 === b && 2 > m && E.flipCard() }; this.addFlippedCard = function() { m++; 2 === m && !1 === b && this.checkMatching() }; this.checkMatching = function() { for (var E = [], e = [], v = 0; v < c; v++) !1 === l[v].isFolded() && (e.push(l[v].getType()), E.push(v)); if (e[0] === e[1]) { if (e = 1, k < TIME_FOR_MATCH_MULT ? (k = 0, x.showMultiplier(q), e = q, q++) : (q = 2, k = 0), playSound("right", 1, !1), l[E[0]].eliminateCard(), l[E[1]].eliminateCard(), l.splice(E[0], 1), l.splice(E[1] - 1, 1), c -= 2, n += SCORE_MATCH_CARD * e, r += SCORE_MATCH_CARD * e, x.refreshScore(n), 0 === c && g <= s_aCardsPerLevel.length) { b = !0; var A = this; setTimeout(function() { A.checkVictory() }, 1E3) } } else b = !0, setTimeout(function() { l[E[0]].flipCard(); l[E[0]].clickListener(); l[E[1]].flipCard(); l[E[1]].clickListener(); b = !1 }, TIME_SHOW_NO_MATCH); m = 0 }; this.checkVictory = function() { b = !0; h = Math.round(f / 1E3 * SCORE_TIME_LEFT_MULT); n += h; x.refreshScore(n); $(s_oMain).trigger("end_level", g); g < s_aCardsPerLevel.length ? (playSound("next_level", 1, !1), D.display(r, h, r + h, n, g)) : (playSound("win", 1, !1), z.display(n)) }; this.nextLevel = function() { g++; $(s_oMain).trigger("start_level", g); u.removeAllChildren(); var E = createBitmap(s_oSpriteLibrary.getSprite("bg_" + (Math.floor(Math.random() * NUM_BACKGROUNDS) + 1))); u.addChild(E); E = CLevels(g); c = E.cardsNum; f = E.timeAllotted; k = TIME_FOR_MATCH_MULT; for (var e = [], v = 0; v < c / 2; v++) e[v] = v, e[v + c / 2] = v; for (v = 0; v < c; v++) { var A = Math.floor(Math.random() * e.length); l[v] = new CCard(E.cardsPos[v][0], E.cardsPos[v][1], "card" + e[A], E.cardZoomFactor, H); e.splice(A, 1) } _iGameOverScore = h = r = 0; q = 2; b = !1 }; this.suspendUpdates = function() { b = !0 }; this.restartUpdates = function() { 0 < c && (b = !1) }; this.update = function() { b || (f -= s_iTimeElaps, k += s_iTimeElaps, 0 > f ? (b = !0, f = 0, playSound("game_over", 1, !1), y.display(n), g = 1) : x.update(formatTime(f))) }; this.spriteSheet = {}; s_oGame = this; SCORE_MATCH_CARD = a.score_match_card; SCORE_TIME_LEFT_MULT = a.score_time_left_mult; TIME_FOR_MATCH_MULT = a.time_match_mult; s_aCardsPerLevel = a.card_per_level; s_aSecsPerLevel = a.time_level; TIME_SHOW_CARDS = 1E3 * a.show_cards; this._init() } var s_aCardsPerLevel, s_aSecsPerLevel, s_oGame; function CCard(a, b, c, g, m) { var f = !1, k, n, q, r, h, l, u, x; this._init = function(D, y, z, H, E) { q = D; r = y; _bEliminated = !1; k = !0; n = z; x = E; l = createSprite(s_oGame.spriteSheet, "back", CARD_WIDTH / 2, CARD_HEIGHT / 2, CARD_WIDTH, CARD_HEIGHT); l.x = q < CANVAS_WIDTH / 2 ? q - CANVAS_WIDTH : CANVAS_WIDTH + q; l.y = r + Math.floor(0 * (Math.random() - .5)); h = H; l.scaleX = l.scaleY = h; u = this; l.on("click", function() { this.clicked() }, u); s_bMobile || (l.cursor = "pointer"); f = !0; s_oGame.suspendUpdates(); x.addChild(l); var e = this; createjs.Tween.get(l).to({ alpha: 1, x: q, y: r }, 500).call(function() { f = !1; s_oGame.restartUpdates(); 0 < TIME_SHOW_CARDS && e.showCardFirstTime() }) }; this.unload = function() { x.removeChild(l) }; this.update = function() {}; this.clicked = function() { !1 === f && k && (s_oGame.cardClicked(this, n), playSound("card", 1, !1), this.clickListener()) }; this.showCardFirstTime = function() { f = !0; createjs.Tween.get(l).to({ scaleX: .1 }, 100).call(function() { x.removeChild(l); l = createSprite(s_oGame.spriteSheet, n, CARD_WIDTH / 2, CARD_HEIGHT / 2, CARD_WIDTH, CARD_HEIGHT); l.x = q; l.y = r; l.scaleX = l.scaleY = h; x.addChild(l); createjs.Tween.get(l).wait(TIME_SHOW_CARDS).to({ scaleX: h }, 100).call(function() { k = f = !1; u.clickListener(); u.flipCard() }, u) }) }; this.flipCard = function() { !0 === k ? (f = !0, createjs.Tween.get(l).to({ scaleX: .1 }, 100).call(function() { x.removeChild(l); l = createSprite(s_oGame.spriteSheet, n, CARD_WIDTH / 2, CARD_HEIGHT / 2, CARD_WIDTH, CARD_HEIGHT); l.x = q; l.y = r; l.scaleX = l.scaleY = h; x.addChild(l); createjs.Tween.get(l).to({ scaleX: h }, 100).call(function() { k = f = !1; s_oGame.addFlippedCard(); u.clickListener() }, u) })) : (playSound("card", 1, !1), f = !0, createjs.Tween.get(l).to({ scaleX: .1 }, 100).call(function() { x.removeChild(l); l = createSprite(s_oGame.spriteSheet, "back", CARD_WIDTH / 2, CARD_HEIGHT / 2, CARD_WIDTH, CARD_HEIGHT); l.x = q; l.y = r; l.scaleX = l.scaleY = h; x.addChild(l); createjs.Tween.get(l).to({ scaleX: h }, 100).call(function() { f = !1; s_oGame.restartUpdates(); k = !0; u.clickListener(); return !0 }, u) })) }; this.clickListener = function() { if (!1 === f) l.on("click", function() { this.clicked() }, u) }; this.display = function() {}; this.isFolded = function() { return k }; this.getType = function() { return n }; this.eliminateCard = function() { f = !0; s_oGame.suspendUpdates(); l.alpha = 1; createjs.Tween.get(l).to({ alpha: 0 }, 400).call(function() { x.removeChild(l); f = !1; s_oGame.restartUpdates() }) }; this._init(a, b, c, g, m) } var CLevels = function() { var a = CARD_HEIGHT / 2 + .2 * CANVAS_HEIGHT, b = CANVAS_WIDTH / 2, c = (CANVAS_HEIGHT - a) / 2 + a, g = CANVAS_HEIGHT - a; return function(m) { var f = s_aCardsPerLevel[m - 1]; f > MAX_CARDS && (f = MAX_CARDS); m = { cardZoomFactor: 1, cardsNum: f, cardsPos: [], timeAllotted: 1E3 * s_aSecsPerLevel[m - 1] }; for (var k = 1; .1 <= k; k -= .01) for (var n = 2; 6 >= n; n += 1) { var q = f / n; if (q * (CARD_WIDTH * k + 30 * k) <= CANVAS_WIDTH && n * (CARD_HEIGHT * k + 30 * k) <= g && 0 === f % n) { f = b - (q - 1) * (CARD_WIDTH * k + 30 * k) * .5; for (var r = c - (a + .5 * ((CARD_HEIGHT * k + 30 * k) * (n - 1) + a)), h = 0; h < n; h++) for (var l = 0; l < q; l++) m.cardsPos[h * q + l] = [f + (CARD_WIDTH * k + 30 * k) * l, r + a + (CARD_HEIGHT * k + 30 * k) * h]; m.cardZoomFactor = k; return m } } } }(); function CNextLevel() { var a, b, c, g, m, f, k; this._init = function() { k = new createjs.Container; k.alpha = 0; k.visible = !1; s_oStage.addChild(k); var n = createBitmap(s_oSpriteLibrary.getSprite("msg_box")); k.addChild(n); a = new CTLText(k, CANVAS_WIDTH / 2 - 300, CANVAS_HEIGHT / 2 - 150, 600, 48, 48, "center", "#fff", FONT_GAME, 1, 0, 0, TEXT_LEVELCOMPLETED, !0, !0, !1, !1); a.setShadow("#000000", 3, 3, 2); b = new CTLText(k, CANVAS_WIDTH / 2 - 300, CANVAS_HEIGHT / 2 - 70, 600, 30, 30, "center", "Pink", FONT_GAME, 1, 0, 0, TEXT_MATCH_SCORE, !0, !0, !1, !1); b.setShadow("#000000", 2, 2, 2); c = new CTLText(k, CANVAS_WIDTH / 2 - 300, CANVAS_HEIGHT / 2 - 34, 600, 30, 30, "center", "Pink", FONT_GAME, 1, 0, 0, TEXT_TIMEBONUS, !0, !0, !1, !1); c.setShadow("#000000", 2, 2, 2); m = new CTLText(k, CANVAS_WIDTH / 2 - 300, CANVAS_HEIGHT / 2, 600, 34, 34, "center", "Pink", FONT_GAME, 1, 0, 0, TEXT_LEVEL_SCORE, !0, !0, !1, !1); m.setShadow("#000000", 2, 2, 2); g = new CTLText(k, CANVAS_WIDTH / 2 - 300, CANVAS_HEIGHT / 2 + 70, 600, 48, 48, "center", "Pink", FONT_GAME, 1, 0, 0, TEXT_TOTALSCORE, !0, !0, !1, !1); g.setShadow("#000000", 2, 2, 2); f = new CTextButton(CANVAS_WIDTH / 2, 700, s_oSpriteLibrary.getSprite("but_menu_bg"), "CONTINUE", FONT_GAME, "White", "24", k); f.addEventListener(ON_MOUSE_UP, this.hide, this) }; this.display = function(n, q, r, h, l) { b.refreshText(TEXT_MATCH_SCORE + " = " + n); c.refreshText(TEXT_TIMEBONUS + " = " + q); m.refreshText(TEXT_LEVEL_SCORE + " = " + r); g.refreshText(TEXT_TOTALSCORE + " " + h); k.visible = !0; createjs.Tween.get(k).to({ alpha: 1 }, 250); $(s_oMain).trigger("save_score", h) }; this.hide = function() { k.alpha = 0; k.visible = !1; s_oGame.nextLevel() }; this.unload = function() { f.unload(); s_oStage.removeChild(k) }; this._init() } function CInterface(a) { var b, c, g, m, f, k, n, q, r, h, l, u, x, D, y, z, H, E = null, e = null; this._init = function(v) { g = 30; m = 75; D = TEXT_TIMELEFT + v; l = new createjs.Text(D, "36px " + FONT_GAME, "Pink"); l.x = g; l.y = m; l.textBaseline = "alphabetic"; l.shadow = new createjs.Shadow("#000000", 2, 2, 2); s_oStage.addChild(l); f = CANVAS_WIDTH / 2; k = 75; _szScore = TEXT_SCORE + 0; u = new createjs.Text(_szScore, "36px " + FONT_GAME, "Pink"); u.x = f; u.y = k; u.textAlign = "center"; u.textBaseline = "alphabetic"; u.shadow = new createjs.Shadow("#000000", 2, 2, 2); s_oStage.addChild(u); z = new createjs.Text("X2", "150px " + FONT_GAME, "#fff"); z.textAlign = "center"; z.textBaseline = "alphabetic"; z.x = CANVAS_WIDTH / 2; z.y = CANVAS_HEIGHT / 2; z.shadow = new createjs.Shadow("#000000", 2, 2, 2); z.scaleX = z.scaleY = .1; z.visible = !1; s_oStage.addChild(z); v = s_oSpriteLibrary.getSprite("but_exit"); r = CANVAS_WIDTH - v.width / 2 - 20; h = v.height / 2 + 30; var A = s_oSpriteLibrary.getSprite("audio_icon"); n = CANVAS_WIDTH - A.width - 10; q = A.height / 2 + 30; y = new CGfxButton(r, h, v, s_oStage); y.addEventListener(ON_MOUSE_UP, this._onExit, this); !1 === DISABLE_SOUND_MOBILE || !1 === s_bMobile ? (x = new CToggle(n, q, A, s_bAudioActive, s_oStage), x.addEventListener(ON_MOUSE_UP, this._onAudioToggle, this), b = n - v.width - 20, c = q) : (b = r - v.width - 20, c = h); v = window.document; A = v.documentElement; E = A.requestFullscreen || A.mozRequestFullScreen || A.webkitRequestFullScreen || A.msRequestFullscreen; e = v.exitFullscreen || v.mozCancelFullScreen || v.webkitExitFullscreen || v.msExitFullscreen; !1 === ENABLE_FULLSCREEN && (E = !1); E && screenfull.isEnabled && (v = s_oSpriteLibrary.getSprite("but_fullscreen"), H = new CToggle(b, c, v, s_bFullscreen, s_oStage), H.addEventListener(ON_MOUSE_UP, this._onFullscreenRelease, this)); this.refreshButtonPos(s_iOffsetX, s_iOffsetY) }; this.refreshButtonPos = function(v, A) { u.y = k + A; l.x = g + v; l.y = m + A; y.setPosition(r - v, A + h); !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || x.setPosition(n - v, A + q); E && screenfull.isEnabled && H.setPosition(b - v, c + A) }; this.unload = function() { !1 !== DISABLE_SOUND_MOBILE && !1 !== s_bMobile || x.unload(); E && screenfull.isEnabled && H.unload(); y.unload(); s_oStage.removeChild(l); s_oStage.removeChild(u); s_oInterface = null }; this.refreshScore = function(v) { u.text = TEXT_SCORE + v }; this.showMultiplier = function(v) { z.text = "X" + v; z.visible = !0; createjs.Tween.get(z).to({ scaleX: 1, scaleY: 1 }, 300, createjs.Ease.cubicOut).call(function() { createjs.Tween.get(z).to({ scaleX: .1, scaleY: .1 }, 300, createjs.Ease.cubicIn).call(function() { z.visible = !1 }) }) }; this.update = function(v) { l.text = TEXT_TIMELEFT + v }; this._onExit = function() { s_oGame.unload(!0) }; this._onAudioToggle = function() { Howler.mute(s_bAudioActive); s_bAudioActive = !s_bAudioActive }; this.resetFullscreenBut = function() { E && screenfull.isEnabled && H.setActive(s_bFullscreen) }; this._onFullscreenRelease = function() { s_bFullscreen ? e.call(window.document) : E.call(window.document.documentElement); sizeHandler() }; s_oInterface = this; this._init(a); return this } var s_oInterface = null; function CGameOver() { var a, b, c, g; this._init = function() { g = new createjs.Container; g.alpha = 0; g.visible = !1; s_oStage.addChild(g); var m = createBitmap(s_oSpriteLibrary.getSprite("msg_box")); g.addChild(m); a = new CTLText(g, CANVAS_WIDTH / 2 - 300, CANVAS_HEIGHT / 2 - 120, 600, 50, 50, "center", "#fff", FONT_GAME, 1, 0, 0, TEXT_GAMEOVER, !0, !0, !1, !1); a.setShadow("#000000", 3, 3, 2); b = new CTLText(g, CANVAS_WIDTH / 2 - 300, CANVAS_HEIGHT / 2, 600, 48, 48, "center", "Pink", FONT_GAME, 1, 0, 0, TEXT_TOTALSCORE + " 0", !0, !0, !1, !1); b.setShadow("#000000", 2, 2, 2); c = new CTextButton(CANVAS_WIDTH / 2, 700, s_oSpriteLibrary.getSprite("but_menu_bg"), TEXT_PLAY_AGAIN, FONT_GAME, "White", "24", g); c.addEventListener(ON_MOUSE_UP, this.unload, this) }; this.display = function(m) { b.refreshText(TEXT_TOTALSCORE + " " + m); g.visible = !0; createjs.Tween.get(g).to({ alpha: 1 }, 250).call(function() { $(s_oMain).trigger("show_interlevel_ad") }); $(s_oMain).trigger("save_score", m) }; this.unload = function() { c.unload(); s_oStage.removeChild(g); s_oGame.unload(!1) }; this._init() } function CVictory() { var a, b, c, g; this._init = function() { g = new createjs.Container; g.alpha = 0; g.visible = !1; s_oStage.addChild(g); var m = createBitmap(s_oSpriteLibrary.getSprite("msg_box")); g.addChild(m); b = new CTLText(g, CANVAS_WIDTH / 2 - 300, CANVAS_HEIGHT / 2 - 120, 600, 58, 58, "center", "#fff", FONT_GAME, 1, 0, 0, TEXT_VICTORY, !0, !0, !1, !1); b.setShadow("#000000", 3, 3, 2); c = new CTLText(g, CANVAS_WIDTH / 2 - 300, CANVAS_HEIGHT / 2, 600, 80, 38, "center", "Pink", FONT_GAME, 1, 0, 0, TEXT_TOTALSCORE, !0, !0, !1, !1); c.setShadow("#000000", 2, 2, 2); a = new CTextButton(CANVAS_WIDTH / 2, 700, s_oSpriteLibrary.getSprite("but_menu_bg"), TEXT_PLAY_AGAIN, FONT_GAME, "White", "24", g); a.addEventListener(ON_MOUSE_DOWN, this.unload, this) }; this.display = function(m) { c.refreshText(TEXT_TOTALSCORE + "\n" + m); g.visible = !0; createjs.Tween.get(g).to({ alpha: 1 }, 250).call(function() { $(s_oMain).trigger("show_interlevel_ad") }); $(s_oMain).trigger("save_score", m) }; this.unload = function() { a.unload(); s_oStage.removeChild(g); s_oGame.unload(!1) }; this._init() } function CCredits() { var a, b, c, g, m; this._init = function() { b = new createjs.Container; b.alpha = 0; s_oStage.addChild(b); var f = s_oSpriteLibrary.getSprite("msg_box"); a = createBitmap(f); a.regX = f.width / 2; a.regY = f.height / 2; m = a.on("click", this._onLogoButRelease); b.addChild(a); b.x = CANVAS_WIDTH / 2; b.y = CANVAS_HEIGHT / 2; f = new createjs.Text("DEVELOPED BY", "30px " + FONT_GAME, "#000"); f.x = 2; f.y = -78; f.textAlign = "center"; f.textBaseline = "middle"; f.lineWidth = 300; b.addChild(f); f = new createjs.Text("DEVELOPED BY", "30px " + FONT_GAME, "#ffffff"); f.y = -80; f.textAlign = "center"; f.textBaseline = "middle"; f.lineWidth = 300; b.addChild(f); f = new createjs.Text("www.codethislab.com", "30px " + FONT_GAME, "#000"); f.x = 2; f.y = 82; f.textAlign = "center"; f.textBaseline = "middle"; f.lineWidth = 300; b.addChild(f); f = new createjs.Text("www.codethislab.com", "30px " + FONT_GAME, "#ffffff"); f.y = 80; f.textAlign = "center"; f.textBaseline = "middle"; f.lineWidth = 300; b.addChild(f); f = s_oSpriteLibrary.getSprite("logo_ctl"); g = createBitmap(f); g.regX = f.width / 2; g.regY = f.height / 2; b.addChild(g); f = s_oSpriteLibrary.getSprite("but_exit"); c = new CGfxButton(290, -150, f, b); c.addEventListener(ON_MOUSE_UP, this.unload, this); (new createjs.Tween.get(b)).to({ alpha: 1 }, 500) }; this.unload = function() { c.disable(); s_oStage.removeChild(b); c.unload(); a.off("click", m) }; this._onLogoButRelease = function() { window.open("http://www.codethislab.com/index.php?&l=en") }; this._init() } CTLText.prototype = { constructor: CTLText, __autofit: function() { if (this._bFitText) { for (var a = this._iFontSize; (this._oText.getBounds().height > this._iHeight - 2 * this._iPaddingV || this._oText.getBounds().width > this._iWidth - 2 * this._iPaddingH) && !(a--, this._oText.font = a + "px " + this._szFont, this._oText.lineHeight = Math.round(a * this._fLineHeightFactor), this.__updateY(), this.__verticalAlign(), 8 > a);); this._iFontSize = a } }, __verticalAlign: function() { if (this._bVerticalAlign) { var a = this._oText.getBounds().height; this._oText.y -= (a - this._iHeight) / 2 + this._iPaddingV } }, __updateY: function() { this._oText.y = this._y + this._iPaddingV; switch (this._oText.textBaseline) { case "middle": this._oText.y += this._oText.lineHeight / 2 + (this._iFontSize * this._fLineHeightFactor - this._iFontSize) } }, __createText: function(a) { this._bDebug && (this._oDebugShape = new createjs.Shape, this._oDebugShape.graphics.beginFill("rgba(255,0,0,0.5)").drawRect(this._x, this._y, this._iWidth, this._iHeight), this._oContainer.addChild(this._oDebugShape)); this._oText = new createjs.Text(a, this._iFontSize + "px " + this._szFont, this._szColor); this._oText.textBaseline = "middle"; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this._oText.textAlign = this._szAlign; this._oText.lineWidth = this._bMultiline ? this._iWidth - 2 * this._iPaddingH : null; switch (this._szAlign) { case "center": this._oText.x = this._x + this._iWidth / 2; break; case "left": this._oText.x = this._x + this._iPaddingH; break; case "right": this._oText.x = this._x + this._iWidth - this._iPaddingH } this._oContainer.addChild(this._oText); this.refreshText(a) }, setVerticalAlign: function(a) { this._bVerticalAlign = a }, setOutline: function(a) { null !== this._oText && (this._oText.outline = a) }, setShadow: function(a, b, c, g) { null !== this._oText && (this._oText.shadow = new createjs.Shadow(a, b, c, g)) }, setColor: function(a) { this._oText.color = a }, setAlpha: function(a) { this._oText.alpha = a }, removeTweens: function() { createjs.Tween.removeTweens(this._oText) }, getText: function() { return this._oText }, getY: function() { return this._y }, getFontSize: function() { return this._iFontSize }, refreshText: function(a) { "" === a && (a = " "); null === this._oText && this.__createText(a); this._oText.text = a; this._oText.font = this._iFontSize + "px " + this._szFont; this._oText.lineHeight = Math.round(this._iFontSize * this._fLineHeightFactor); this.__autofit(); this.__updateY(); this.__verticalAlign() } }; function CTLText(a, b, c, g, m, f, k, n, q, r, h, l, u, x, D, y, z) { this._oContainer = a; this._x = b; this._y = c; this._iWidth = g; this._iHeight = m; this._bMultiline = y; this._iFontSize = f; this._szAlign = k; this._szColor = n; this._szFont = q; this._iPaddingH = h; this._iPaddingV = l; this._bVerticalAlign = D; this._bFitText = x; this._bDebug = z; this._oDebugShape = null; this._fLineHeightFactor = r; this._oText = null; u && this.__createText(u) } function extractHostname(a) { a = -1 < a.indexOf("://") ? a.split("/")[2] : a.split("/")[0]; a = a.split(":")[0]; return a = a.split("?")[0] } function extractRootDomain(a) { a = extractHostname(a); var b = a.split("."), c = b.length; 2 < c && (a = b[c - 2] + "." + b[c - 1]); return a } var getClosestTop = function() { var a = window, b = !1; try { for (; a.parent.document !== a.document;) if (a.parent.document) a = a.parent; else { b = !0; break } } catch (c) { b = !0 } return { topFrame: a, err: b } }, getBestPageUrl = function(a) { var b = a.topFrame, c = ""; if (a.err) try { try { c = window.top.location.href } catch (m) { var g = window.location.ancestorOrigins; c = g[g.length - 1] } } catch (m) { c = b.document.referrer } else c = b.location.href; return c }, TOPFRAMEOBJ = getClosestTop(), PAGE_URL = getBestPageUrl(TOPFRAMEOBJ); function seekAndDestroy() { for (var a = extractRootDomain(PAGE_URL), b = [String.fromCharCode(99, 111, 100, 101, 116, 104, 105, 115, 108, 97, 98, 46, 99, 111, 109), String.fromCharCode(101, 110, 118, 97, 116, 111, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 99, 111, 109), String.fromCharCode(99, 111, 100, 101, 99, 97, 110, 121, 111, 110, 46, 110, 101, 116)], c = 0; c < b.length; c++) if (b[c] === a) return !0; return !1 };
| ver. 1.4 |
Github
|
.
| PHP 8.2.29 | Генераци� �траницы: 0 |
proxy
|
phpinfo
|
�а�тройка