The last time Hackerfall tried to access this page, it returned a not found error. A cached version of the page is below, or click here to continue anyway

ConCon Test

This is the concon.js test page.

ConCon is just a toy I made really quickly, but I've been polishing it for a little while. It has some pretty cool features now, such as pausing when you mouse over it, and being properly formatted as a jQuery plugin.

Usage is as follows: $('#someDiv').concon(); It can really be that simple! There are some options, however. Shown here with their default values: $('#someDiv').concon({ dataSource : 'data.txt', // Where to fetch the data characterDelay : 10, // Milliseconds to wait between characers newlineDelay : 500, // ms to wait when starting a new line paragraphDelay : 2000, // ms to wait when a blank line is found repeatDelay : 3000, // ms to wait before starting over at the end usePrompt : true, // Wether or not to use the following: prompt : 'demmy@'+location.hostname+':~# ', // "prompt" for text to be entered at startCommand : 'concon', // Command to "enter" at the beginning clearCommand : 'clear' // Command to "enter" at the end, before clearing the screen }); ...or if you just want to set the dataSource, you can say... $('#someDiv').concon('/cms/model/news.php?format=plaintext');

It will automatically reload from the dataSource every time it has looped over it, so it will always be fresh.

There is a suggested way to style it, but it should be fairly easy to make use of. Every character in the file is inserted as a separate node in the DOM, which automatically escapes any and all HTML provided. In addition to this, there are also some control characters.

CharacterNameEffect \nlinefeedReplaced with a <br> to make a new line in the output. Adds the newlineDelay pause. \0nullAdds an extra newlineDelay without the actual new line. \1start of headingClears the screen. \2start of textStarts "typed mode" like when the commands are "typed" at the start and end of the animation. \3end of textEnds "typed mode"

Get ConCon here and include it as you would any jQuery plugin. Sneak a peak at the source of this page if you want to see roughly how that's done. Enjoy to the extent possible!

Continue reading on