I'm trying to get some ASCII art on my website with a JavaScript function but the result isn't what I'm looking for right now...
This is how it should look:
And here is the code I'm using to try to achieve that:
function log( text ) {
$log = $('#log');
//Add text to log
$log.append(($log.val()?"":'')+ text );
//Autoscroll
$log[0].scrollTop = $log[0].scrollHeight - $log[0].clientHeight;
}
log('<div style="font-family: monospace; white-space: pre;">' +
" _______ <br>" +
" |__ __| <br>" +
" | | ___ _ __ ___ _ __ ___ _ _ <br>" +
" | |/ _ \| '_ ` _ \| '_ ` _ \| | | |<br>" +
" | | (_) | | | | | | | | | | | |_| |<br>" +
" |_|\___/|_| |_| |_|_| |_| |_|\__, |<br>" +
" __/ |<br>" +
" |___/ <br>" +
"<br>" +
"</div>");
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="log"></div>
Hope you guys come up with a better result than I did because this is not working at all for me right now.
