master
parent
4443c41b20
commit
1409c76753
|
@ -225,6 +225,7 @@
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<script src="https://cdn.jsdelivr.net/npm/typed.js@2.0.12"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Get the elements
|
// Get the elements
|
||||||
|
@ -265,8 +266,22 @@
|
||||||
const observer = new IntersectionObserver(entries => {
|
const observer = new IntersectionObserver(entries => {
|
||||||
entries.forEach(entry => {
|
entries.forEach(entry => {
|
||||||
if (entry.isIntersecting) {
|
if (entry.isIntersecting) {
|
||||||
|
nameField.addEventListener("focus", () => {
|
||||||
|
setTimeout(() => {
|
||||||
|
let typed = new Typed('#name', {
|
||||||
|
strings: ['Max Mustermann'],
|
||||||
|
typeSpeed: 50,
|
||||||
|
backSpeed: 25,
|
||||||
|
showCursor: false,
|
||||||
|
startDelay: 500,
|
||||||
|
loop: false
|
||||||
|
});
|
||||||
|
}, 1000);
|
||||||
|
});
|
||||||
|
|
||||||
if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) nameField.focus()
|
if(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) nameField.focus()
|
||||||
else setTimeout(() => nameField.focus(), 2000);
|
else setTimeout(() => nameField.focus(), 2000);
|
||||||
|
|
||||||
observer.unobserve(targetElement);
|
observer.unobserve(targetElement);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue