<div class="justify-between py-6 md:flex" x-data="{ open: false, hasScrolled: false, reactOnScroll() { if (this.$el.getBoundingClientRect().top < 120 && window.scrollY > 120) { this.hasScrolled = true; } else { this.hasScrolled = false; } } }" x-init="reactOnScroll()" @scroll.window="reactOnScroll()" >