[Userscript] Script that notices your 0 lessons and reviews

Just a little fun thing I made today
https://greasyfork.org/en/scripts/42082-wanikani-zero-zero-what-s-this
Screenshot_20180427_132426

34 Likes

owo what’s this

15 Likes

Amazing.

7 Likes

Scripts that actually help me? No thanks.

This? Yes.

23 Likes

looks kewl

1 Like

Amazing.
Suggestion: make it change “Lessons” to “what’s” and “Reviews” to “this?”

3 Likes

sips tea … absolutely magnificent

ice_screenshot_20180430-162948

5 Likes

10 Likes

Classy!

spills tea all over the place

giphy

3 Likes

I want to import all your wk script settings haha. You are amazing

I actually posted it all quite recently. Well, except for my edit to this script, but I can provide that now.

See this post: Wanikani screenshots 📸

Oh, and for the minor edit to the SRS Grid script, see this post: [UserScript] SRS Grid Details

My version of this script, the OwO script, looks like this:

// ==UserScript==
// @name        WaniKani Zero Zero what's this
// @namespace   FelixNemis.scripts
// @author      FelixNemis
// @description Notices when you have 0 lessons and reviews and adds a little visual flair
// @match       http://www.wanikani.com/
// @match       http://www.wanikani.com/dashboard*
// @match       https://www.wanikani.com/
// @match       https://www.wanikani.com/dashboard*
// @version     0.1
// @grant       none
// @run-at      document-end
// ==/UserScript==

function main() {
    if ($('.lessons span')[0].innerText === '0' && $('.reviews span')[0].innerText === '0') {
		$('head').append('<style id="owostyle">' +
						 '    .owo {' +
						 '        position: absolute;' +
						 '        left: 3.7em;' +
						 '        top: 2em;' +
						 '        font-size: 2em;' +
						 '        font-family: Kristen ITC;' +
						 '        color: #e161e7 !important;' +
						 '    }' +
						 '    .lessons {position: relative;}' +
						 '    li.lessons a[href="/lesson"], li.reviews a[href="/review"] {color: transparent !important;}' +
						 '    .nav li[class*="wanikani-tour"] a span:first-child {border: 2px solid purple !important; color: gold !important;}' +
						 '</style>');
        $('.lessons').append('<span class="owo">w</span>');
    }
}
window.addEventListener('load', main, false);
5 Likes

Thank you! :heart_eyes:

1 Like

Can’t guarantee that my edits look the same for you though, since I only tested them on my computer.

image

Perfect :grin:

3 Likes

Whenever you scroll down the styling of the top bar changes and the W just floats randomly on the screen.

So I edited the script to make the W invisible whenever your not at the top of the page and visible again whenever you are.

Just add the following to the end of the script:

//checks to see if visibility needs to be toggled
var toggleWVisibility = function() {
    //set 'W' to invisible not at the top of the page
    if($(window).scrollTop()!=0){
        //console.log("Not the top of the page! Making W invisible");
        $('head').append('<style id="owostyle">' +
						 '    .owo {' +
                         '        display:none;' +
						 '    }' +
						 '</style>');
    } else {//if at the top of the page set 'W' to visible
        //console.log("Top of page! Making W visible");
        $('head').append('<style id="owostyle">' +
						 '    .owo {' +
                         '        display:list-item;' +
						 '    }' +
						 '</style>');
    }
}

//calles on page load
window.onload = function() {
  toggleWVisibility();
}
//called whenever the window has scrolled.
window.onscroll = function (e) {
    toggleWVisibility();
}

You’ll also have to add the following new line to the original code:

owo.style.top = "2.8em"; //original line
owo.className  = "owo";//new line
var lessons = document.getElementsByClassName('lessons')[0];//original line

You don’t have to add that line if your using Kumirei’s styling though.

I’ve only used this edit in chrome so can’t assure if it will work in firefox and such.

If you encounter any bugs just let me know.

1 Like

Looks like this will keep adding styles to the head as you scroll. Maybe you want to use just one style and toggle a class instead?

1 Like

Thanks for pointing this out, fixed
Screenshot%20from%202018-09-09%2011-58-41

1 Like

OwO what’s this more like OnO what’s this

(⊙∩⊙✿)

Rest in peace -_-

1 Like