_ _
__| \_/ |
|) ^ ^ | _
|___ | \\
| \______/|
| |
| __ ______ |
|| || _|| ||_
_|| ||_'--' '--'
'--' '--'
[doggy code]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | /** * Animated ASCII dog. Westial.com logotype. * @license Use it as is. * @author Jaume Mila Bea jaume@westial.com */ // @var int miliseconds/frame 40ms/frame is 25fps var framemiliseconds = 40; var dogcloseeyes = " _ _<br> __| \_/ |<br> |) ^ ^ | _<br> |___ | \\<br> | \______/|<br> | |<br> | __ ______ |<br> || || _|| ||_<br> _|| ||_'--' '--'<br> '--' '--'" ; var dogopeneyes = " _ _<br> __| \_/ |<br> |) o o | _<br> |___ | \\<br> | \______/|<br> | |<br> | __ ______ |<br> || || _|| ||_<br> _|| ||_'--' '--'<br> '--' '--'" ; var dogtailcenter = " _ _<br> __| \_/ |<br> |) o o | _<br> |____, | \\<br> |_/ \______/|<br> | |<br> | __ ______ |<br> || || _|| ||_<br> _|| ||_'--' '--'<br> '--' '--'" ; var dogleftmed = " _ _<br> __| \_/ |<br> |) o o | _<br> |____, | \\<br> |_/ \______\\<br> | |<br> | __ ______ |<br> || || _|| ||_<br> _|| ||_'--' '--'<br> '--' '--'" ; var dogleftmax = " _ _<br> __| \_/ |<br> |) o o | <br> |____, | __<br> |_/ \____/_\\<br> | |<br> | __ ______ |<br> || || _|| ||_<br> _|| ||_'--' '--'<br> '--' '--'" ; var dogrightmed = " _ _<br> __| \_/ |<br> |) o o | _<br> |____, | //<br> |_/ \______//<br> | |<br> | __ ______ |<br> || || _|| ||_<br> _|| ||_'--' '--'<br> '--' '--'" ; var dogrightmax = " _ _<br> __| \_/ |<br> |) o o | <br> |____, | __ <br> |_/ \______//\\<br> | |<br> | __ ______ |<br> || || _|| ||_<br> _|| ||_'--' '--'<br> '--' '--'" ; var currentframe = 0; // Display destination var display = document.getElementById( "display" ); // @var array [[content, frame times], ...] var pictures = [ // Pause on init [dogcloseeyes, 50], // Open eyes [dogopeneyes, 15], // Blinking [dogcloseeyes, 2], [dogopeneyes, 3], [dogcloseeyes, 2], [dogopeneyes, 6], // Open mouth [dogtailcenter, 2], // Move tail loop 1 [dogleftmed, 1], [dogleftmax, 3], [dogleftmed, 1], [dogtailcenter, 1], [dogrightmed, 1], [dogrightmax, 3], [dogrightmed, 1], [dogrightmed, 1], // Move tail loop 2 [dogleftmed, 1], [dogleftmax, 3], [dogleftmed, 1], [dogtailcenter, 1], [dogrightmed, 1], [dogrightmax, 3], [dogrightmed, 1], // Pause open mouth [dogtailcenter, 10], // Open eyes [dogopeneyes, 2], // Large pause at end [dogcloseeyes, 300] ]; /** * Go to next frame and wait for the timeout. */ var nextframe = function () { var content = pictures[currentframe][0]; var framecount = pictures[currentframe][1]; var timeout = framecount * framemiliseconds; var lastframe = pictures.length; display.innerHTML = content; setTimeout(nextframe, timeout); currentframe = (currentframe + 1) % lastframe; }; nextframe(); |