bigskysoftware / idiomorph

A DOM-merging algorithm
BSD 2-Clause "Simplified" License
693 stars 33 forks source link

animating items added after morph #44

Closed svefro closed 6 months ago

svefro commented 6 months ago

is it possible to hook in to the events when using this with htmx?

I would like to add a class to items that are appended to the dom after merge.

the class will trigger a animation that shows witch element was added to the user.

     .added item{
        animation: 0.5s ease-out 0s 1 scaleIn forwards;
    }

    @keyframes scaleIn {
        0% {
            opacity: 0;
            transform: scale(0.5);
        }
        90% {
            opacity: 1;
            transform: scale(1.1);
        }
        100% {
            transform: scale(1);
        }
    }