补充座驾动画标题用户信息
This commit is contained in:
@@ -394,8 +394,9 @@ const FujianEffect = (() => {
|
||||
* @param {number} h 画布高度
|
||||
* @param {number} progress 播放进度
|
||||
* @param {string} title 入场标题
|
||||
* @param {string} userInfo 用户身份信息
|
||||
*/
|
||||
function drawHud(ctx, w, h, progress, title) {
|
||||
function drawHud(ctx, w, h, progress, title, userInfo) {
|
||||
const enter = Math.min(1, Math.max(0, (progress - 0.12) / 0.2));
|
||||
const leave = Math.min(1, Math.max(0, (1 - progress) / 0.14));
|
||||
const alpha = easeInOutCubic(enter) * leave;
|
||||
@@ -407,17 +408,20 @@ const FujianEffect = (() => {
|
||||
ctx.fillStyle = "rgba(15,23,42,0.68)";
|
||||
ctx.strokeStyle = "rgba(103,232,249,0.72)";
|
||||
ctx.lineWidth = 2;
|
||||
roundRect(ctx, w * 0.5 - 320, y - 46, 640, 96, 18);
|
||||
roundRect(ctx, w * 0.5 - 340, y - 56, 680, 120, 18);
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.shadowColor = "rgba(103,232,249,0.95)";
|
||||
ctx.shadowBlur = 20;
|
||||
ctx.fillStyle = "#cffafe";
|
||||
ctx.font = "700 16px serif";
|
||||
ctx.fillText("FUJIAN AIRCRAFT CARRIER PREVIEW", w * 0.5, y - 12);
|
||||
ctx.fillText("FUJIAN AIRCRAFT CARRIER PREVIEW", w * 0.5, y - 24);
|
||||
ctx.fillStyle = "#a5f3fc";
|
||||
ctx.font = "700 18px serif";
|
||||
ctx.fillText(userInfo, w * 0.5, y + 8, 620);
|
||||
ctx.fillStyle = "#ffffff";
|
||||
ctx.font = "900 38px serif";
|
||||
ctx.fillText(title, w * 0.5, y + 28, 590);
|
||||
ctx.font = "900 34px serif";
|
||||
ctx.fillText(title, w * 0.5, y + 45, 620);
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
@@ -459,6 +463,7 @@ const FujianEffect = (() => {
|
||||
const h = canvas.height;
|
||||
const waves = createWaves(w, h);
|
||||
const title = String(options.effect_title || "福建舰 航母入场").trim() || "福建舰 航母入场";
|
||||
const userInfo = String(options.effect_user_info || "").trim();
|
||||
const startTime = performance.now();
|
||||
let animId = null;
|
||||
let finished = false;
|
||||
@@ -500,7 +505,7 @@ const FujianEffect = (() => {
|
||||
drawBackdrop(ctx, w, h, progress);
|
||||
drawWaves(ctx, waves, w, progress, carrierX, carrierY, scale);
|
||||
drawCarrier(ctx, carrierX, carrierY, scale, progress);
|
||||
drawHud(ctx, w, h, progress, title);
|
||||
drawHud(ctx, w, h, progress, title, userInfo);
|
||||
|
||||
if (progress < 1) {
|
||||
animId = requestAnimationFrame(animate);
|
||||
|
||||
Reference in New Issue
Block a user