Skip to content
프로젝트

d2phap/fluent-reveal-effect

GitHub에서 보기

소개

Fluent Reveal Effect JavaScript library for web

웹 및 앱 개발

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
+1
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Reveal Effect library (Fluent Design System)

Apply reveal effect to border and background of elements.

NPM Downloads

image

Demo

See the Demo project for detail or visit

Install

Run the command

npm i fluent-reveal-effect@latest

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

Usage

Base 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;
}

1. Apply background effect

HTML

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

JavaScript

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

// Enable reveal background effect
applyEffect('.btn', {
  lightColor: 'rgba(255,255,255,0.1)',
  gradientSize: 150,
});

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

2. Apply border and background effect

HTML

<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

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

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

관련 프로젝트 살펴보기

불러오는 중…