Gustavo Luigi 2024-01-10 17:38:53 -03:00
parent 2dce75d449
commit 3fd5b9c2ed
1 changed files with 15 additions and 2 deletions

View File

@ -2,6 +2,15 @@

@section('head')
<link rel="stylesheet" href="{{storage('assets/libs/intl-tel-input-17.0.0/css/intlTelInput.min.css')}}">
<style>
.form-anchor{
opacity:0;
}
.form-anchor.show{
transition: opacity 300ms;
opacity:1;
}
</style>
@stop

@section('content')
@ -222,7 +231,8 @@
// If target element is visible
if (entry.isIntersecting) {
// Remove the element to remove
elementToRemove.style.display = 'none';
elementToRemove.classList.remove('show');
setTimeout(() => elementToRemove.style.display = 'none', 300);
} else {
const fixedElementRect = elementToRemove.getBoundingClientRect();
const referenceElementRect = targetElement.getBoundingClientRect();
@ -230,9 +240,12 @@
if (fixedElementRect.bottom < referenceElementRect.top) {
// Show the element to remove
elementToRemove.style.display = 'block';
setTimeout(() => elementToRemove.classList.add('show'), 300);
} else {
// Hide the element to remove
elementToRemove.style.display = 'none';
//elementToRemove.style.display = 'none';
elementToRemove.classList.remove('show');
setTimeout(() => elementToRemove.style.display = 'none', 300);
}
}
// Stop observing once it's removed (optional)