I added a delay to the fade out here.
.fadingOut .isOpen {
animation: fadingOut 1s;
animation-delay: 8s;
}
While the fade out is delayed, how would I be able to have the curtains close?
https://jsfiddle.net/2h9xwoL4/
I found this where it is able to open and close. https://codepen.io/geoffgraham/pen/OXJMmY
Can this be used to have the curtains close?
function addCurtains(exitButtons) {
const container = exitButtons.closest(".container");
const curtains = container.querySelector(".sliding-panels");
curtains.classList.add(".curtain");
}
function exitClickHandler(evt) {
resetPage();
addCurtains(evt.currentTarget);
}
What would need to be added to the css?
Would I be adding some kind of reverse animation?
Instead of forwards, backwards?
I think I have the right idea, I just don’t know how to implement it.
.container.active .curtain .panel-left {
animation: curtain1 8s backwards 1s;
}
@keyframes curtain1 {
to {
transform: translateX(calc(-100% - 1px));
}
}
.container.active .curtain .panel-right {
animation: curtain2 8s backwards 1s;
}
@keyframes curtain2 {
to {
transform: translateX(calc(100% + 1px));
}
}
If I am able to make an animation appear after clicking on the playButtons,
Being the curtains opening.
I should be able to make an animation appear after clicking the exit button where I added a delay to it which would allow for the curtains to close.
Maybe it’s more complicated than I realize.
I think what I am trying to do should be able to work, but I don’t know how to put the pieces together.