Coder Social home page Coder Social logo

kittyinu / react-tilt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jonathandion/react-tilt

0.0 0.0 0.0 1.59 MB

๐Ÿ‘“ Parallax tilt hover effect for React JS - tilt.js

Home Page: https://www.npmjs.com/package/react-tilt

JavaScript 76.48% CSS 7.84% HTML 15.69%

react-tilt's Introduction

React.js - Tilt.js

Travis CI

react-tilt demo gif

React version of tilt.js

Demo

https://vx-demo.now.sh/gallery

Install

  • yarn: yarn add react-tilt
  • npm: npm install --save react-tilt

Usage

import Tilt from 'react-tilt'

<Tilt className="Tilt" options={{ max : 25 }} style={{ height: 250, width: 250 }} >
 <div className="Tilt-inner"> ๐Ÿ‘ฝ </div>
</Tilt>

Options

{
	reverse:        false,  // reverse the tilt direction
	max:            35,     // max tilt rotation (degrees)
	perspective:    1000,   // Transform perspective, the lower the more extreme the tilt gets.
	scale:          1.1,      // 2 = 200%, 1.5 = 150%, etc..
	speed:          1000,    // Speed of the enter/exit transition
	transition:     true,   // Set a transition on enter/exit.
	axis:           null,   // What axis should be disabled. Can be X or Y.
	reset:          true    // If the tilt effect has to be reset on exit.
	easing:         "cubic-bezier(.03,.98,.52,.99)",    // Easing on enter/exit.
}

API

Property Signature
onMouseEnter () -> SyntheticEvent
onMouseMove () -> SyntheticEvent
onMouseLeave () -> SyntheticEvent
options Object

Roadmap

  • Tests
  • Add Flare effect

Alternatives

react-tilt's People

Contributors

jonathandion avatar philippehenoch avatar breadadams avatar bkyoung avatar natew 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.