Codewars helper

Removes unlock solution buttons and AD under the kata description

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==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);

})();