Giter Site home page Giter Site logo

angular-panorama's Introduction

Angular Panorama

An AngularJS panorama implementation optimised for mobile devices, supporting width setting for each page.

I may add a demo here later...

Comments and contributions welcome :)

How to use :

  1. Add Angular Panorama to your project by:

    bower install angular-panorama --save	
    
  2. Add angular-panorama.css and angular-panorama.js (from this repo) to your code. Also don't forget to include the dependencies angular and angular-touch before them.

  3. Add a dependency to the angular-panorama module in your application.

    angular.module('myApp', ['angular-panorama']);
    
  4. Add a model (e.g. pages here) including width values if you need. The width values must be integers, representing percentages. For example, if you want a page to be 80% width of the viewport, just set the width to 80. If you don't set the width, it will be 100% by default.

  5. Add a div with ng-panorama attribute to your html and wrap a <ul> inside. Every <li> child of this <ul> will become a swipable page with specified width.

Example 1 :

<div ng-panorama="pages" ng-panorama-index="index" ng-panorama-reset="reset"
     ng-panorama-background-image="backgroundImageUrl">
	<ul>
		<li ng-repeat="page in pages" style="width: {{page.width}}%;" ng-cloak>
	</ul>
</div>

Example 2 :

You can also use ng-panorama without ng-repeat, or even a mix.

<script>
// in your controller code
	$scope.pages = [
		{width: 80},
		{width: 80},
		{width: 80},
		{width: 80}
	];
	
</script>
<div ng-panorama="pages" ng-panorama-index="index" ng-panorama-reset="reset"
     ng-panorama-background-image="backgroundImageUrl">
	<ul>
		<li style="width: 80%;">
		<li style="width: 80%;">
		<li style="width: 80%;">
		<li style="width: 80%;">
	</ul>
</div>

Attributes :

  • ng-panorama-index adds two-way binding to control the panorama position.
  • ng-panorama-background-image adds background image.
  • ng-panorama-reset reset the panorama to index=0 skipping animation.

Features :

  • Mobile friendly, tested on Chrome + Android WebView(<4.4)
  • Super flexible. Completely rewrited in the {{ angular way }}.
  • CSS 3D transformations with GPU accel

Inspiration :

License :

Angular Panorama is created by Tong Shen from FotoDish, and is distributed under the MIT license .

angular-panorama's People

Contributors

0x-r4bbit avatar cnjsstong avatar jeffbcross avatar jonlil avatar outofculture avatar revolunet avatar tuikiken avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

vrdate

angular-panorama's Issues

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.