It looks like you're new here. If you want to get involved, click one of these buttons!
/*! typed.js integration module for SugarCube */ !function(){"use strict";var getInlineOptions=function(classNames){var match,options={},typedRe=/^typed(?:-(\w+))+\b$/,parseRe=/-(speed|delay)(\d+)\b/g;if("typed"!==classNames){classNames=classNames.toLowerCase().split(/\s+/);for(var i=0;i<classNames.length;i++)if(typedRe.test(classNames[i])){for(;null!==(match=parseRe.exec(classNames[i]));)switch(match[1]){case"speed":options.typeSpeed=+match[2];break;case"delay":options.startDelay=+match[2]}break}}return options},typedCallbackFactory=function(el,callback){return function(){var $outer=jQuery(el),$inner=jQuery('<div class="typedjs-text-wrapper" style="display:block;position:absolute;left:0;top:0;"><span class="typed"></span></div>'),$source=$outer.children('[class|="typed"]'),options=jQuery.extend({typeSpeed:40,startDelay:400},getInlineOptions($source.attr("class")),{strings:[$source.html()]});"function"==typeof callback&&(options.callback=callback),$outer.append($inner),$inner.children().typed(options)}};postrender.typedSetupHandler=function(content){jQuery('[class|="typed"]',content).addClass("typed").css("visibility","hidden").wrap('<div class="typedjs-outer-wrapper" style="display:block;position:relative;"></div>')},postdisplay.typedAnimationHandler=function(){for(var $elements=jQuery("#passages .typedjs-outer-wrapper"),callback=null,i=$elements.length-1;i>=0;--i)callback=typedCallbackFactory($elements[i],callback);"function"==typeof callback&&callback()}}();
@ !!Instructions for SugarCube The integration module will run Typed.js on any element with the class {{{typed}}}, so you may use either HTML markup or the [[custom styles markup|http://www.motoslave.net/sugarcube/2/docs/markup.html#custom-styles]]. Additionally, you may append optional components to the {{{typed}}} class, separated by hyphens, which control various aspects of the typing animation: {{{ speed# Typing speed (in ms; default: 40). delay# Delay before typing starts (in ms; default: 400). }}} !!Class Name Examples Basic example, speed and delay at defaults: {{{ typed }}} To set the typing speed to 80ms: {{{ typed-speed80 }}} To delay the start of typing for 800ms: {{{ typed-delay800 }}} To set the typing speed to 80ms and delay the start of typing for 800ms: {{{ typed-speed80-delay800 }}} !!See Also Obviously, check out the source of the Start passage, Story JavaScript, and Story Stylesheet.
Comments
edit: Where are you getting the SugarCube related instruction for typed.js from, they don't appear to be on the SugarCube 2 website.
everyone said it's works but not for me, dunno what's missing
works like a charm !!