From c9d1d5f056492ed451133e8c2f30d2f7ec9b9f19 Mon Sep 17 00:00:00 2001 From: yityu Date: Mon, 9 Dec 2024 18:08:19 +0800 Subject: [PATCH] fix moloco --- README.md | 16 +++++++------- networks/moloco.js | 17 ++++++++++++++- pnpm-lock.yaml | 53 ++++++++++++++++++++++++++-------------------- 3 files changed, 54 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index d379f11..aa3a5b3 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,6 @@ SoyooFacade.InstallGame() ``` -## moloco -把`networks/moloco.js`复制到web-mobile目录下。 -在w`web-mobile/index.html`的""的上一行添加代码 -``` - -``` - ## google 把`networks/google.js`复制到web-mobile目录下。 在w`web-mobile/index.html`的""的上一行添加代码 @@ -60,9 +53,16 @@ SoyooFacade.InstallGame() ### applovin 1. 把networks/mintegral.js 复制到web-mobile下 -3. 编辑index.html,在body最后加上 +2. 编辑index.html,在body最后加上 `` +### moloco +1. 把`networks/moloco.js`复制到web-mobile目录下。 +2. 编辑index.html,在body最后加上 +``` + +``` + ## 打包 执行命令 `node single-html/build.js` 生成目标文件 `dist/index.html`即为目标文件 \ No newline at end of file diff --git a/networks/moloco.js b/networks/moloco.js index 764a17c..334ac2f 100644 --- a/networks/moloco.js +++ b/networks/moloco.js @@ -18,4 +18,19 @@ window.$soyooFacadeImpl = { FbPlayableAd && FbPlayableAd.onCTAClick(); console.log("[SoyooFacadeImpl] onGameInstall") } -} \ No newline at end of file +} + +!(function() { + let n = !1; + (window.gameStart = function() { + n + ? window.resumeGame() + : ((n = !0), window.startGame()); + }), + (window.gameClose = function() { + window.pauseGame(); + }), + window.addEventListener("DOMContentLoaded", () => { + window.startGame() + }) + })(); \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 686d3bf..2de5816 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,41 +1,48 @@ -lockfileVersion: '9.0' +lockfileVersion: '6.1' settings: autoInstallPeers: true excludeLinksFromLockfile: false -importers: +dependencies: + brotli: + specifier: ^1.3.3 + version: 1.3.3 - .: - devDependencies: - clean-css: - specifier: ^5.3.3 - version: 5.3.3 - uglify-js: - specifier: ^3.19.3 - version: 3.19.3 +devDependencies: + clean-css: + specifier: ^5.3.3 + version: 5.3.3 + uglify-js: + specifier: ^3.19.3 + version: 3.19.3 packages: - clean-css@5.3.3: + /base64-js@1.5.1: + resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + dev: false + + /brotli@1.3.3: + resolution: {integrity: sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==} + dependencies: + base64-js: 1.5.1 + dev: false + + /clean-css@5.3.3: resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==} engines: {node: '>= 10.0'} + dependencies: + source-map: 0.6.1 + dev: true - source-map@0.6.1: + /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} + dev: true - uglify-js@3.19.3: + /uglify-js@3.19.3: resolution: {integrity: sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==} engines: {node: '>=0.8.0'} hasBin: true - -snapshots: - - clean-css@5.3.3: - dependencies: - source-map: 0.6.1 - - source-map@0.6.1: {} - - uglify-js@3.19.3: {} + dev: true