Giter Site home page Giter Site logo

Animations about messenger HOT 13 OPEN

hubspot avatar hubspot commented on August 16, 2024
Animations

from messenger.

Comments (13)

Drewster727 avatar Drewster727 commented on August 16, 2024

@banya --> That link/issue you posted doesn't exist?

I also would love to see this plugin with animation capability. Is there any way we can just utilize css3 animations to get this done in the meantime?

Thanks,

-Drew

from messenger.

zackbloom avatar zackbloom commented on August 16, 2024

You absolutely can, CSS animations can do whatever wiggle or slide you can think of when the message element is added to the page.

Way back when there was a branch which added support for animate.css, a library that allows you to animate anything with the right css classes. I believe that the only change that has to be made for this to work is the ability to add extra classes to messages.

from messenger.

Drewster727 avatar Drewster727 commented on August 16, 2024

thanks for the reply:

so I'm using the following transition css:

ul.messenger li.messenger-message-slot {
opacity: 1;
-webkit-transition: opacity 2.5s ease-out, -webkit-transform 2.5s ease-out;
-moz-transition: opacity 2.5s ease-out, -moz-transform 2.5s ease-out;
-o-transition: opacity 2.5s ease-out, -o-transform 2.5s ease-out;
transition: opacity 2.5s ease-out, transform 2.5s ease-out;
}

How can I adapt that to work with messenger? The plugin seems to automatically display the messages and ignore the transition.

thanks!

from messenger.

zackbloom avatar zackbloom commented on August 16, 2024

That's a CSS transition. It could only really work if messenger rendered the message, forced a repaint, then applied a class you could transition to. This is not supported right now.

You can however use CSS animations, e.g. https://github.com/daneden/animate.css/blob/master/source/bouncing_entrances/bounceIn.css

from messenger.

seifsallam avatar seifsallam commented on August 16, 2024

@zackbloom That is awesome. Is there a way to do animation while dismissing too?

from messenger.

zackbloom avatar zackbloom commented on August 16, 2024

@seifsallam Yes, when we hide a message we apply the messenger-hidden class, so if you add an animation to that class, it will animate on hide.

from messenger.

seifsallam avatar seifsallam commented on August 16, 2024

@zackbloom I've tried adding animation there but no luck, it just disappears

from messenger.

zackbloom avatar zackbloom commented on August 16, 2024

Make sure you're overriding the built-in themes which make messenger-hidden actually hide the messages.

Something like

.messenger-hidden {
  display: block !important;
}

would be worth trying.

from messenger.

zackbloom avatar zackbloom commented on August 16, 2024

Truthfully though, none of this will work particularly well if there is more than one message shown at a time. @adamschwartz has some ideas about how we might add more robust support.

from messenger.

seifsallam avatar seifsallam commented on August 16, 2024

Not working either, but thanks

from messenger.

codecowboy avatar codecowboy commented on August 16, 2024

Did anyone get this working?

from messenger.

torrobinson avatar torrobinson commented on August 16, 2024

Even if unofficial, a third party plugin/addition that added subtle animations/fades would be awesome.

from messenger.

MithrilMan avatar MithrilMan commented on August 16, 2024

I've an Idea that worked for me, but it's a quirk code at the moment

in the messenger.js search for line
this.$message.addClass('messenger-will-hide-after');

and after that add this

////mia aggiunta
            if (this.options.hideAfter > 1) {
               this._hidingTimeout = setTimeout(function () {
                  _this.$message.addClass('messenger-hiding');
               }, (this.options.hideAfter * 1000) - 1000);
            }
////fine mia aggiunta

and search for
this.$message.removeClass('messenger-hidden');

and chang it to
this.$message.removeClass('messenger-hidden').removeClass('messenger-hiding');

shortly, if hideAfter > 1 second, then before 1 second it trigger my custom function and add the class
messenger-hiding

add that point, in your css you can do whatever effect you want to dismiss the dialog, knowing that you have 1 second to do that

of coure this solution suck because it's tailored on my needs of the moment, the right thing (very easy tbh) is to add another timer that trigger before _hidingTimeout

(_hidingTimeout could even be triggered inside this new timed function)

my css was this

 ul.messenger .messenger-message {
        overflow: hidden;
        *zoom: 1;
        opacity: 1;
        /* Firefox */
        -moz-transition-property: opacity;
        -moz-transition-duration: 0.5s;
        /* WebKit */
        -webkit-transition-property: opacity;
        -webkit-transition-duration: 0.5s;
        /* Opera */
        -o-transition-property: opacity;
        -o-transition-duration: 0.5s;
        /* Standard */
        transition-property: opacity;
        transition-duration: 0.5s;
    }

        ul.messenger .messenger-message.messenger-hiding {
            opacity: 0;
        }

if i find the time i could fork, change and pull-request

from messenger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.