3.0.11 • Published 2 years ago

fluent-reveal-effect v3.0.11

Weekly downloads
12
License
MIT
Repository
-
Last release
2 years ago

Reveal Effect library (Fluent Design System)

Apply reveal effect to border and background of elements.

FOSSA Status

Screenshot

Demo

Install

Run the command

npm i fluent-reveal-effect@latest

NPM package: https://www.npmjs.com/package/fluent-reveal-effect

Usage

Import the library

import { applyEffect } from "fluent-reveal-effect"

Basic CSS

.btn {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  padding: 1rem 2rem;
  background-color: #333;
  color: #fff;
  border: 0;

  transition: all 200ms ease;
}
.btn-border {
  display: inline-block;
  margin: 5px;
}
.btn-border .btn {
  display: block;
  margin: 2px;
}

Apply background effect

HTML mockup

<button class="btn">Button 1</button>

JavaScript

applyEffect('.btn', {
  lightColor: 'rgba(255,255,255,0.1)',
  gradientSize: 150,
});

Enable Ripple click effect

applyEffect('.btn', {
  clickEffect: true,
});

Apply border and background effect

HTML mockup

<div class="effect-group-container">
  <div class="btn-border">
    <button class="btn">Button 2</button>
  </div>
  <div class="btn-border">
    <button class="btn">Button 3</button>
  </div>
  <div class="btn-border">
    <button class="btn">Button 4</button>
  </div>
</div>

JavaScript

applyEffect('.effect-group-container', {
  clickEffect: true,
  lightColor: 'rgba(255,255,255,0.6)',
  gradientSize: 80,
  isContainer: true,
  children: {
    borderSelector: '.btn-border',
    elementSelector: '.btn',
    lightColor: 'rgba(255,255,255,0.3)',
    gradientSize: 150
  }
})

Donate

If you feel this little library useful to you, it would go a great way to ensuring that I can afford to take the time to continue to develop it.

Thanks for your gratitude and finance help!

License

FOSSA Status

3.0.9

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.11

2 years ago

3.0.1

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.0

2 years ago

1.2.0

4 years ago

2.0.3

4 years ago

2.0.2

4 years ago

2.0.5

4 years ago

2.0.4

4 years ago

2.0.7

4 years ago

2.0.6

4 years ago

2.0.8

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

7 years ago

0.10.2

7 years ago

0.10.1

7 years ago

0.10.0

7 years ago

0.9.2

7 years ago

0.9.1

7 years ago

0.9.0

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago