This file contains hidden or 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
| // @ts-check | |
| // gist: https://gist.github.com/nickyonge/1988b42e7a30b5019c47125a0009bd81 | |
| // current major issue is that color replcaement doesn't work, see RecolorImage func | |
| import { | |
| clampGamut, | |
| converter, | |
| differenceCiede2000 |
This file contains hidden or 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
| /** DECAP CHAR WIDGET | |
| * | |
| * A custom Decap widget like "string", that only allows a single character | |
| * | |
| * INSTALLATION | |
| * | |
| * 1.) Drop/load this script the directory with Decap's index.html, and add: | |
| <script src="decapServerWarning.js"></script> |
This file contains hidden or 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
| /** TEXT FITTER | |
| * | |
| * A script that automatically matches an element's text | |
| * to perfectly fill the inline width of its containing element. | |
| * | |
| * (At least, perfectly to the glyph level. If a glyph has a lot | |
| * of leading or trailing space, that space will still be respected) | |
| * | |
| * Presented as-is under The Unlicense, see below for license info. | |
| */ |
This file contains hidden or 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
| /** INPUT HANDLER | |
| * | |
| * A script that Input handler that unifies element input states | |
| * (hover, active, focus, etc) into callbacks and attributes. | |
| * Built with 100% vanilla JS | |
| * | |
| * Presented as-is under The Unlicense, see below for license info. | |
| */ | |
| // @ts-check |
This file contains hidden or 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
| REGEX TO REPLACE ALL hyphen-split-text with camelCaseText (eg CSS to JS) | |
| find: | |
| -([a-z]) | |
| replace: | |
| \u$1 | |
| REGEX TO REPLACE ALL camelCaseText with hyphen-split-text with (eg JS to CSS) | |
| find WITH [Aa] case-sensitivity enabled: | |
| ([a-z0-9])([A-Z]) | |
| replace: |
OlderNewer