mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
function typeText(textParts, header) {
|
|
var currentText = textParts[0];
|
|
textParts[0] = currentText.slice(1);
|
|
if (currentText.length > 0) {
|
|
if (currentText.split('').some(x => x != " ")) {
|
|
header.innerHTML += currentText.charAt(0);
|
|
window.setTimeout(() => {
|
|
typeText(textParts, header);
|
|
}, 100);
|
|
}
|
|
else {
|
|
header.innerHTML = header.innerHTML.slice(0, -1);
|
|
window.setTimeout(() => {
|
|
typeText(textParts, header);
|
|
}, 50);
|
|
}
|
|
}
|
|
else {
|
|
textParts.shift();
|
|
if (textParts.length > 0) {
|
|
var timeout = 100;
|
|
if (textParts[0].split('').every(x => x == " ")) {
|
|
timeout = 800;
|
|
}
|
|
console.log(timeout);
|
|
window.setTimeout(() => {
|
|
typeText(textParts, header);
|
|
}, timeout);
|
|
}
|
|
}
|
|
}
|
|
var text = [
|
|
"Remote desktop",
|
|
" ",
|
|
" scripting",
|
|
" ",
|
|
"ly"
|
|
];
|
|
var header = document.getElementById("remotelyHeader");
|
|
typeText(text, header);
|
|
//# sourceMappingURL=IndexNotLoggedIn.js.map
|