I'm using the slide-overs from TailwindUI with vanilla JS and the overlay and opacity apply correctly, but the animation is happening instantly instead of using the duration class.
https://tailwindui.com/components/application-ui/overlays/slide-overs
Here is the HTML snippet for the overlay component.
<div class="hidden fixed inset-0 overflow-hidden" id="panel-container">
<div class="absolute inset-0 overflow-hidden">
<!--
Background overlay, show/hide based on slide-over state.
Entering: "ease-in-out duration-500"
From: "opacity-0"
To: "opacity-100"
Leaving: "ease-in-out duration-500"
From: "opacity-100"
To: "opacity-0"
-->
<div class="transition-opacity ease-in-out duration-1000 opacity-100 absolute inset-0 bg-gray-600 bg-opacity-70" id="panel-overlay" aria-hidden="true"></div>
<section class="absolute inset-y-0 right-0 max-w-full flex" aria-labelledby="slide-over-heading">
</section>
</div>
</div>
... and here is the script that removes the hidden class on the panel-container div.
const panelContainer = document.querySelector('#panel-container');
document.querySelector('#panel-settings--open').addEventListener('click', function(event) {
event.preventDefault();
panelContainer.classList.toggle('hidden');
});
Can anyone point me into the right direction of what I'm doing wrong here?