您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Force the Memrise website to change font dynamicly in choice boxes.
// ==UserScript== // @name Memrise Dynamic Font for Kanji v3 // @namespace http://tampermonkey.net/ // @version 0.3 // @description Force the Memrise website to change font dynamicly in choice boxes. // @author superpawko // @match *://www.memrise.com/course/* // @grant none // ==/UserScript== // Add some fancy fonts first. function addGlobalStyle(css) { var head, style; head = document.getElementsByTagName('head')[0]; if (!head) { return; } style = document.createElement('style'); style.type = 'text/css'; style.innerHTML = css; head.appendChild(style); } addGlobalStyle('@import url("https://fonts.googleapis.com/css?family=Lato|Playfair+Display")'); $(document).ready(function() { MEMRISE.garden.boxes.load = (function() { var cached_function = MEMRISE.garden.boxes.load; return function() { MEMRISE.garden.boxes.activate_box = (function() { var cached_function = MEMRISE.garden.boxes.activate_box; return function() { var result = cached_function.apply(this, arguments); $("#boxes > div > ol > li").each(function( index ) { var $index = index + 1; var $quote = $("#boxes > div > ol > li:nth-child("+ $index +") > span.val"); var $questionTrimed = $.trim($quote.text()); var $numWords = $questionTrimed.split(" ").length; var $questionCharNum = $questionTrimed.length; var qsize = (3.3 - Math.sqrt($questionCharNum) * 0.4) * (1.2 - $numWords * 0.1); // Function for text size in REM //console.log("------------ FONT CHANGED"); //console.log("idx: " + index + " qtrimmed: " + $questionTrimed + " qtrimmedLENGTH: " + $questionCharNum + " numWords: " + $numWords + " ftsize: " + qsize); if (($numWords <= 4) && ($questionCharNum < 28)) { $("#boxes > div > ol > li:nth-child(" + $index + ") > span.val").css({ fontSize: qsize +"rem", 'line-height': qsize +"rem" }); } else { $("#boxes > div > ol > li").css({ 'float': 'left', 'width': '570px' }); } return result; }); }; }()); return cached_function.apply(this, arguments); }; }()); });
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址