WaniKani random font

Randomize between Japanese fonts on WaniKani.

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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);
});