优化手机竖屏op
This commit is contained in:
parent
cd6d511175
commit
30b1731ebc
@ -1 +1 @@
|
|||||||
{"viewportLoc":[0,0],"editorLastFloorId":"street01"}
|
{"viewportLoc":[0,0],"editorLastFloorId":"jiaotang"}
|
@ -2601,17 +2601,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
if (main.dom.video1) {
|
if (main.dom.video1) {
|
||||||
main.dom.video1.style.width = obj.totalWidth + 3 + "px";
|
main.dom.video1.style.width = obj.totalWidth + 3 + "px";
|
||||||
main.dom.video1.style.height = obj.totalHeight + 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";
|
const innerSize = obj.canvasWidth * core.domStyle.scale + "px";
|
||||||
for (let i = 0; i < core.dom.gameCanvas.length; ++i)
|
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.left = "50%";
|
||||||
video.style.transform = "translate(-50%,-50%)";
|
video.style.transform = "translate(-50%,-50%)";
|
||||||
main.dom.video = video;
|
main.dom.video = video;
|
||||||
const video1 = document.createElement('canvas'); //iframe设置
|
const video1 = document.createElement("canvas"); //video1画布设置
|
||||||
video1.style.position = "absolute";
|
video1.style.position = "absolute";
|
||||||
video1.style.zIndex = 330;
|
video1.style.zIndex = 330;
|
||||||
video1.style.display = "block";
|
video1.style.display = "block";
|
||||||
@ -14077,21 +14066,19 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
video1.style.top = "50%";
|
video1.style.top = "50%";
|
||||||
video1.style.left = "50%";
|
video1.style.left = "50%";
|
||||||
video1.style.transform = "translate(-50%,-50%)";
|
video1.style.transform = "translate(-50%,-50%)";
|
||||||
|
const ctx = video1.getContext("2d");
|
||||||
main.dom.video1 = video1;
|
main.dom.video1 = video1;
|
||||||
if (core.domStyle.isVertical) {
|
if (core.domStyle.isVertical) {
|
||||||
video.width = 416 * 3;
|
video.width = 416 * 3;
|
||||||
video.height = 676 * 3;
|
video.height = 676 * 3;
|
||||||
video.style.transform = "translate(-50%,-50%) rotate(90deg)"; //重新定位右上角为基准
|
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 {
|
} else {
|
||||||
video.width = 676 * 3;
|
video.width = 676 * 3;
|
||||||
video.height = 416 * 3;
|
video.height = 416 * 3;
|
||||||
video.style.transform = "translate(-50%,-50%)";
|
video.style.transform = "translate(-50%,-50%)";
|
||||||
video1.width = 676 * 3;
|
|
||||||
video1.height = 416 * 3;
|
|
||||||
video1.style.transform = "translate(-50%,-50%)";
|
|
||||||
}
|
}
|
||||||
video1.ontouchstart = function (e) {
|
video1.ontouchstart = function (e) {
|
||||||
try {
|
try {
|
||||||
@ -14139,24 +14126,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
};
|
};
|
||||||
let globalAlpha = 0
|
let globalAlpha = 0
|
||||||
let frame = 1
|
let frame = 1
|
||||||
core.registerAnimationFrame('op', true, function () {
|
let al = 0
|
||||||
const ctx = video1.getContext('2d')
|
core.registerAnimationFrame('beforeop', true, function () {
|
||||||
core.clearMap(ctx)
|
al++
|
||||||
ctx.globalAlpha = 1
|
ctx.globalAlpha = al / 30
|
||||||
core.fillRect(ctx, 0, 0, video1.width, video.height, "#000000")
|
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
|
|
||||||
if (frame === -1 && globalAlpha < 0) {
|
|
||||||
core.clearMap(ctx)
|
|
||||||
core.unregisterAnimationFrame('op')
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
core.control.resize();
|
core.control.resize();
|
||||||
//player.bilibili.com/player.html
|
//player.bilibili.com/player.html
|
||||||
//www.bilibili.com/blackboard/html5mobileplayer.html
|
//www.bilibili.com/blackboard/html5mobileplayer.html
|
||||||
@ -14173,6 +14148,35 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
//gsl_play_mask
|
//gsl_play_mask
|
||||||
|
|
||||||
video.addEventListener('load', function () {
|
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;
|
bgm = core.musicStatus.playingBgm;
|
||||||
core.playBgm("op.mp3")
|
core.playBgm("op.mp3")
|
||||||
a = setTimeout(() => {
|
a = setTimeout(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user