优化手机竖屏op

This commit is contained in:
草莓 2024-12-30 21:22:29 +08:00
parent cd6d511175
commit 30b1731ebc
2 changed files with 40 additions and 36 deletions

View File

@ -1 +1 @@
{"viewportLoc":[0,0],"editorLastFloorId":"street01"}
{"viewportLoc":[0,0],"editorLastFloorId":"jiaotang"}

View File

@ -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(() => {