Codewars helper

Removes unlock solution buttons and AD under the kata description

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name Codewars helper
// @author Murka
// @description Removes unlock solution buttons and AD under the kata description
// @icon https://i.imgur.com/LKAcLYO.png
// @version 0.2
// @match *://www.codewars.com/*
// @run-at document-end
// @grant none
// @license MIT
// @namespace https://greasyfork.org/users/919633
// ==/UserScript==
/* jshint esversion:6 */

/*
    Author: Murka
    Github: https://github.com/Murka007
    Discord: https://discord.gg/cPRFdcZkeD
    Greasyfork: https://greasyfork.org/en/users/919633
*/

(function() {
    "use strict";

    // Removes unlock solution button, right under sample tests
    const HIDE_SOLUTION_TRAIN = true;

    // Removes unlock solution button in the kata preview
    const HIDE_SOLUTION_PREVIEW = false;

    // Removes AD banner under kata description
    const HIDE_DESCRIPTION_BANNER = true;

    const styles = [];

    if (HIDE_SOLUTION_TRAIN) {
        styles.push(`
            #view_solutions, #surrender_btn {
                display: none!important;
            }
        `)
    }

    if (HIDE_SOLUTION_PREVIEW) {
        styles.push(`
            .w-full.mt-2:not(.clear-both) > * > ul.flex.flex-row.justify-center.items-center.space-x-2.px-0.border-0.h-10 > li:nth-child(2) {
                display: none!important;
            }
        `)
    }

    if (HIDE_DESCRIPTION_BANNER) {
        styles.push(`
            .description.h-full {
                height: auto!important;
            }

            .description.h-full > .description-footer {
                display: none!important;
            }
        `)
    }

    const style = document.createElement("style");
    style.innerHTML = styles.join("\n");
    document.head.appendChild(style);

})();