0.4.0 • Published 4 months ago

@geometricpanda/angular-tilt v0.4.0

Weekly downloads
-
License
-
Repository
github
Last release
4 months ago

Netlify Status npm version

Angular Tilt

An Angular port of Tilt.js.

Angular tilt is an easy way to apply parallax and depth micro-transitions to HTML elements.

Note: This does not require any jQuery.

Installation

Angular Tilt is available from npmjs.com

NPM

npm install @geometricpanda/angular-tilt --save

Yarn

yarn add @geometricpanda/angular-tilt

Getting Started

You'll need to add the NgTiltModule to the relevant parts of your application:

// Your NgModule

import {NgTiltModule} from '@geometricpanda/angular-tilt';

@NgModule({
  declarations: [...],
  imports: [NgTiltModule],
  exports: [...],
})

Usage

// Your Template

<div class="gradient" ngTilt>

  <div class="square" ngTiltParallax></div>

</div>

Directives

[ngTilt]

This is the main ngTilt directive which you apply to your order HTML element.

Inputs

NameTypeDefaultDescription
maxTiltnumber20The maximum number of degrees to tilt
perspectivenumber300Sets the perspective of the plane, lower numbers will appear to transition more
glarebooleanfalseApplies a glare to the tilted element
maxGlarenumber0.4Maximum amount of glare
easingstringcubic-bezier(.03,.98,.52,.99)CSS Easing effect on mouse enter / exit
scalenumber1CSS Scale transformation applied on mouseover, 1 = 100%, 2 = 200% ...
speednumber400Time taken in ms for reset transition
disableAxixx / yundefinedPrevent the tilt from applying to a specific axis
resetbooleantrueWhether the tilt should reset to 0 degrees when the mouse leaves the area

[ngTiltParallax]

This is a sub directive, which can be applied to children of the ngTilt directive. It will allow the child element to parallax (appear as if it's on a different plane) against the ngTilt element.

Inputs

NameTypeDefaultDescription
distancenumber50Configures distance in front of the parent plane

Recognitions

  • Thanks go to Gijs Roge, the original author of Tilt.js
0.4.0

4 months ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago