Gustavo Luigi 2024-01-11 17:32:16 -03:00
parent 194abc641d
commit eaa3bedf59
1 changed files with 18 additions and 17 deletions

View File

@ -267,23 +267,24 @@
const observer = new IntersectionObserver(entries => { const observer = new IntersectionObserver(entries => {
entries.forEach(entry => { entries.forEach(entry => {
if (entry.isIntersecting) { if (entry.isIntersecting) {
let typedOptions = {
strings: ['Max Mustermann'],
typeSpeed: 50,
backSpeed: 25,
showCursor: false,
startDelay: 500,
loop: false,
attr: 'placeholder'
};


nameField.addEventListener("focus", () => { if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
setTimeout(() => { nameField.focus();
let typed = new Typed('#name', { setTimeout(() => new Typed('#name', typedOptions), 500);
strings: ['Max Mustermann'], }
typeSpeed: 50, else setTimeout(() => {
backSpeed: 25, nameField.focus();
showCursor: false, setTimeout(() => new Typed('#name', typedOptions), 500);
startDelay: 500, }, 2000);
loop: false,
attr: 'placeholder'
});
}, 1000);
});

if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) nameField.focus()
else setTimeout(() => nameField.focus(), 2000);


observer.unobserve(targetElement); observer.unobserve(targetElement);
} }