Skip to content

Commit

Permalink
Changing the way text is displayed
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Laurent de Morlhon <[email protected]>
  • Loading branch information
jeanlaurent committed Jan 24, 2024
1 parent 0cc4b16 commit 4a675a3
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,34 @@
to {background-position: 201px 0;}
}
</style>
<script>
var sentences = [
"Hello, World!",
"System.out.println(\"Hello, World!\");",
"console.log(\"Hello, World!\");",
"printf(\"Hello, World!\n\");",
"cout << \"Hello, World!\" << endl;"
];
var txt = sentences[Math.floor(Math.random() * sentences.length)];
var i = 0;
var speed = 100;
function typeWriter() {
if (i < txt.length) {
document.getElementById("hello").innerHTML += txt.charAt(i);
i++;
setTimeout(typeWriter, speed);
}
}
window.onload = function() {
typeWriter();
};
</script>
</head>
<body>
<img id="whale" src="whale300.png"/>
<div id="waves"></div>
<div id="sea">
<div id="hello">Hello from Docker !</div>
<div id="hello"></div>
</div>
</body>
</html>

0 comments on commit 4a675a3

Please sign in to comment.