Skip to content

Instantly share code, notes, and snippets.

@noriaki
Created December 27, 2013 00:14
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 noriaki/8140574 to your computer and use it in GitHub Desktop.
Save noriaki/8140574 to your computer and use it in GitHub Desktop.
/*
* 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