magic-hover

1.0.5 • Public • Published

Magic Hover (React Component)

Transform (perspective/tilt/rotate) effect for nested react components.

  • DEMO - See two examples

Getting Started

First!

npm i magic-hover --save

How to Use

follow the example!

import MagicHover from "magic-hover";
import styles from "./style.css";

const options = {
  max: 40,
  reverse: true,
  perspective: 1000,
  scale: { x: 1, y: 1, z: 1 },
  rotate: 0,
  translate: { x: 0, y: 0 }
};
const App = () => (
  <div className="App">
    <MagicHover options={options} className={"simple-box"}>
    SIMPLE!
    </MagicHover>
  </div>
);
render(<App />, document.getElementById("root"));

Create your style.css file.

.simple-box {
    align-items: stretch;
    background: #004661;
    height: 228px;
    width: 254px;
    border-radius: 5px;
    position: relative;
    color: #fff;
    box-shadow: -2px 2px 2px rgba(0, 0, 0, 0.11);
    text-align: center;
    padding: 100px 0 0 0;
    margin-top: 27px;
}

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Package Sidebar

Install

npm i magic-hover

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

1.59 MB

Total Files

6

Last publish

Collaborators

  • shomalgan