Skip to content

Latest commit

 

History

History
46 lines (34 loc) · 1.65 KB

File metadata and controls

46 lines (34 loc) · 1.65 KB

NPM Downloads

@lasbe/react-card-animation

react_card_animation

손쉽게 카드 뷰 컨테이너에 3D 인터랙션 애니메이션을 적용할 수 있는 리액트 패키지입니다.

install

$ npm i @lasbe/react-card-animation

example

import { CardAnimation } from '@lasbe/react-card-animation';

export default function App() {
  return (
    <div>
      <CardAnimation>
        <div className={`w-[300px] h-[200px]`}>...</div>
      </CardAnimation>
      <CardAnimation angle={10} mouseOutDelay={0}>
        <div className={`w-[300px] h-[200px]`}>...</div>
      </CardAnimation>
    </div>
  );
}

적용할 컨테이너 바깥에 CardAnimation을 감아줍니다.

Props

Name Value Default Value description
children React.ReactElement - 애니메이션을 적용할 자식 컴포넌트
angle number 30 애니메이션 회전 각도, 클 수록 더 많이 회전함
mouseOutDelay number 500 마우스를 벗어날 때 원상복구 되기까지의 딜레이 시간 (ms)