WaniKani random font

Randomize between Japanese fonts on WaniKani.

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

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το 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        WaniKani random font
// @namespace   https://www.wanikani.com/?hey-koichi-please-implement-random-wanikani-font
// @description Randomize between Japanese fonts on WaniKani.
// @include     https://wanikani.com/*
// @include     https://www.wanikani.com/*
// @version     1
// @grant       none
// ==/UserScript==

$(function() {
	// Modify here --------------------------------------------------------
	var fonts = [
		'A-OTF Shin Maru Go Pro M',
		'EPSON 行書体M',
		'EPSON 正楷書体M',
		'EPSON 教科書体M',
		'EPSON 太明朝体B',
		'EPSON 太行書体B',
        'EPSON 太角ゴシック体B Regular',
		'EPSON 太丸ゴシック体B Regular',
        'EPSON 丸ゴシック体M',
		'KanjiStrokeOrders',
		'Meiryo',
		'nagayama_kai',
        'Kozuka Gothic Pr6N',
        'Kozuka Gothic Pro',
        'Kozuka MIncho Pr6N',
        'Kozuka Mincho Pro',
        'MS Gothic Regular',
        'MS Mincho Regular',
        'MS PGothic Regular',
        'MS PMincho Regular',
        'MS UI Gothic Regular',
        'Yu Gothic',
        'Yu Gothic UI',
        'Yu Mincho',
	];
	var good = 'Meiryo';
	var interval = 60; // Seconds
	// No more touchie past this point ------------------------------------



	var randomFont = function() {
		var chosen = fonts[Math.floor(Math.random() * fonts.length)];
		$('[lang="ja"], #user-response').css('font-family', chosen).hover(function() {
			$(this).css('font-family', good);
		}, function() {
			$(this).css('font-family', chosen);
		});
	};
	randomFont();
	setInterval(randomFont, interval * 1000);
});