Back

UI Extended

1<span id="typing-text"></span>
1@keyframes blink {
2 0%,
3 100% {
4 border-color: transparent;
5 }
6 50% {
7 border-color: var(--text-color);
8 }
9}
10 
11#typing-text {
12 color: black;
13 border-right: 3.5px solid black; /* Simulasi kursor yang berkedip */
14 white-space: nowrap;
15 overflow: hidden; /* Agar teks tidak meluap */
16 font-size: 5.6rem;
17 font-weight: 700;
18 line-height: 1.5; /* Pastikan line-height tetap ada */
19 display: inline-block; /* Agar ukuran elemen sesuai dengan teks */
20 min-height: calc(5.6rem * 1.5); /* Menjaga tinggi elemen saat teks belum muncul */
21}
22 
23#typing-text {
24 animation: blink 0.7s steps(2) infinite;
25}
1// typing
2const text = "Kodeset"; // Teks yang akan dianimasikan
3let index = 0;
4let isDeleting = false;
5const speed = 100; // Kecepatan mengetik
6const delayBeforeDeleting = 3000; // Waktu jeda sebelum menghapus
7const delayBeforeTypingAgain = 500; // Waktu jeda sebelum mengetik ulang
8 
9function typeText() {
10 const typingTextElement = document.getElementById("typing-text");
11 
12 if (isDeleting) {
13 typingTextElement.innerHTML = text.substring(0, index);
14 index--;
15 if (index < 0) {
16 isDeleting = false;
17 setTimeout(typeText, delayBeforeTypingAgain);
18 } else {
19 setTimeout(typeText, speed / 2); // Lebih cepat saat menghapus
20 }
21 } else {
22 typingTextElement.innerHTML = text.substring(0, index);
23 index++;
24 if (index > text.length) {
25 isDeleting = true;
26 setTimeout(typeText, delayBeforeDeleting); // Jeda sebelum mulai menghapus
27 } else {
28 setTimeout(typeText, speed); // Kecepatan mengetik
29 }
30 }
31}
32 
33window.onload = function () {
34 setTimeout(typeText, delayBeforeTypingAgain); // Mulai mengetik setelah jeda
35};

MIT License

Copyright © 2026 Kodeset


Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:


The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.