Hello, I would like to use an inscription where the last word will be transcribed to a different meaning of the sentence.
Please do you have a solution, bric or template to use last word rewriting?
For example:
Design can be divine
Design can be nice
Design can be innovative
I created the HTML5 code for .php in ChatGPT and added it to the Blocs project via the Code Widget. The code in the live preview in Blocs works and the last word is overwritten, unfortunately it no longer works after uploading to the FTP server (maybe I have something wrongly set up in the export).
HTML code: https://eldar.2one.cz/HTML_code_text.rtf
Blocs format: https://eldar.2one.cz/2one.cz_2023.bloc
Website: https://2one.cz/
Thank You, Izzy Cooper
<!DOCTYPE html>
<html>
<head>
<title>KouzlenĂ s marketingem</title>
</head>
<body>
<p id="prepisujiciText">Design mĹŻĹže bĂ˝t boĹžĂ!</p>
<script>
var slova = ["kreativnĂ", "inovativnĂ", "oslnivĂ˝", "zajĂmavĂ˝"];
var slovoIndex = 0;
var textElement = document.getElementById("prepisujiciText");
var slovo = slova[slovoIndex];
var pismenoIndex = 0;
var cekaniPoSlovu = 1500; // 1 sekundy
var zmenaSlovaInterval = 4000; // 4 sekund
function prepisujPismeno() {
if (pismenoIndex < slovo.length) {
var novaVeta = textElement.textContent;
novaVeta = novaVeta.slice(0, novaVeta.lastIndexOf(" ") + 1) + slovo.substring(0, pismenoIndex + 1);
textElement.textContent = novaVeta;
pismenoIndex++;
} else {
setTimeout(function() {
pismenoIndex = 0;
slovo = slova[slovoIndex];
}, cekaniPoSlovu);
}
}
function zmenSlovo() {
slovoIndex = (slovoIndex + 1) % slova.length;
slovo = slova[slovoIndex];
}
setInterval(prepisujPismeno, 100); // MÄĹte pĂsmeno rychle
setInterval(zmenSlovo, zmenaSlovaInterval); // ZmÄĹte slovo kaĹždĂ˝ch 5 sekund
</script>
</body>
</html>