NIWPI/pages/_p/.Backs/20190911-203147/machine-a-ecrire.html

59 lines
2.0 KiB
HTML

<script src="js/jquery.min.js"></script>
<style type="text/css">
#console { height: 200px; border-radius: 5px; background: #000; margin-bottom: 15px; padding: 15px 15px; }
#console pre { color: #fff; font-family: 'Monaco', courier, monospace; line-height: 1.5; overflow: hidden; }
#console pre a { font-weight: bold; color: #fff; text-decoration: underline; }
#console .keyword { color: #ec77b4; }
#console .string { color: #ff8714; }
#console .function { color: #96c9ff; }
#console .variable { color: #ffd67d; }
</style>
<div id="console">
<pre id="consoleText">
</pre>
</div>
<script type="text/javascript">
var text = '<span class="keyword">function</span> <span class="function">echo</span>(system) {\n\t<span class="variable">$what</span> = <span class="string">\'Geek Developers\'</span>;\n\t<span class="variable">$since</span> = <span class="function">strtotime</span>(<span class="string">\'2006\'</span>);\n\t<span class="variable">$where</span> = <span class="string">\'DTC, FR\'</span>;\n\t<span class="keyword">if</span>(<span class="variable">$interested</span> === <span class="keyword">true</span>) {\n\t\t<a href=\"http://www.facebook.com/pages/Echosystem_fr\"><span class="function">Like_Or_+1</span>();</a>\n\t}\n}';
var currentChar = 1;
var htmltag = false;
var cache = '';
function type()
{
var str = text.substr(0, currentChar);
var last = str.substr(str.length -1, str.length);
if(last != '<' && last != '>' & last != '/') {
$("#consoleText").html(str);
}
currentChar++;
if(currentChar <= text.length)
{
if(last == '<') {
htmltag = true;
} else if(last == '>') {
htmltag = false;
}
if(htmltag) {
setTimeout(type, 1);
} else {
setTimeout(type, 50);
}
}
}
$(document).ready(function() {
$("#consoleText").html("");
setTimeout(type, 2000);
});
</script>