Giter Site home page Giter Site logo

turn.js's Introduction

A fork of https://github.com/blasten/turn.js with support for npm/yarn.

Usage

JS

import $ from 'jquery';
import 'turn.js';

$('#magazine').turn({
  width: 800,
  height: 600,
  autoCenter: true
  // ... plus any extra option you need
});

HTML

<div id="magazine">
  <div><span class="text">Page 1</span></div>
  <div><span class="text">Page 2</span></div>
  <div><span class="text">Page 3</span></div>
</div>

CSS

#magazine{
  width: 800px;
  height: 400px;
}

#magazine .turn-page{
  background-color:#ccc;
}

For the full documentation on the library and all available options, please refer to https://github.com/blasten/turn.js.

Basically I just added a package.json file, specified a main entry point + a dependency (jquery) and fixed a couple of things to make turn.js installable via npm/yarn and loadable via Webpack in my React project.

I have submitted a PR to the authors of the original libray, but in the meantime you can use this one, as they don't seem to update their repo regularly.

Latest version uses jQuery 1.12.0 because jQuery 3.x was breaking the page flipper.

turn.js's People

Contributors

blasten avatar tridnguyen avatar iwege avatar

Stargazers

Aref Ben Lazrek avatar  avatar 大好时光 avatar malone hedges avatar

Watchers

Andrea Gherardi avatar 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.