Skip to content

Instantly share code, notes, and snippets.

@whiteball
Last active November 20, 2022 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save whiteball/cf068c67041d5538914182d4e00d03ea to your computer and use it in GitHub Desktop.
Save whiteball/cf068c67041d5538914182d4e00d03ea to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name AIのべりすと 任意フォント指定
// @namespace https://ai-novelist-share.geo.jp/
// @version 0.1
// @description AIのべりすとの本文のフォント指定の拡張の所に、任意のフォント名を指定できるボタンとテキストボックスを追加します。
// @author しらたま
// @match https://ai-novel.com/novel.php
// @icon https://www.google.com/s2/favicons?sz=64&domain=ai-novel.com
// @updateURL https://gist.github.com/whiteball/cf068c67041d5538914182d4e00d03ea/raw/ai_novelist_any_font.user.js
// @downloadURL https://gist.github.com/whiteball/cf068c67041d5538914182d4e00d03ea/raw/ai_novelist_any_font.user.js
// @supportURL https://gist.github.com/whiteball/cf068c67041d5538914182d4e00d03ea
// @grant none
// ==/UserScript==
(function() {
'use strict';
const fonts_set1 = document.getElementById('fonts_set1')
if (fonts_set1) {
fonts_set1.insertAdjacentHTML('beforeend', `<br>
<p id="mod_font_select" class="fontselector" style="font-family: Initial; background-color: rgb(45, 80, 158);" onclick="FontFamily($(this));">
隣にフォント名を入力</p>
<p class="fontselector" style="border-width: 0;color: none;background-color: initial;border-color: initial;cursor: initial">
<input type="text" id="mod_font_name" style="top:3px;height: 26px;width:18vw" placeholder="任意フォント指定"></p>`)
const mod_font_name = document.getElementById('mod_font_name'),
mod_font_select = document.getElementById('mod_font_select')
if (mod_font_name && mod_font_select) {
mod_font_name.addEventListener('keyup', function () {
mod_font_select.style['font-family'] = this.value
mod_font_select.innerText = this.value
})
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment