Skip to content

Commit 4a675a3

Browse files
committed
Changing the way text is displayed
Signed-off-by: Jean-Laurent de Morlhon <[email protected]>
1 parent 0cc4b16 commit 4a675a3

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

static/index.html

+23-1
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,34 @@
5353
to {background-position: 201px 0;}
5454
}
5555
</style>
56+
<script>
57+
var sentences = [
58+
"Hello, World!",
59+
"System.out.println(\"Hello, World!\");",
60+
"console.log(\"Hello, World!\");",
61+
"printf(\"Hello, World!\n\");",
62+
"cout << \"Hello, World!\" << endl;"
63+
];
64+
var txt = sentences[Math.floor(Math.random() * sentences.length)];
65+
var i = 0;
66+
var speed = 100;
67+
function typeWriter() {
68+
if (i < txt.length) {
69+
document.getElementById("hello").innerHTML += txt.charAt(i);
70+
i++;
71+
setTimeout(typeWriter, speed);
72+
}
73+
}
74+
window.onload = function() {
75+
typeWriter();
76+
};
77+
</script>
5678
</head>
5779
<body>
5880
<img id="whale" src="whale300.png"/>
5981
<div id="waves"></div>
6082
<div id="sea">
61-
<div id="hello">Hello from Docker !</div>
83+
<div id="hello"></div>
6284
</div>
6385
</body>
6486
</html>

0 commit comments

Comments
 (0)