GithubHelp home page GithubHelp logo

iftekeriba / viewport-slider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from daviferreira/viewport-slider

0.0 1.0 0.0 325 KB

ViewportSlider is a pure JavaScript implementation of Apple's product page showcase

Home Page: http://www.daviferreira.com/viewport-slider/index.html

JavaScript 86.42% CSS 8.07% HTML 5.51%

viewport-slider's Introduction

ViewportSlider

ViewportSlider is a pure JavaScript implementation of Apple's product page showcase (ie. http://www.apple.com/iphone-5c/).

Build Status

Basic usage

First, you need to attach ViewportSlider stylesheet to your page:

<link rel="stylesheet" href="css/viewport-slider.css">

The next step is to reference the slider script and initialize the ViewportSlider object:

<script src="js/viewport-slider.js"></script>
<script>viewportSlider.init(document.getElementById('container'), '.slide');</script>

The above code will transform all the elements with the .slide class into full viewport slides and add a navigation behavior to them (either by using the mousewheel/trackpad and keyboard or by clicking on the navigation bullets). The initialization receives two parameters: the root element for the slides and the slides' class name.

Touch Support

To enable swipe pagination, ViewportSlider uses the awesome Hammer Library. You need to reference it manually. The lib directory includes the latest version:

<script src="js/hammer.min.js"></script>
<script src="js/viewport-slider.js"></script>
<script>viewportSlider.init(document.getElementById('container'), '.slide');</script>

Development

ViewportSlider development tasks are managed by Grunt. To install all the necessary packages, just invoke:

npm install

These are the available grunt tasks:

  • js: runs jslint and jasmine tests and creates minified and concatenated versions of the script;
  • css: runs compass and csslint
  • test: runs jasmine tests, jslint and csslint
  • watch: watch for modifications on script/scss files

The source files are located inside the src directory. ViewportSlider stylesheet was created using sass/compass, make sure you have the compass gem installed on your system.

License

"THE BEER-WARE LICENSE" (Revision 42):

As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.

Bitdeli Badge

viewport-slider's People

Contributors

daviferreira avatar bitdeli-chef 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.