WaniKani random font

Randomize between Japanese fonts on WaniKani.

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

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

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

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