npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-morph

v0.3.0

Published

This directive is an attempt at packaging necessary transitions and properties that enable the reuse of visual elements through morphing.

Downloads

4

Readme

ngMorph Build Status

Morphable Elements

This module is an attempt at packaging transitions/animations into directives that enable the reuse of elements by morphing them into other elements. The idea was inspired by Google's Topeka project and a great concept I saw on Codrops. Simply create an originating element and apply the ng-morph-<type> directive to make it morphable. Check out the demo page to see it in action!

ngMorph Demo

Demo

Available here. Demo source available here.

Getting Started

  1. Install with bower:
```sh
  bower install --save angular-morph
```
  1. Include the module in your project:

      angular.module('yourApp', ['ngMorph']);

Usage

Morphables require a settings object which you define in your controller. Settings for each morphable can be found in their respective usage example below.

###Modal###

  <button ng-morph-modal="settings"> Log In </button>
  app.controller('AppCtrl', function ($scope) {
    $scope.settings = {
      closeEl: '.close',
      modal: {
        templateUrl: 'path/to/view.html',
        position: {
         top: '30%',
         left: '20%'
        },
        fade: false
      }
    }
  });

Modal Settings

  • closeEl: A class/id selector that will close the modal when clicked.
  • modal: Required. The modal configuration object.
  • templateUrl: Required if template is not defined. The path to the view template.
  • template: Required if templateUrl is not defined. An HTML template string. If templateUrl is also defined, template will take priority.
  • position: Optional. The positioning of the end-state element. Can either be pixels or a percentage. If no unit is specified, the input will be treated as a percentage ("30" => "30%").
  • fade: Optional. Fade the background content when the modal is open. Default is true.

###Overlay###

  <div ng-morph-overlay="settings"> ... </div>
  app.controller('AppCtrl', function ($scope) {
    $scope.settings = {
      closeEl: '.close',
      overlay: {
        templateUrl: 'path/to/view.html',
        scroll: false
      }
    }
  });

Overlay Settings

  • closeEl: A class/id selector that will close the overlay when clicked.

  • overlay: Required. The overlay configuration object.

  • scroll: Optional. Disable scrolling when overlay is active. Default is true.

  • templateUrl: Required if template is not defined. The path to the view template.

  • template: Required if templateUrl is not defined. An HTML template string. If templateUrl is also defined, template will take priority.

###Expand (Coming Soon!)###

  <div ng-morph-expand="settings"> ... </div>
  app.controller('AppCtrl', function ($scope) {
    $scope.settings = {
      closeEl: '.close',
      expand: {
        templateUrl: 'path/to/view.html'
      }
    }
  });

###Views### In order for elements to morph into their end-state view properly, the contents that make up the view need to be wrapped in a single containing element. Here's an example of what a proper view looks like:

  <div class="col-md-12 login"> <!-- the containing element -->
  
    <!-- contents that make up the view start here -->
    <div class="row">
      <span class="glyphicon glyphicon-remove close-x pull-right"></span>
    </div>
    <div class="row">
      <form>
        <p><label>Email</label><input type="text" /></p>
        <p><label>Password</label><input type="password" /></p>
        <p><button>Login</button></p>
      </form>
    </div>
    
  </div> <!-- /end containing element -->

Contributing

What's Next

There is a lot of work to do before this is ready for an alpha release.. Following is a list of todos to get this repo in shape:

  • [X] Abstract functionality from the post-linking function of the morphable directive.
  • [X] ~~Refactor using ngAnimate and GSAP~~ (sticking with CSS transitions)
  • [X] Add support for nested morphables (morphables within view templates)
  • [ ] Add different transitions (modal, screen overlay, expand (left, right, down, up))
  • [ ] Add before/after animation hooks.. (or broadcast events?)
  • [ ] Validate input settings
  • [ ] Add error handling
  • [ ] Write tests
  • [ ] Write docs
  • [ ] convert these items into GH issues