Greasy Fork

Duolingo Wide

Make Duolingo wider and more minimalist.

当前为 2017-05-04 提交的版本,查看 最新版本

// ==UserScript==
// @name         Duolingo Wide
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Make Duolingo wider and more minimalist.
// @author       Nekosuki
// @match        https://www.duolingo.com/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    (function() {
        var s = document.createElement("style");
        s.innerText = "div.a5SW0,div._2_lzu{display:none}div._3MT-S{width:100%}div.kHldG{width:20%}";
        document.head.appendChild(s);
    })();
    function replaceLingotButton() {
        let c = document.querySelector("div.mAsUf");
        if(c.firstElementChild.dataset.test != "lingot-store-button") return;
        var a = document.createElement("a");
        a.dataset.test = "global-practice";
        a.className = "_3LN9C _3QG2_ _1vaUe _3IS_q _1XnsG _1vaUe _3IS_q";
        a.href = "/practice";
        a.text = "Strengthen skills";
        c.replaceChild(a, c.firstElementChild);
    }
    replaceLingotButton();
    document.addEventListener("DOMSubtreeModified", replaceLingotButton);
})();