WoD Enhancement

Refine WoD Page!

目前為 2023-12-01 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         WoD Enhancement
// @namespace https://greasyfork.org/users/164689
// @version      0.6
// @description  Refine WoD Page!
// @author       iClaud
// @license      MIT
// @match        *://*.world-of-dungeons.org/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant		 GM_addStyle
// @require      https://apps.bdimg.com/libs/jquery/3.1.4/jquery.min.js
// ==/UserScript==
function combSel(ind,str){
	let ret = '#smarttabs__details_inner>table:nth-child('+ind+')>tbody>tr:nth-child(1)>td:nth-child('+str+')';
	return ret;
};

(function() {
    'use strict';
    /* Define Item */
    let rightPanel = "#gadgettable-right ";
    let rightPanelGadgets = "#gadgettable-right-gadgets ";

    let user=$('.hero_short tr:nth-child(1) td:nth-child(1) a:nth-child(3)').text();
    // Your code here...
    console.log("Hello WoD");
    // Style
    // Tutorial
    GM_addStyle("div.tutorial {max-width:100%!important; min-height:100px!important;font-size:12px; font-style:normal!important;border:1px dotted grey;background-color:#e7d5c72e;color:#666;}");
    GM_addStyle("img.tutorial {display:none!important;}");

    // Gadget
    // Right
    GM_addStyle(rightPanel+"{min-width:200px;text-align:left;line-height:1.2em;padding-left:10px;padding-right:10px;}");
    GM_addStyle(rightPanelGadgets+"{margin-top:50px;font-size:11px;}");
    GM_addStyle(rightPanelGadgets+".gadget {margin-top:0px;}");
    GM_addStyle(rightPanelGadgets+".gadget {margin-top:0px;}");
    GM_addStyle(".button {font-weight:lighter;border-color:grey;border-style:dotted;background:rgba(200,200,100,0.3);}");
    GM_addStyle("#gadgetNextdungeonTime{background:yellow;}");

    //Top
    GM_addStyle(".gadget_icon:hover {opacity:0.9;}");
    GM_addStyle("#gadgettable-center-gadgets table:nth-child(1) img:hover {}");
    GM_addStyle("#gadgettable-center-gadgets table:nth-child(2) img:hover {}");
    GM_addStyle(".world_list {text-align:center; background:lightgrey;color:black;border:1px dotted grey;padding-left:10px;padding-right:10px;font-weight:lighter;font-style:italic;}");
    GM_addStyle(".gadget.clock{background:#f3f1b8;}");
    GM_addStyle(".progressBar_container{border:0px solid grey;opacity:0.9;font-size:12px;}");
    GM_addStyle("TR.boardcon2 {background-color:white; font-size:12px;}");
    GM_addStyle("div.gadget.footer {font-size:10px;color:grey;};");

    GM_addStyle("span {font-size:12px;}");
    GM_addStyle("TR.boardhead {background-color:lightgrey;}");
    GM_addStyle("TR.boardcon1{background-color:#eee;}");
    GM_addStyle("td .quotebody{color:white;}");

    GM_addStyle('.layout_dungeon_description{width:90%;}');


    GM_addStyle('div.happyhour.soon {background:lightgrey; color:#555;font-size:11px;}; \
.paginator_selected { font-size:11px;color:#eee;}; \
table.content_table > * > tr.header { background-color:#e0e0e0; } \
table.content_table.mail {width:100%; font-size:11px;} \
table.content_table.mail a {font-size:11px; color: black;} \
table.content_table.mail tr.row0 {background-color: lightgrey;} \
.subject_standard{background-color: rgba(0,0,0,0);} \
#smarttabs__details_inner>table:nth-child(1) {margin-bottom:220px; margin-top:20px;}; \
#smarttabs__details_inner>table:nth-child(2) {position:absolute;top:20px;right:0px;width:300px;}; \
#smarttabs__details_inner .boardavatar:nth-child(1) {margin-top:-10px;}; \
');

    //Some css can't be applied in advanced

    $('.paginator_selected').css('font-size','11px').css('color','#eee');
    $('table.content_table > * > tr.header').css('background-color','#e0e0e0');
    if($('#smarttabs__details_inner>.content_table').length==0){ //yourself

		let avttdind = 1;
		if($('img.boardavatar').length==0){
			avttdind = -1;
		}

		let badgetdind = avttdind +2 ;

		if($('.content h3:contains("勋章")').length==0){
			badgetdind = avttdind + 1;
		}

		let statustdind = badgetdind +2;

		let usertdind = statustdind +2;

        $('#smarttabs__details_inner>table:nth-child(1)').css('position','absolute').css('top','10px').css('left','0px').css('z-index','300');
        //Avator
		// Empty
        //Badges in avator
        $(combSel(1,badgetdind)+' ol').css('font-size','11px').css('position','absolute').css('top','30px').css('left','150px').css('width','100px');
        // Active Status
        $(combSel(1,statustdind)).css('width','300px').css('position','absolute').css('top','2px').css('left','280px');
        // Heros Status
        $(combSel(1,usertdind)).css('width','300px').css('position','absolute').css('top','100px').css('left','280px');

        $('#smarttabs__details_inner>table:nth-child(2)').css('z-index','200');
        $('#smarttabs__details_inner>table:nth-child(2)').css('position','absolute').css('top','30px').css('left','0px').css('width','300px');
        $('#smarttabs__details_inner>table:nth-child(2) table.content_table tr:nth-child(1)').css('background','rgba(0,0,0,0)').css('height','210px').css('vertical-align','bottom');
        $('#smarttabs__details_inner>table:nth-child(2) h3').css('display','none');
        $('#smarttabs__details_inner hr:nth-child(3)').css('margin-top','560px');
    } else {

		let avttdind = 1;
		if($('img.boardavatar').length==0){
			avttdind = -1;
		}
		let badgetdind = avttdind +2 ;
		if($('.content h3:contains("勋章")').length==0){
			badgetdind = avttdind;
		}

		let statustdind = badgetdind +2;
		let usertdind = statustdind +2;

        $('#smarttabs__details_inner>table:nth-child(2)').css('position','absolute').css('top','80px').css('left','0px').css('z-index','300');

		//Avator
		// Empty
        //Badges in avator
		if($('.content h3:contains("勋章")').length>0){
  	      $(combSel(2,badgetdind) + '').css('font-size','11px').css('position','absolute').css('top','0px').css('left','170px').css('width','100px');
		};

        // Active Status
        $(combSel(2,statustdind)).css('width','300px').css('position','absolute').css('top','3px').css('left','280px');
		console.log(combSel(2,statustdind));
        // Heros Status
        $(combSel(2,usertdind)).css('width','300px').css('position','absolute').css('top','103px').css('left','280px');



        $('#smarttabs__details_inner>table:nth-child(3)').css('z-index','200');
        $('#smarttabs__details_inner>table:nth-child(3)').css('position','absolute').css('top','80px').css('left','0px').css('width','300px');
        $('#smarttabs__details_inner>table:nth-child(3) table.content_table tr:nth-child(1)').css('background','rgba(0,0,0,0)').css('height','210px').css('vertical-align','bottom');
        $('#smarttabs__details_inner>table:nth-child(3) h3').css('display','none');
        $('#smarttabs__details_inner>table:nth-child(1)').css('margin-bottom','560px');
        $('#smarttabs__details_inner p:nth-child(-n+60)').css('display','none');
        $('#smarttabs__details_inner p:nth-child(-n+65)').css('width','40%').css('position','absolute').css('top','340px').css('left','300px');
    }

    $('.boardtext span').css('color','black');


    //Ticker
    GM_addStyle("#gadgettable-center-gadgets .ticker {text-align:center; background:#d9a7a730;font-family:Kaiti!important;font-style:normal;}");
    GM_addStyle("#gadgettable-center-gadgets .ticker_msg {font-weight:normal!important;}");
    GM_addStyle(".ticker_label{font-style:normal!important;}");
    GM_addStyle("#gadgettable-center-gadgets .ticker:hover {opacity:0.9;}");
    GM_addStyle(".hints.content{opacity:0.9;font-size:11px;}");


    //Body

    GM_addStyle(".search_container{width:100%;}");
    GM_addStyle(".search_short.texttoken{width:100%;text-align:right;}");
    GM_addStyle("table.content_table{width:100%;font-size:xx-small;}");
    GM_addStyle("table.content_table > * > tr > th, table.content_table > * > tr > td{border:0px solid white;}");
    GM_addStyle("table.content_table > * > tr.row0{background:#eee;}");
    GM_addStyle("table.content_table > * > tr.row1{background:#fff;}");
    GM_addStyle("table.content_table .header .clickable{font-size:10px; border-left-width:0px!important;border-right-width:0px!important;border-top-width:0px!important;border-bottom-width:0px!important;}");
    GM_addStyle("input{border:1px solid grey!important;}");
    GM_addStyle(".gadget_body p{border-bottom:1px dotted lightgrey!important; font-size:12px;padding:10px;}");
    GM_addStyle(".gadget_body p{background:#8fb8e300;};");


    GM_addStyle("body {font-family:'Microsoft Yahei'!important;}");

    //Report
	let url=window.location.href;
	if(url.indexOf("report.php") >= 0){
		$('.content_table table').css('width','100%');
		$('.rep_status_table tr:contains("'+user+'")').css('background','#b8c35070');
		$('.rep_status_table~hr~table:not(.rep_status_table) tr:contains("'+user+'")').css('color','blue').css('background','#b8c35070').css('font-size','1.4em');
		$('.rewards:contains("'+user+'")').css('background','#34b54b33');
		$('p.rep_level_success,p.rep_level_description,div.rep_dungeon_description').css('max-width','100%');
		$('p.rep_level_success,p.rep_level_description,div.rep_dungeon_description').css('font-size','14px').css('line-height','1.8em').css('color','lightblue').css('background','#333');
		$('p.rep_level_success,p.rep_level_description,div.rep_dungeon_description').css('padding-top','40px').css('padding-bottom','40px');
	};


})();