-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start menu fluent effect style added
- Loading branch information
1 parent
72c7bfa
commit 0533256
Showing
23 changed files
with
316 additions
and
16 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2018 Phap Dieu Duong | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# 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 class="btn">Button 1</button> | ||
``` | ||
#### 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 | ||
<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 | ||
```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! | ||
|
||
<a href="https://www.paypal.me/d2phap" target="_blank" title="Buy me a beer?"> | ||
<img src="https://img.shields.io/badge/PayPal-Donate%20$10%20-009be1.svg?maxAge=3600" height="30" alt="Buy me a beer?"> | ||
</a> | ||
|
||
|
||
|
||
## 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) |
24 changes: 24 additions & 0 deletions
24
src/osdrive/Cheetah/System/Fluent Effect/fs-src/LICENSE.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/*! | ||
* MIT License | ||
* | ||
* Copyright (c) 2018 Phap Dieu Duong | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in all | ||
* copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
* | ||
*/ |
4 changes: 4 additions & 0 deletions
4
src/osdrive/Cheetah/System/Fluent Effect/fs-src/fluentRevealEffect.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { IUserEffectOptions } from './types'; | ||
export declare const applyElementEffect: (element: HTMLElement, userOptions?: IUserEffectOptions) => void; | ||
export declare const applyElementsEffect: (elements: NodeListOf<HTMLElement>, userOptions?: IUserEffectOptions) => void; | ||
export declare const applyEffect: (selector: string, userOptions?: IUserEffectOptions) => void; |
9 changes: 9 additions & 0 deletions
9
src/osdrive/Cheetah/System/Fluent Effect/fs-src/helpers/index.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { IResource, IIsPressed, IEffectOptions } from '../types'; | ||
export declare function enableBorderEffects(resource: IResource, childrenBorders: IResource[], options: IEffectOptions, isPressed: IIsPressed): void; | ||
export declare function enableNormalBackgroundEffetcs(resource: IResource, options: IEffectOptions, isPressed: IIsPressed): void; | ||
export declare function enableChildrenBackgroundEffetcs(resource: IResource, options: IEffectOptions, isPressed: IIsPressed): void; | ||
export declare function enableNormalClickEffects(resource: IResource, options: IEffectOptions, isPressed: IIsPressed): void; | ||
export declare function enableChildrenClickEffects(resource: IResource, options: IEffectOptions, isPressed: IIsPressed): void; | ||
export declare function preProcessElement(element: HTMLElement): IResource; | ||
export declare function preProcessElements(elements: NodeListOf<HTMLElement>): IResource[]; | ||
export declare function preProcessSelector(selector: string): IResource[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export * from './fluentRevealEffect'; | ||
export * from './types'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
src/osdrive/Cheetah/System/Fluent Effect/fs-src/types.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export interface IResource { | ||
oriBg: string; | ||
el: HTMLElement; | ||
} | ||
export type IIsPressed = [boolean]; | ||
export interface IArea { | ||
left: number; | ||
right: number; | ||
top: number; | ||
bottom: number; | ||
} | ||
export interface IEffectOptions { | ||
lightColor: string | 'rgba(255,255,255,0.1)'; | ||
gradientSize: number | 200; | ||
clickEffect: boolean | false; | ||
isContainer: boolean | false; | ||
children?: { | ||
borderSelector: string | '.eff-reveal-border'; | ||
elementSelector: string | '.eff-reveal'; | ||
lightColor: string | 'rgba(255,255,255,0.1)'; | ||
gradientSize: number | 200; | ||
}; | ||
} | ||
export type IUserEffectOptions = Partial<IEffectOptions>; | ||
export interface IEnableEffectFunc { | ||
(element: IResource, options: IEffectOptions, is_pressed: IIsPressed): void; | ||
} |
Oops, something went wrong.