-
-
Save syoichi/877517 to your computer and use it in GitHub Desktop.
自分の環境(Windows XP, 12.0.707.0 canary)だと縦書きにならなかったり、User Scriptを読み込んだ時に、headの内容が何故か読み込まれていない場合があったので修正した。 追記:江添さんのChrome拡張版: http://j.mp/euuSQl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name 縦書き | |
// @namespace http://lowreal.net/ | |
// @include http://www.aozora.gr.jp/cards/*/files/*.html | |
// ==/UserScript== | |
var b = document.body; | |
document.head.innerHTML += '<style type="text/css"> html { background: #222; } body { font-family: "@MS 明朝"; font-size: 14pt; line-height: 1.66 !important; color: #090909; background: #FFF5ED; padding: 2em; -webkit-writing-mode: vertical-rl; writing-mode: vertical-rl; overflow-y: hidden; max-height: 40em; text-align: justify; box-shadow: 0 0 1em 0 rgba(0, 0, 0, 0.9); margin: 8px !important; } </style>'; | |
// bug for rendering ruby elements | |
b.innerHTML = b.innerHTML; | |
b.addEventListener('mousewheel', function (e) { | |
b.scrollLeft += -e.wheelDeltaX || e.wheelDelta; | |
e.preventDefault(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment