# Neptune Animations

## Install

### Using NPM

To install Neptune Animations as a [NPM package](https://www.npmjs.com/package/neptunecss-animations), run the following commands:

```bash
npm i neptunecss-animations
```

Now import Neptune Animations.

#### yourOwn.css

```css
@import url('/path/to/your/neptune-animations.min.css');
```

#### yourOwn.js

```javascript
import NeptuneAnimate from "/path/to/your/neptune-animations.min.js"
```

### Using CDN&#x20;

To use Neptune Animations with CDN Link, put this line of code in your header:

```css
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/neptunecss-animations@latest/neptune-animations.min.css">
```

Put this one at the end of the body.

```markup
<script src="https://cdn.jsdelivr.net/npm/neptunecss-animations@latest/neptune-animations.min.js"></script>
```

#### Example

```html
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">

		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/neptunecss@latest/neptune.min.css">
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/neptunecss-animations@latest/neptune-animations.min.css">

		<title>Neptune Animations Example Page</title>
	</head>
	<body>
		<!-- Your Content -->

		<script src="https://cdn.jsdelivr.net/npm/neptunecss-js@latest/neptune.min.js"></script>
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/neptunecss-animations@latest/neptune-animations.min.js">
	</body>
</html>
```

## Usage

### Customization

You can customize the following variables in CSS:

```css
--nep-animation-duration: .5s; /* Deafault is 1s */
--nep-animation-delay: .5s; /* Default is 0s */
--nep-animation-direction: linear; /* Default is null */
--nep-animation-fillmode: infinite; /* Default is forwards */
```

### Setup Animation

```javascript
const myElement = document.getElementById("yourElement");
const neptuneAnimate = new NeptuneAnimate(myElement, "nep-pulse");

neptuneAnimate.startAnimation();
```

### Animation Classes

<details>

<summary>Fading Animations</summary>

#### Fading In

* `nep-fade-in`
* `nep-fade-in-down`
* `nep-fade-in-right`
* `nep-fade-in-up`
* `nep-fade-in-left`

#### Fading Out

* `nep-fade-out`
* `nep-fade-out-down`
* `nep-fade-out-right`
* `nep-fade-out-up`
* `nep-fade-out-left`

</details>

<details>

<summary>Scaling Animations</summary>

* `nep-scale-up`
* `nep-scale-down`

</details>

<details>

<summary>Rotation Animations</summary>

#### Right

* `nep-rotate-right`
* `nep-rotate-right-in`
* `nep-rotate-left-out`

#### Left

* `nep-rotate-left`
* `nep-rotate-left-in`
* `nep-rotate-left-out`

</details>

<details>

<summary>3D Animations</summary>

* `nep-flip-x`
* `nep-flip-y`

</details>

<details>

<summary>Some Other Animations</summary>

* `nep-pulse`
* `nep-shake-x`
* `nep-shake-y`
* `nep-jelly`

</details>

## Examples

You can test the Neptune Animations in the [Animations Showcase](https://colingrahm.net/NeptuneAnimations).

<figure><img src="https://2502773477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEkbtaLvopJ2OS43tkkqT%2Fuploads%2F27xMMBAXoihkiJblZaXx%2Fneptune_showcase.png?alt=media&#x26;token=a9456669-1b8e-407f-9cab-b1a2ce70c544" alt=""><figcaption><p>Neptune Showcase</p></figcaption></figure>
