Giter Site home page Giter Site logo

angular-stellar's Introduction

angular-stellar

Gem Version Bower version NPM version Build Status Coverage Status Code Climate Dependency Status

Rewrite of Stellar.js native AngularJS directives without jQuery dependency

Project philosophy

Develop in LiveScript

LiveScript is a compile-to-js language, which provides us more robust way to write JavaScript.
It also has great readibility and lots of syntax sugar just like you're writting python/ruby.

Native, lightweight directives

Stellar.js provides the same interface with angular directives.
We use the similarity between them and provides seamless intergration with Stellar.js.

Installation

This project follows DRY principle and has two dependencies, which are angularjs and ui.bootstrap.position.

Just use it

Then include them through script tag in your HTML.

Rails projects (Only support 3.1+)

Add this line to your application's Gemfile:

gem 'angular-stellar'

And then execute:

$ bundle

If you are NOT using angular-ui/bootstrap, you have to download position.js and put it in vendor/assets/javascripts/

Then add these lines to the top of your app/assets/javascripts/application.js file:

//= require angular
//= require ui-bootstrap-tpls
(`//= require position` instead if you aren't using boostrap)
//= require angular-stellar

And include in your angular module definition:

/* 'angular.stellar' DO depend on 'ui.bootstrap.position' module.
 */    
var module = angular.module('my-awesome-project', [/* 'bootstrap', */ 'angular.stellar']).

Usage

"stellar-ratio": Make the element has parallax effect on front

"stellar-background-ratio": Make the element has parallax effect on background

"stellarConfig": constant for configuration

scrollProperty

default to: 'scroll'

Available options are 'position', 'margin', 'transform', or you can define it yourself.

positionProperty

default to: 'position'

Available options are 'transform', or you can define it yourself.

horizontalScrolling

default to: true

Whether or not to enable scrolling in horizontal, only apply to stellar-ratio elements.

verticalScrolling

default to: true

Whether or not to enable scrolling in vertical, only apply to stellar-ratio elements.

horizontalOffset

default to: 0

Global offset added to each element.

verticalOffset

default to: 0

Global offset added to each element.

hideDistantElements

default to: true

When stellar-ratio elements are scrolled outside of visible area, hide them.

hideElement

default to: function(it){ it.addClass('ng-hide'); }

You can have your implementation on your own.

showElement

default to: function(it){ it.removeClass('ng-hide'); }

You can have your implementation on your own.

isElementHidden

default to: function(it){ return it.hasClass('ng-hide'); }

You can have your implementation on your own.

Contributing

devDependency Status

  1. Fork it ( http://github.com/tomchentw/angular-stellar/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

angular-stellar's People

Contributors

tomchentw avatar

Stargazers

Thomas D'Ascoli avatar

Watchers

James Cloos avatar

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.