CSS Define

*NEW* adding JavaScript for CSS here and there in the ♥Hentai Heroes game♥

Verzia zo dňa 14.11.2021. Pozri najnovšiu verziu.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, Greasemonkey alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey, % alebo Violentmonkey.

Na nainštalovanie skriptu si budete musieť nainštalovať rozšírenie, ako napríklad Tampermonkey alebo Userscripts.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie, ako napríklad Tampermonkey.

Na inštaláciu tohto skriptu je potrebné nainštalovať rozšírenie správcu používateľských skriptov.

(Už mám správcu používateľských skriptov, nechajte ma ho nainštalovať!)

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie, ako napríklad Stylus.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

Na inštaláciu tohto štýlu je potrebné nainštalovať rozšírenie správcu používateľských štýlov.

(Už mám správcu používateľských štýlov, nechajte ma ho nainštalovať!)

// ==UserScript==
// @name         CSS Define
// @namespace    Haremheroes
// @version      1.4.0
// @description  *NEW* adding JavaScript for CSS here and there in the ♥Hentai Heroes game♥
// @author       KominoStyle
// @match        http*://nutaku.haremheroes.com/*
// @match        http*://*.hentaiheroes.com/*
// @run-at	     document-end
// @grant        none
// @license      MIT
// ==/UserScript==

/*==========================================================*
CSS-Addon:
Stylus: https://add0n.com/stylus.html
*-----------------------------------------------------------*
£-*-
 +
CSS-Script:
https://userstyles.world/style/960/hentai-heroes-css-define
*==========================================================*/
/* =========
	GENERAL
   ========= */

// Define jQuery
var $ = window.jQuery

// no eslint because window. is not used
/* global membersList */

// Define CSS
var sheet = (function() {
    var style = document.createElement('style');
    document.head.appendChild(style);
    return style.sheet;
})();


var CurrentPage = window.location.pathname;
var page = CurrentPage.split("/").pop(); //console.log(page)
var CurrentSearch = window.location.search;
var pagesearch = page+CurrentSearch;

//localstorage
var Clubmember_deserialized = JSON.parse(localStorage.getItem("CMIDr"));


//Get Club Member-ID
if (page == 'clubs.html') {
const CMemberIDr = membersList.map(({id_member}) => id_member)
//const CMemberID = $('#members tr').map(function () {return $(this).attr('sorting_id')}).toArray(); old Code

let Clubmember_serialized = JSON.stringify(CMemberIDr);

localStorage.setItem("CMIDr", Clubmember_serialized);
}
/*if (page == 'clubs.html') {
const CMemberID = $('#members tr').map(function () {return $(this).attr('sorting_id')}).toArray();

let Clubmember_serialized = JSON.stringify(CMemberID);

localStorage.setItem("CMID", Clubmember_serialized);
}*/

//Leagues ID check
if (page == 'tower-of-fame.html') {
    Clubmember_deserialized.forEach(Member => { //console.log(Member)
        $('tr[sorting_id='+Member+']').addClass('IsMember')
    })
}

//Contest ID check
if (page == 'activities.html') {
    Clubmember_deserialized.forEach(Member => { //console.log(Member)
        $('tr[sorting_id='+Member+']').addClass('IsMember')
    })
}


//Hide button "buy with kobans" for Bookshop & Giftshop
if (page == 'shop.html') {
    //Hide button "buy with kobans" for Bookshop & Giftshop
    if(pagesearch == 'shop.html?type=potion' || pagesearch == 'shop.html?type=gift') {
        $('#shop button[rel=buy]').addClass('DONTbuy')
    }
    //Hide button "sell your Items" for Boostershop & Bookshop & Giftshop
    if(pagesearch == 'shop.html?type=booster' || pagesearch == 'shop.html?type=potion' || pagesearch == 'shop.html?type=gift') {
        $('#inventory button[rel=sell]').addClass('DONTsell')
    }
    document.querySelector("#type_item > div:nth-child(4)").onclick = function() {addDontBuy() + addDontSell()};
    document.querySelector("#type_item > div:nth-child(3)").onclick = function() {addDontBuy() + addDontSell()};
    document.querySelector("#type_item > div:nth-child(2)").onclick = function() {delDontBuy() + addDontSell()};
    document.querySelector("#type_item > div:nth-child(1)").onclick = function() {delDontBuy() + delDontSell()};


    //Show button "Buy with Kobans" if the User wants to buy with Kobans
    $('#shop').append('<label type="button" id="GiveMeThisItem" class=""><span id="show_terminal"><img title="Activate button" src="https://hh.hh-content.com/quest/ic_eyeopen.svg"></span></label>')
    document.querySelector("#GiveMeThisItem").onclick = function() {delDontBuy()};

    //Show button "Sell Item" if the User wants to sell his Item
    $('#inventory').append('<label type="button" id="SellThisItem" class=""><span id="show_terminal"><img title="Activate button" src="https://hh.hh-content.com/quest/ic_eyeopen.svg"></span></label>')
    document.querySelector("#SellThisItem").onclick = function() {delDontSell()};


    //function for buy and sell button
    function addDontBuy() {
        $('#shop button[rel=buy]').addClass('DONTbuy')
    }
    function delDontBuy() {
        $('#shop button[rel=buy]').removeClass('DONTbuy')
    }
    function addDontSell() {
        $('#inventory button[rel=sell]').addClass('DONTsell')
    }
    function delDontSell() {
        $('#inventory button[rel=sell]').removeClass('DONTsell')
    }
}

//Hide button "sell your Items" for Boostershop & Bookshop & Giftshop


//Side-Quest
if (page == 'side-quests.html') {
    $('.side-quest').has('.Read').addClass('complete')
    $('.side-quest').each(function() {
        $('.side-quest:not(:has(".slot.slot_xp"))').not('.complete').addClass('rewards').find('.Continue').removeClass('blue_button_L').addClass('purple_button_L').text('➥ Reward')
    })
}


//PoA changes
if (page == 'event.html') {
    //Give girls more space if all Mission done
    $('#poa-content:not(:has(".selected"))').each(function() {
        $('#events #poa-content .animated-girl-display').addClass('MoreSpace')
        $('#events #poa-content .girl-avatar').addClass('MoreSpace')
    })
    //If "PoA reward Container" get clicked, remove more space for girls
    $("#nc-poa-tape-rewards .nc-poa-reward-container").click(function() {
        $('#events #poa-content .animated-girl-display').removeClass('MoreSpace')
        $('#events #poa-content .girl-avatar').removeClass('MoreSpace')
    })
    //Add Club Champion if "Go to Champion"
    $('#poa-content .buttons:has(button[data-href="/champions-map.html"])').append('<button data-href="club-champion.html" class="blue_button_L">Go to Club Champions</button>')

    //"Go to" change to "➥"
    $('#poa-content .buttons button').each(function() {
        var Goto = $(this).text().replace('Go to','➥').replace('Defeat','➥')
        $(this).text(Goto)
    })

}

//PlaceOfPower /addons
if (page == 'activities.html') {
    $('#pop_info .pop_thumb_title > span').each(function() {
        var HCCHKH = $(this).text().replace(/ *\([^)]*\) */g, "")
        $(this).text(HCCHKH)
    })
    $('#pop_info .pop_thumb_level > span').each(function() {
        var LVL = $(this).text().replace("Lvl", "LvL")
        $(this).text(LVL)
    })
}

//Pantheon /addons
if (page == 'pantheon.html') {
    $('#pantheon_tab_container .temple-name-bgr .text-container > div').each(function() {
        var LVL = $(this).text().replace("Lvl", "LvL")
        $(this).text(LVL)
    })
}

//Harem /addons
if (page == '1') {
    $('#harem_left .right .g_infos .lvl > span').each(function() {
        var LVL = $(this).text().replace("Lvl", "LvL")
        $(this).text(LVL)
    })
}

/*!♥Koͨmͧiͭnͥoͤ Style♥!*/