master
parent
194abc641d
commit
eaa3bedf59
|
@ -267,10 +267,7 @@
|
|||
const observer = new IntersectionObserver(entries => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting) {
|
||||
|
||||
nameField.addEventListener("focus", () => {
|
||||
setTimeout(() => {
|
||||
let typed = new Typed('#name', {
|
||||
let typedOptions = {
|
||||
strings: ['Max Mustermann'],
|
||||
typeSpeed: 50,
|
||||
backSpeed: 25,
|
||||
|
@ -278,12 +275,16 @@
|
|||
startDelay: 500,
|
||||
loop: false,
|
||||
attr: 'placeholder'
|
||||
});
|
||||
}, 1000);
|
||||
});
|
||||
};
|
||||
|
||||
if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) nameField.focus()
|
||||
else setTimeout(() => nameField.focus(), 2000);
|
||||
if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
|
||||
nameField.focus();
|
||||
setTimeout(() => new Typed('#name', typedOptions), 500);
|
||||
}
|
||||
else setTimeout(() => {
|
||||
nameField.focus();
|
||||
setTimeout(() => new Typed('#name', typedOptions), 500);
|
||||
}, 2000);
|
||||
|
||||
observer.unobserve(targetElement);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue