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

@ -263,27 +263,28 @@
const nameField = document.getElementById('name'); const nameField = document.getElementById('name');
nameField.placeholder = ""; nameField.placeholder = "";
const targetElement = document.querySelector('#lumino-form-sent'); const targetElement = document.querySelector('#lumino-form-sent');

const observer = new IntersectionObserver(entries => { const observer = new IntersectionObserver(entries => {
entries.forEach(entry => { entries.forEach(entry => {
if (entry.isIntersecting) { if (entry.isIntersecting) {
let typedOptions = {
nameField.addEventListener("focus", () => { strings: ['Max Mustermann'],
setTimeout(() => { typeSpeed: 50,
let typed = new Typed('#name', { backSpeed: 25,
strings: ['Max Mustermann'], showCursor: false,
typeSpeed: 50, startDelay: 500,
backSpeed: 25, loop: false,
showCursor: false, attr: 'placeholder'
startDelay: 500, };
loop: false,
attr: 'placeholder'
});
}, 1000);
});


if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) nameField.focus() if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
else setTimeout(() => nameField.focus(), 2000); nameField.focus();
setTimeout(() => new Typed('#name', typedOptions), 500);
}
else setTimeout(() => {
nameField.focus();
setTimeout(() => new Typed('#name', typedOptions), 500);
}, 2000);


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