效果图
各位嘉宾大家好
今天给大家带来的是《HTML5手机端开心消消乐源码》
可以没事的时候可以自己搭建玩,当一把游戏GM
代码过长需要文档版源码来我的前端群581549454,已上传到群文件
废话不多说上源码
SpilGamesBrand = function() {
var d = window.document;
documentElement = d.documentElement || {};
element = d.createElement_x("div");
container = d.getElementById("spilgames-root");
emptyFn = function() {};
globalSettings = {};
api = {};
updateBodyCheck = function(d) {
var a, b = d,
c = !1;
return function(d, f) {
b = d || b;
c = f || c;
clearTimeout(a);
c && (a = setTimeout(function() {
updateBodyCheck = function(a) {
b = a || b;
b()
};
b()
}, 100))
}
}(emptyFn);
updateSize = function() {
var h = d.body || d.getElementsByTagName_r("body")[0];
updateSize = function(a) {
a = h.getElementsByTagName_r("*");
for (var b = a.length, c = 0, k = element.style.zIndex, f = 0; f
< b; f++) c++, a[f] !== element && a[f].style.zIndex
> c && (c = a[f].style.zIndex), c > k && (k =
c, updateBodyCheck());
element.style.zIndex = k;
element.style.width = (windows.innerWidth ||
documentElement.clientWidth ||
d.getElementsByTagName_r("body")[0].clientWidth) + "px";
element.style.height = (windows.innerHeight ||
documentElement.clientHeight ||
d.getElementsByTagName_r("body")[0].clientHeight) + "px";
waitId = setTimeout(updateSize, updateSpeed)
};
updateSize()
};
und = function(d) {
return void 0 === d
};
fadeOut = function(d) {
var a = d.style,
b = function() {
_SPTimer.end("splashscreen");
clearTimeout(waitId);
globalSettings.container.removeChild(d)
};
return und(a.webkitTransition) && und(a.MozTransition)
&& und(a.transition) ? (a.opacity = 1, function() {
console.info("opacity")
}) : function() {
a.opacity = 0;
a.webkitTransition = a.MozTransition = a.transition = "opacity
500ms ease 0ms";
d.addEventListener("webkitTransitionEnd", b);
d.addEventListener("mozTransitionEnd", b);
d.addEventListener("transitionend", b)
}
}(element);
waitId = null;
updateSpeed = 100;
endTriggered = !1;
element.id = "splashscreen";
api.show = function(d) {
d = d || {};
globalSettings = {
time: d.time || 2500,
onEnd: d.onEnd || emptyFn,
onStart: d.onStart || emptyFn,
container: d.container || container,
css: d.css || ""
};
0 > globalSettings.time && (globalSettings.time =
0);
setTimeout(function() {
updateSpeed = 300
}, 3E4);
updateSize();
globalSettings.container.appendChild(element);
element.style.cssText = globalSettings.css;
_SPTimer.start("splashscreen");
globalSettings.onStart()
};
api.end = function() {
var d = !1,
a;
end = function() {
a = d ? 0 : globalSettings.time;
updateBodyCheck(emptyFn);
0 > a ? fadeOut() : setTimeout(fadeOut, a)
};
return function(b) {
endTriggered || (d = b || !1, endTriggered = !0, b ? end() :
updateBodyCheck(end, !0))
}
}();
return api
}(window);
SpilGamesBrand.show({
css: "top: 0px; left: 0px; z-index: 9999; position: absolute;
background: #d0e8fd url('logo.png') no-repeat center;
-webkit-background-size: 320px 320px !important;"
});
window.FZ = {};
(function() {
window.Gamehub && (window.SpilGames = {
_: function(d) {
var h = arguments,
a = 0;
return d.replace(/%s/g, function(b) {
a++;
return void 0 !== h[a] ? h[a] : b
})
},
Highscores: {
insert: function(d) {
Gamehub.Score.submit(d.score)
},
showScoreboard: function(d) {
Gamehub.ShowScoreboard();
d && setTimeout(d, 100)
}
},
Settings: {
get: function(d) {
switch (d) {
case "currentGameInfo":
return {
splashScreen: Gamehub.Settings.splashScreen,
rotationLockSreen: {
portrait: Gamehub.Settings.rotationLockScreen.portrait,
landscape: Gamehub.Settings.rotationLockScreen.landscape
}
};
default:
return {}
}
}
}
});
FZ.SpilAPI = {
SubmitScore: function(d) {
FZ.SpilAPI.checkSpilAPI();
SpilGames.Highscores.insert({
score: d
})
},
ShowHighscore: function() {
FZ.SpilAPI.checkSpilAPI();
!FZ.SpilAPI.___noSpilGamesAPI && FZ.GameBase &&
FZ.GameBase.pauseGame();
SpilGames.Highscores.showScoreboard(function() {
FZ.GameBase && FZ.GameBase.resumeGame()
})
},
GetSplashScreenURL: function() {
FZ.SpilAPI.checkSpilAPI();
return FZ.SpilAPI.___noSpilGamesAPI ? "" :
SpilGames.Settings.get("currentGameInfo").splashScreen
},
GetPortraitLockURL: function() {
FZ.SpilAPI.checkSpilAPI();
return FZ.SpilAPI.___noSpilGamesAPI ? "" :
SpilGames.Settings.get("currentGameInfo").rotationLockSreen.portrait
},
GetLandscapeLockURL: function() {
FZ.SpilAPI.checkSpilAPI();
return FZ.SpilAPI.___noSpilGamesAPI ? "" :
SpilGames.Settings.get("currentGameInfo").rotationLockSreen.landscape
},
checkSpilAPI: function() {
return !FZ.SpilAPI.___noSpilGamesAPI
},
init: function() {
FZ.SpilAPI.___noSpilGamesAPI = !window.SpilGames;
window.SpilGames || (window.SpilGames = {
_: function(d) {
var h = arguments,
a = 0;
return d.replace(/%s/g, function(b) {
a++;
return void 0 !== h[a] ? h[a] : b
})
},
Highscores: {
insert: function(d) {
FZ.__localSubmitHighscore &&
FZ.__localSubmitHighscore(d.score)
},
showScoreboard: function(d) {
FZ.__localShowHighscore ? FZ.__localShowHighscore(d) :
setTimeout(d, 0)
}
}
})
}
};
FZ.SpilAPI.init()
})();
(function(d, h) {
d.SpilGames || (d.SpilGames = {
_: function(g) {
var b = 1,
a = arguments;
return g.replace(/%s/g, function() {
return a[b++]
})
}
});
var a = d.JSON,
b = d.document,
c = d.navigator.userAgent,
k = d.navigator.language ? d.navigator.language :
d.navigator.userLanguage;
namespace = d.location.href.replace(/\/[^\/]*$/i, "");
var f = /\?/ig,
e = /([^a-z0-9]|^)-([^0-9])/ig,
l = /^([\W\w]*)\.([^:.]*)(:[\W\w]*)$/i,
m = "$1" + (/Webkit/i.test(c) ? "-webkit-" : /Gecko/i.test(c) ?
"-moz-" : "") + "$2",
n = {
computer: !/(iPhone|iPad|iPod|Android)/i.test(c),
mobile: /(iPhone|iPad|iPod|Android)/i.test(c),
iOS: /(iPhone|iPad|iPod)/i.test(c),
iPad: /iPad/i.test(c),
iPhone: /iPhone/i.test(c),
iPod: /iPod/i.test(c),
android: /Android/i.test(c),
version:
parseFloat(/(iPhone|iPad|iPod|Android|Chrome|Safari|Firefox|MSIE)[^0-9]*([0-9._]*)/i.exec(c)[2].replace("_",
"."))
},
p, q, r, s, y, A = {},
t = {},
u = {},
z = {},
O = Array.prototype.slice,
H = function(g) {
for (var b, a, d = arguments.length; 1 < d--;) for (b in a =
arguments[d], a) g[b] = a[b];
return g
},
w = function(g) {
if (g.nodeType) return g;
if (g.__mate__ && g.__mate__.nodeType) return
g.__mate__
},
B = function(g) {
for (; g && !g.__mate__;) g = g.parentNode;
return g ? g.__mate__ : h
},
C = function() {
d.setTimeout(function() {
d.scrollTo(0, n.android ? 1 : 0)
}, 500)
},
I = function() {
var g = w(t.root).getBoundingClientRect();
q = 0 > g.left ? 0 : g.left;
r = 0 > g.top ? 0 : g.top
},
J = function(g) {
var b, a, d, c = u[g];
if (c) for (b in d = O.call(arguments, 1), c)(a = c[b])[g].apply(a,
d)
},
v = function(g, b, c) {
var e, f = 0,
k = z;
g = g.split(".");
for (e = g.length - 1; f < e; f++) k = "object" === typeof
k[g[f]] ? k[g[f]] : k[g[f]] = {};
if (b === h) return k[g[f]];
k[g[f]] = b;
!0 === c && d.localStorage.setItem(namespace,
a.stringify(z))
},
L = function(g) {
var b = 0,
a = arguments;
return g.replace(f, function() {
return a[++b]
})
},
x = function(g, b) {
if ((g = w(g)) !== h) if (-1 !== b.indexOf(":")) g.style.cssText +=
b.replace(e, m);
else return g.style[b]
},
E = function(g) {
g = w(g).getBoundingClientRect();
return {
top: g.top - r,
left: g.left - q,
right: g.right - q,
bottom: g.bottom - r,
width: g.width,
height: g.height
}
},
M = function(g) {
var a, d, c, e, f = p.store.local && p.store.local[g];
if (f !== h && arguments.callee.lang !== g) for (p.language
= arguments.callee.lang = g, a = b.querySelectorAll("*[local]"), d
= a.length; d--;) e = a[d].__mate__, c =
a[d].getAttribute("local"), e !== h && (e.lang ?
e.lang(f[c]) : e.text(f[c]))
},
N = function(g, b) {
var a;
a = A[g] = function() {};
H(a.prototype, b, F.__make__);
a.prototype.className = g
},
F = function(g, a, d, c, e) {
var f;
g = w(g);
if (g !== h && g.__mate__) return f = g.__mate__.path + "."
+ a, d = t[f] = new A[d], d.name = a, d.path = f, d.__mate__ =
g.appendChild(b.createElement_x(e || "DIV")),
d.__mate__.appendChild(b.createElement_x("DIV")), d.__mate__.__mate__
= d, x(d, "position: absolute; " + (c || "")), d
},
如果觉得《html5做开心消消乐源代码 HTML5手机端开心消消乐源码》对你有帮助,请点赞、收藏,并留下你的观点哦!