GithubHelp home page GithubHelp logo

el-transition's People

Contributors

iamyujinwon avatar mkdynamic avatar mmccall10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

el-transition's Issues

Leave not working

Thanks for this great library, it's fixed an issue I've had with pretty much every other stimulus based transition, where the animate out works but the animate in does not. Using this library, I can animate in, but the animate out does not work.

I've tried variations of the below (I've left comments in there with experiments I've tried):

import { Controller } from '@hotwired/stimulus'
import { enter, leave } from 'el-transition'

export default class extends Controller {
  static targets = ['navbar', 'sidebar', 'background', 'panel', 'overlay']

  toggleSidebar() {
    if (this.sidebarTarget.classList.contains('hidden')) {
      // enter(this.sidebarTarget)
      this.sidebarTarget.classList.remove('hidden')
      enter(this.backgroundTarget)
      enter(this.panelTarget)
      enter(this.overlayTarget)
    } else {
      leave(this.backgroundTarget)
      leave(this.panelTarget)
      leave(this.overlayTarget)
      leave(this.sidebarTarget)
      //.then(() => {
      //   this.sidebarTarget.classList.add('hidden')
      // })
      // this.sidebarTarget.classList.add('hidden')
    }
  }
}

The markup is as follows:

<div data-app-target="sidebar">
  <div data-app-target="background"></div>
  <div data-app-target="overlay">
    <div data-app-target="panel"></div>
  </div>
</div>

Each of those elements has a full set of the data-transition-leave, data-transition-leave-from, and data-transition-leave-to attributes.

This library's future

This library stands to serve an important role for applications seeking to support transition effects without taking a cumbersome dependency on something like Alpine.js. But a visitor to this repository must wonder if the library has a future? It looks like PRs are piling up and it's not clear if there is any intention of maintaining this library. Can you please help set the appropriate expectation by advising as to whether this project will receive attention going forward?

@types/el-transition

without types library i need to do this in typescript projects

image

it's not a really big problem but would be nice have a types lib

Awesome!

This is awesomely simple and addresses the problem in an elegant way. Thanks for putting it together!

Is project alive?

This library is an excellent lightweight alternative to Alpine.js and similar, but we worry about adopting something that's not actively maintained. I see there have been 2 open pull requests for some time. Is this the end of the line for el-transition?

passing in transition classes via an options object?

Is it a crazy idea to be able to pass in an options object in javascript to specify the transitions needed?

Perhaps I misread the API?

Reason?

To obviate the need to repeatedly specify transition classes in html.

Proposal:

<div id="menu"     data-enter-from="we have to decorate with classes every time."  />
<div id="menu1"   data-enter-from="we have to specify it again"  />
<div id="menu2"   data-enter-from="and again"  />
enter(element,  {enterActive: 'but we can specify all the classes we need',
                 enterFrom: 'via an options object which we pass in '}
        ).then(() => 
        {console.log("there's no need to repeatedly decorate html elements if we don't want to.") })

Bad idea?

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.