Gustavo Luigi 2024-01-11 16:19:27 -03:00
parent 1411499455
commit 5f31ebe112
1 changed files with 17 additions and 8 deletions

View File

@ -97,7 +97,7 @@
<x-form id="anfrage" class="form-load" id-name="anfrage" channels="email-anfrage,bestaetigung-kunde">
<div class="mb-4">
<label for="name" class="form-label">Name:</label>
<input type="name" name="name" class="form-control" id="name" aria-describedby="name" placeholder="Max Mustermann" autocomplete="on" required autofocus>
<input type="name" name="name" class="form-control" id="name" aria-describedby="name" placeholder="Max Mustermann" autocomplete="on" required>
</div>

<div class="mb-4">
@ -167,13 +167,6 @@
<svg style="fill: currentColor;width: 17px;margin-left: 4px;margin-bottom: 4px;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M454.6 45.3l12.1 12.1c12.5 12.5 12.5 32.8 0 45.3L440 129.4 382.6 72l26.7-26.7c12.5-12.5 32.8-12.5 45.3 0zM189 265.6l171-171L417.4 152l-171 171c-4.2 4.2-9.6 7.2-15.4 8.6l-65.6 15.1L180.5 281c1.3-5.8 4.3-11.2 8.6-15.4zm197.7-243L166.4 243c-8.5 8.5-14.4 19.2-17.1 30.9l-20.9 90.6c-1.2 5.4 .4 11 4.3 14.9s9.5 5.5 14.9 4.3l90.6-20.9c11.7-2.7 22.4-8.6 30.9-17.1L489.4 125.3c25-25 25-65.5 0-90.5L477.3 22.6c-25-25-65.5-25-90.5 0zM80 64C35.8 64 0 99.8 0 144V432c0 44.2 35.8 80 80 80H368c44.2 0 80-35.8 80-80V304c0-8.8-7.2-16-16-16s-16 7.2-16 16V432c0 26.5-21.5 48-48 48H80c-26.5 0-48-21.5-48-48V144c0-26.5 21.5-48 48-48H208c8.8 0 16-7.2 16-16s-7.2-16-16-16H80z"/></svg>
</a>
</div>

<script>
document.getElementById('link-to-form').addEventListener('click', function () {
var campoDeFormulario = document.getElementById('name');
campoDeFormulario.autofocus();
});
</script>
</div>

@stop
@ -261,5 +254,21 @@

// Observe the target element
observer.observe(targetElement);

document.getElementById('link-to-form').addEventListener('click', function () {
const nameField = document.getElementById('name');
const targetElement = document.querySelector('#lumino-form-sent');

const observer = new IntersectionObserver(entries => {
entries.forEach(entry => {
if (entry.isIntersecting) {
setTimeout(() => nameField.focus(), 1500);
observer.unobserve(targetElement);
}
});
});

observer.observe(targetElement);
});
</script>
@stop