Wanikani: Dashboard Level

Adds level back to the dashboard header

От 31.01.2020. Виж последната версия.

// ==UserScript==
// @name         Wanikani: Dashboard Level
// @namespace    http://tampermonkey.net/
// @version      1.0.4
// @description  Adds level back to the dashboard header
// @author       Kumirei
// @include      https://www.wanikani.com*
// @include      *preview.wanikani.com*
// @grant        none
// ==/UserScript==

(function() {
    if ($('.global-header').length) {
        var level = $('li.user-summary__attribute a')[0].href.split('/level/')[1];
        $('.sitemap .sitemap__section:first-child h2').before('<span class="dashboard-level">'+level+'</span>');
        $('head').append('<style id="DashboardLevelCSS">'+
                         '.dashboard-level {'+
                         '    background: #a0f;'+
                         '    min-width: 16px;'+
                         '    padding: 0 8px;'+
                         '    font-size: 0.75rem;'+
                         '    display: inline-block;'+
                         '    vertical-align: top;'+
                         '    border-radius: 4px 0 0 4px;'+
                         '    line-height: 32px;'+
                         '    color: #fff;'+
                         '    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);'+
                         '    font-weight: bold;'+
                         '    text-align: center;'+
                         '}'+
                         '.sitemap .sitemap__section:first-child h2 {'+
                         '    display: inline-block;'+
                         '    border: 2px solid rgba(0, 0, 0, 0.1);'+
                         '    border-left: 0;'+
                         '    padding-left: 11px;'+
                         '    border-radius: 0 4px 4px 0;'+
                         '}'+
                         '.level-duration {' +
                         '    margin-top: -3px !important;' +
                         '}' +
                         '</style>');
    }
})();