您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Makes the standard (non full screen) maps most of the width/height of you screen space. Puts the site into dark mode. Makes coordinates on the page into links that re-centre the map to them.
// ==UserScript== // @name Project Zomboid Fans Map Tool // @description Makes the standard (non full screen) maps most of the width/height of you screen space. Puts the site into dark mode. Makes coordinates on the page into links that re-centre the map to them. // @namespace https://monkeyr.com/ // @version 1.2 // @license MIT // @author mh // @match https://pzfans.com/*-online-map/ // @match https://pzfans.com/vanilla-full-map/ // @match https://pzfans.com/project-zomboid-maps/* // @icon https://www.google.com/s2/favicons?sz=64&domain=pzfans.com // @grant GM_addStyle // @require https://code.jquery.com/jquery-latest.min.js // ==/UserScript== (function($) { 'use strict'; // add the dark theme then make the map bigger GM_addStyle(` html, #contentDiv{ filter: invert(100%) hue-rotate(180deg); } .grid-container {max-width: inherit} .site-content .content-area {width:100%!important} #right-sidebar {display: none} #contentDiv {height:90vh!important} `); // loop each paragraph and heading looking for coords, when found make them a link with data of the coords $.each(['p','h2','h3'], (i,v)=>{ $(v).each(function(){ const p = $(this); p.html(p.html().replace(/(\d+),\s*(\d+)/ig, (f,x,y)=>{ return `<a href="#" data-x="${x}" data-y="${y}" class="coord">${f}</a>`; })); }); }); // find those links with data and make them re-center the map on the coords provided $('a.coord').on('click', function(e){ e.preventDefault(); const a = $(this); $('#x').val(a.data('x')); $('#y').val(a.data('y')); panto(); $("#layerSelector")[0].scrollIntoView({ behavior: "instant", // or "auto" or "smooth" block: "start" // or "end" }); }); })(jQuery);