您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
艦これのゲーム画面をウィンドウと同じサイズに拡大/縮小するスクリプト
当前为
// ==UserScript== // @name Kancolle Scaler // @namespace http://hisaruki.tumblr.com/ // @version 1.0 // @description 艦これのゲーム画面をウィンドウと同じサイズに拡大/縮小するスクリプト // @author hisaruki // @match http://www.dmm.com/netgame/social/-/gadgets/=/app_id=854854/ // @grant none // ==/UserScript== (function() { 'use strict'; $("*").css("overflow", "hidden"); $("#game_frame").css("position", "fixed"); $("#game_frame").css("left", 0); $("#game_frame").css("top", 0); $("#game_frame").css("z-index", 32768); $("#game_frame").css("transform-origin-x", "left"); $("#game_frame").css("transform-origin-y", "top"); $("#game_frame").css("height", "inherit"); let resize = function(){ let scale = Math.min.apply(null, [ window.innerWidth / $("#game_frame").width(), window.innerHeight / $("#game_frame").height(), ]); //console.log(scale, (window.innerWidth - ($("#game_frame").width() * scale))/2); $("#game_frame").css("transform", "scale("+scale+")"); $("#game_frame").css("left", (window.innerWidth - ($("#game_frame").width() * scale))/2); } setTimeout(function(){ resize(); }, 8000); $(window).resize(function() { resize(); }); })();