Taimanin Screen

対魔忍のゲーム画面以外を疎放的に非表示にするスクリプト。

当前为 2025-01-06 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name        Taimanin Screen
// @description 対魔忍のゲーム画面以外を疎放的に非表示にするスクリプト。
// @author 	Ginoa AI
// @namespace 	https://greasyfork.org/ja/users/119008-ginoaai
// @version     3.0
// @match       https://pc-play.games.dmm.com/play/taimanin_rpg/
// @match       https://pc-play.games.dmm.co.jp/play/taimanin_rpgx/
// @icon        https://pbs.twimg.com/profile_images/1648150443522940932/4TTHKbGo_400x400.png
// ==/UserScript==
var css = function(){/*
  html {
    overflow: hidden;
  }
  #game_frame {
    position: fixed;
    width: 1280px !important;
    height: 755px !important;
    left: 0px;
    top: 0px;
    z-index: 2147483646 !important;
  }
  #alert {
    overflow: scroll;
    width: 98% !important;
    height: 100vh !important;
    padding: 1% !important;
    left: 0px !important;
    top: 0px !important;
    z-index: 2147483647 !important;
  }
*/}.toString().match(/\n([\s\S]*)\n/)[1];
var style = document.createElement("style");
style.innerHTML = css;
document.head.appendChild(style);

document.querySelector('link[rel="icon"]').href = "https://www.lilith-soft.com/images/favicon.ico";

var canvas = "<div style=\"background-color: #FFFFFF; z-index: 2147483645; width: 100%; height: 100vh; left: 0%; top: 0%;\"></div>";
document.documentElement.insertAdjacentHTML("afterbegin", canvas);

var game = document.querySelector('iframe[id="game_frame"]');
// document.documentElement.appendChild(game);
var MarginTop = -35;
var GameWidth = 1280;
var GameHeight = 720;
game.style.cssText += "margin-top: " + MarginTop + "px !important;";

var resize = function(){
  var Scale = Math.min.apply(null, [
    window.innerWidth / GameWidth,
    window.innerHeight / GameHeight,
  ]);
  game.style.transform="scale("+Scale+")";

  var ChangeLeft = (GameWidth - (GameWidth * Scale)) / 2;
  var ChangeMarginTop = (game.getBoundingClientRect().top - parseInt(game.style.marginTop) - (MarginTop * Scale)) * -1;
  game.style.left = -ChangeLeft + "px";
  game.style.cssText += "margin-top: " + ChangeMarginTop + "px !important;";
};

window.onresize=function(){
  resize();
};
resize();