Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/d2phap/fluent-reveal-effect

Fluent Reveal Effect JavaScript library for web
https://github.com/d2phap/fluent-reveal-effect

css-framework fluent-design fluent-design-system fluent-interface fluent-ui javascript javascript-plugin reveal-effect ui-components ui-kit

Last synced: 4 days ago
JSON representation

Fluent Reveal Effect JavaScript library for web

Lists

README

        

# Reveal Effect library (Fluent Design System)
Apply reveal effect to border and background of elements.

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fd2phap%2Ffluent-reveal-effect.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fd2phap%2Ffluent-reveal-effect?ref=badge_shield)

![Screenshot](https://github.com/d2phap/fluent-ui/raw/master/docs/screenshot.png)

### Demo
- https://imageglass.org/
- https://d2phap.github.io/fluent-reveal-effect/

## Install
Run the command
```
npm i fluent-reveal-effect@latest
```

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

## Usage

### Import the library
```js
import { applyEffect } from "fluent-reveal-effect"
```

### Basic CSS
```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
```html
Button 1
```
#### JavaScript
```js
applyEffect('.btn', {
lightColor: 'rgba(255,255,255,0.1)',
gradientSize: 150,
});
```

#### Enable Ripple click effect
````js
applyEffect('.btn', {
clickEffect: true,
});
````

### Apply border and background effect
#### HTML mockup
```html



Button 2


Button 3


Button 4


```

#### JavaScript
```js
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!


Buy me a beer?

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fd2phap%2Ffluent-reveal-effect.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fd2phap%2Ffluent-reveal-effect?ref=badge_large)