Created
December 27, 2013 00:14
-
-
Save noriaki/8140574 to your computer and use it in GitHub Desktop.
This file contains 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
/* | |
* Yet Another Sound-Novel | |
* WORK ONLY http://newclassic.jp/archives/4200 | |
* Usage: exec in browser console. ex) chrome developer tools | |
*/ | |
// parse text | |
var bbtext = function() { | |
var i = 0, t = jQuery('.story_main *:not(:has(img,script,noscript,iframe),img,script,noscript,iframe)').text().split('。'); | |
return function() { return t[i++] + '。'; } | |
}(); | |
// append background | |
jQuery('body').append(jQuery('<div id="bb">').attr('style', 'width:100%;height:100%;position:absolute;top:0;left:0;background:black;opacity:0.5;')); | |
jQuery('body').append(jQuery('<div id="bbt">').attr('style', 'width:94%;color:white;position:absolute;top:5%;left:3%;font-size:110%;font-family:serif;')); | |
// set event and text | |
jQuery('#bbt').text(bbtext()); | |
jQuery('#bb,#bbt').on('click', function(e) { jQuery('#bbt').text(bbtext()); }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment