From 30b1731ebcd8a1e20932f5b3b2ecb295553c1028 Mon Sep 17 00:00:00 2001 From: strawberry42271 <2806566736@qq.com> Date: Mon, 30 Dec 2024 21:22:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=89=8B=E6=9C=BA=E7=AB=96?= =?UTF-8?q?=E5=B1=8Fop?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _server/config.json | 2 +- project/plugins.js | 74 ++++++++++++++++++++++++--------------------- 2 files changed, 40 insertions(+), 36 deletions(-) diff --git a/_server/config.json b/_server/config.json index 5d318ea..8da1314 100644 --- a/_server/config.json +++ b/_server/config.json @@ -1 +1 @@ -{"viewportLoc":[0,0],"editorLastFloorId":"street01"} \ No newline at end of file +{"viewportLoc":[0,0],"editorLastFloorId":"jiaotang"} \ No newline at end of file diff --git a/project/plugins.js b/project/plugins.js index d652061..6619619 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -2601,17 +2601,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (main.dom.video1) { main.dom.video1.style.width = obj.totalWidth + 3 + "px"; main.dom.video1.style.height = obj.totalHeight + 3 + "px"; - if (core.domStyle.isVertical) - main.dom.video1.style.width = obj.totalHeight + 3 + "px"; - if (core.domStyle.isVertical) - main.dom.video1.style.height = obj.totalWidth + 3 + "px"; - main.dom.video1.style.top = "50%"; - main.dom.video1.style.left = "50%"; - - main.dom.video1.style.transform = "translate(-50%,-50%)"; - - if (core.domStyle.isVertical) - main.dom.video1.style.transform = "translate(-50%,-50%) rotate(90deg)"; } const innerSize = obj.canvasWidth * core.domStyle.scale + "px"; for (let i = 0; i < core.dom.gameCanvas.length; ++i) @@ -14068,7 +14057,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = video.style.left = "50%"; video.style.transform = "translate(-50%,-50%)"; main.dom.video = video; - const video1 = document.createElement('canvas'); //iframe设置 + const video1 = document.createElement("canvas"); //video1画布设置 video1.style.position = "absolute"; video1.style.zIndex = 330; video1.style.display = "block"; @@ -14077,21 +14066,19 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = video1.style.top = "50%"; video1.style.left = "50%"; video1.style.transform = "translate(-50%,-50%)"; + const ctx = video1.getContext("2d"); main.dom.video1 = video1; if (core.domStyle.isVertical) { video.width = 416 * 3; video.height = 676 * 3; video.style.transform = "translate(-50%,-50%) rotate(90deg)"; //重新定位右上角为基准 - video1.width = 416 * 3; - video1.height = 676 * 3; - video1.style.transform = "translate(-50%,-50%) rotate(90deg)"; //重新定位右上角为基准 + + } else { video.width = 676 * 3; video.height = 416 * 3; video.style.transform = "translate(-50%,-50%)"; - video1.width = 676 * 3; - video1.height = 416 * 3; - video1.style.transform = "translate(-50%,-50%)"; + } video1.ontouchstart = function (e) { try { @@ -14139,24 +14126,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = }; let globalAlpha = 0 let frame = 1 - core.registerAnimationFrame('op', true, function () { - const ctx = video1.getContext('2d') - core.clearMap(ctx) - ctx.globalAlpha = 1 - core.fillRect(ctx, 0, 0, video1.width, video.height, "#000000") - - ctx.globalAlpha = globalAlpha / 30 - core.setTextAlign(ctx, "center"); - core.fillBoldText1(ctx, "长按2秒后跳过op", 1014, 624, "#FFFFFF", '#000000', 6, "bold 48px Verdana") - globalAlpha += frame - if (globalAlpha > 29) frame = -1 - if (frame === -1 && globalAlpha < 0) { - core.clearMap(ctx) - core.unregisterAnimationFrame('op') - } - + let al = 0 + core.registerAnimationFrame('beforeop', true, function () { + al++ + ctx.globalAlpha = al / 30 + core.fillRect(ctx, 0, 0, video1.width, video1.height, "#000000") }) - core.control.resize(); //player.bilibili.com/player.html //www.bilibili.com/blackboard/html5mobileplayer.html @@ -14173,6 +14148,35 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = //gsl_play_mask video.addEventListener('load', function () { + core.unregisterAnimationFrame("beforeop") + core.registerAnimationFrame('op', true, function () { + core.clearMap(ctx) + if (core.domStyle.isVertical) { + ctx.canvas.width = 416 * 3; + ctx.canvas.height = 676 * 3; + ctx.save(); //保存设置 + ctx.translate(416 * 3, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + } else { + ctx.canvas.width = 676 * 3; + ctx.canvas.height = 416 * 3; + } + ctx.globalAlpha = 1 + core.fillRect(ctx, 0, 0, video1.width, video1.height, "#000000") + + ctx.globalAlpha = globalAlpha / 30 + core.setTextAlign(ctx, "center"); + core.fillBoldText1(ctx, "长按2秒后跳过op", 1014, 624, "#FFFFFF", '#000000', 6, "bold 48px Verdana") + globalAlpha += frame + if (globalAlpha > 29) frame = -1 + ctx.restore() + if (frame === -1 && globalAlpha < 0) { + core.clearMap(ctx) + core.unregisterAnimationFrame('op') + } + + + }) bgm = core.musicStatus.playingBgm; core.playBgm("op.mp3") a = setTimeout(() => {