低调阁 - 恐龙快跑
type: channel
link: http://ddg.ink/tag/恐龙快跑
items: 将Chrome离线小恐龙嵌入博客

将Chrome离线小恐龙嵌入博客
type: item
date: 2020-06-13T14:43:00+08:00
description: 前言最近我逛各位大佬的博客时，看到了将chrome的离线游戏嵌入博客，就觉得比较有意思，想抄过来，发现原博客的实现方法和源代码实在粗糙，于是我在github上找到了源码，将其进一步更方便嵌入博客，现在讲讲步骤。试玩正文仅需一个JS文件即可runner.js代码如下!function (A, i) { "object" == typeof exports && "object" == typeof module ? module.exports = i() : "function" == typeof define && define.amd ? define([], i) : "object" == typeof exports ? exports.initRunner = i() : A.initRunner = i() }(this, function () { return function (A) { function i(s) { if (t[s]) return t[s].exports; var e = t[s] = {exports: {}, id: s, loaded: !1}; return A[s].call(e.exports, e, e.exports, i), e.loaded = !0, e.exports } var t = {}; return i.m = A, i.c = t, i.p = "", i(0) }([function (A, i, t) { document.body.insertAdjacentHTML("beforeend", t(3)), t(5); const s = t(6); A.exports = function (A, i) { var t = "string" == typeof A ? document.querySelector(A) : A; return t.classList.add("interstitial-wrapper"), new s(t, i) } }, function (A, i, t) { i = A.exports = t(2)(), i.push([A.id, ".interstitial-wrapper{box-sizing:border-box;margin:0 auto;max-width:600px}.runner-container{width:44px}.runner-canvas,.runner-container{height:150px;max-width:600px;overflow:hidden}.runner-canvas{opacity:1;position:relative;z-index:2}.inverted{transition:-webkit-filter 1.5s cubic-bezier(.65,.05,.36,1),background-color 1.5s cubic-bezier(.65,.05,.36,1);will-change:-webkit-filter,background-color;-webkit-filter:invert(100%);background-color:#000}.controller{background:hsla(0,0%,97%,.1);height:100vh;left:0;position:absolute;top:0;width:100vw;z-index:1}#offline-resources{display:none}", ""]) }, function (A, i) { A.exports = function () { var A = []; return A.toString = function () { for (var A = [], i = 0; i < this.length; i++) { var t = this[i]; t[2] ? A.push("@media " + t[2] + "{" + t[1] + "}") : A.push(t[1]) } return A.join("") }, A.i = function (i, t) { "string" == typeof i && (i = null, i, ""); for (var s = {}, e = 0; e < this.length; e++) { var n = this[e][0]; "number" == typeof n && (s[n] = !0) } for (e = 0; e < i.length; e++) { v…