WEBLEB
Home
AI Editor
Login
Pro
English
English
Français
Español
HTML
CSS
JS
|
body { background-color: #000; margin: 0; height: 100vh; display: flex; justify-content: center; align-items: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; direction: ltr; /* اتجاه الكتابة من اليسار لليمين */ } .container { text-align: center; } .typing-text { font-size: 3.5rem; color: #fff; font-weight: 700; letter-spacing: 2px; } .cursor { font-size: 3.5rem; color: #00ffcc; /* لون مميز للمؤشر (اختياري) */ animation: blink 0.7s infinite; margin-left: 5px; } @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
const textElement = document.getElementById('text'); // النصوص الإنجليزية البديلة const words = ["Welcome to our website", "We design the future", "Creativity knows no limits"]; let wordIndex = 0; let charIndex = 0; let isDeleting = false; let typeSpeed = 100; function type() { const currentWord = words[wordIndex]; if (isDeleting) { textElement.textContent = currentWord.substring(0, charIndex - 1); charIndex--; typeSpeed = 50; // سرعة الحذف } else { textElement.textContent = currentWord.substring(0, charIndex + 1); charIndex++; typeSpeed = 150; // سرعة الكتابة } if (!isDeleting && charIndex === currentWord.length) { isDeleting = true; typeSpeed = 2000; // مدة التوقف عند اكتمال الكلمة } else if (isDeleting && charIndex === 0) { isDeleting = false; wordIndex = (wordIndex + 1) % words.length; typeSpeed = 500; } setTimeout(type, typeSpeed); } document.addEventListener('DOMContentLoaded', type);
Preview
Open Advanced Editor
Publish Code
Full Screen
HTML
CSS
JS
|
body { background-color: #000; margin: 0; height: 100vh; display: flex; justify-content: center; align-items: center; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; direction: ltr; /* اتجاه الكتابة من اليسار لليمين */ } .container { text-align: center; } .typing-text { font-size: 3.5rem; color: #fff; font-weight: 700; letter-spacing: 2px; } .cursor { font-size: 3.5rem; color: #00ffcc; /* لون مميز للمؤشر (اختياري) */ animation: blink 0.7s infinite; margin-left: 5px; } @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
const textElement = document.getElementById('text'); // النصوص الإنجليزية البديلة const words = ["Welcome to our website", "We design the future", "Creativity knows no limits"]; let wordIndex = 0; let charIndex = 0; let isDeleting = false; let typeSpeed = 100; function type() { const currentWord = words[wordIndex]; if (isDeleting) { textElement.textContent = currentWord.substring(0, charIndex - 1); charIndex--; typeSpeed = 50; // سرعة الحذف } else { textElement.textContent = currentWord.substring(0, charIndex + 1); charIndex++; typeSpeed = 150; // سرعة الكتابة } if (!isDeleting && charIndex === currentWord.length) { isDeleting = true; typeSpeed = 2000; // مدة التوقف عند اكتمال الكلمة } else if (isDeleting && charIndex === 0) { isDeleting = false; wordIndex = (wordIndex + 1) % words.length; typeSpeed = 500; } setTimeout(type, typeSpeed); } document.addEventListener('DOMContentLoaded', type);
Preview
Validating your code, please wait...