aesthetically v0.0.6
Table of Contents
Demo
Check out the demo.
Installation
Using jsDelivr:
As an ES6 module:
<script type="module">
import Aesthetically from "https://cdn.jsdelivr.net/npm/aesthetically@0/dist/aesthetically.js";
</script>
As a normal script:
<script src="https://cdn.jsdelivr.net/npm/aesthetically@0/dist/aesthetically.umd.js"></script>
Self-hosted:
As an ES6 module:
<script type="module">
import Aesthetically from "/aesthetically.js";
</script>
As a normal script:
<script src="/aesthetically.umd.js"></script>
Using npm:
$ npm i aesthetically
In Node:
As an ES6 module:
import Aesthetically from "aesthetically";
As a CommonJS module:
const Aesthetically = require("aesthetically");
Usage
Getting a list of styles
If your looking for a list of styles, take a look at the table below
styles = Object.keys(Aesthetically.styles);
Styling test
Aesthetically.format("this is v cool", "double-struck");
// "this is v cool"
Arguments
text: (String) text to transform
style: (String) Style to transform text to
Returns
(String) formatted text
Un-styling text
Aesthetically.unformat("๐น๐ช๐ฌ๐ถ๐ช๐ท ๐ฒ๐ผ ๐ฑ๐พ๐ท๐ฐ๐ป๐ ๐พ๐");
// "pacman is hungry ๐พ๐"
Arguments
text: (String) text to transform
Returns
(String) unstyled text
Table of styles and support
Not all styles support all types of characters. Some only support lowercase or uppercase. Digits indicate support for 1 - 9 while zero is listed sperately if supported.
Mathematical Alphanumeric Symbols
Style | Support | Sample |
---|---|---|
serf-bold | upper, lower, digits, zero | ๐ฌ๐ฉ๐ก๐ข๐ง๐ฑ ๐จ๐ ๐๐ฅ๐๐๐ค ๐ช๐ฎ๐๐ซ๐ญ๐ณ, ๐ฃ๐ฎ๐๐ ๐ ๐ฆ๐ฒ ๐ฏ๐จ๐ฐ |
serf-italic | upper, lower | ๐ ๐โ๐๐๐ฅ ๐๐ ๐๐๐๐๐ ๐๐ข๐๐๐ก๐ง, ๐๐ข๐๐๐ ๐๐ฆ ๐ฃ๐๐ค |
serf-bold-italic | upper, lower | ๐๐๐๐๐๐ ๐๐ ๐๐๐๐๐ ๐๐๐๐๐๐, ๐๐๐ ๐๐ ๐๐ ๐๐๐ |
sans-serf | upper, lower, digits, zero | ๐๐๐๐๐๐ ๐๐ฟ ๐ป๐ ๐บ๐ผ๐ ๐๐๐บ๐๐๐, ๐๐๐ฝ๐๐พ ๐๐ ๐๐๐ |
sans-serf-bold | upper, lower, digits, zero | ๐๐ฝ๐ต๐ถ๐ป๐ ๐ผ๐ณ ๐ฏ๐น๐ฎ๐ฐ๐ธ ๐พ๐๐ฎ๐ฟ๐๐, ๐ท๐๐ฑ๐ด๐ฒ ๐บ๐ ๐๐ผ๐ |
sans-serf-italic | upper, lower | ๐ด๐ฑ๐ฉ๐ช๐ฏ๐น ๐ฐ๐ง ๐ฃ๐ญ๐ข๐ค๐ฌ ๐ฒ๐ถ๐ข๐ณ๐ต๐ป, ๐ซ๐ถ๐ฅ๐จ๐ฆ ๐ฎ๐บ ๐ท๐ฐ๐ธ |
sans-serf-bold-italic | upper, lower | ๐จ๐ฅ๐๐๐ฃ๐ญ ๐ค๐ ๐๐ก๐๐๐ ๐ฆ๐ช๐๐ง๐ฉ๐ฏ, ๐๐ช๐๐๐ ๐ข๐ฎ ๐ซ๐ค๐ฌ |
script | upper, lower | ๐๐ ๐ฝ๐พ๐๐ โด๐ป ๐ท๐๐ถ๐ธ๐ ๐๐๐ถ๐๐๐, ๐ฟ๐๐นโโฏ ๐๐ ๐โด๐ |
script-bold | upper, lower | ๐ผ๐น๐ฑ๐ฒ๐ท๐ ๐ธ๐ฏ ๐ซ๐ต๐ช๐ฌ๐ด ๐บ๐พ๐ช๐ป๐ฝ๐, ๐ณ๐พ๐ญ๐ฐ๐ฎ ๐ถ๐ ๐ฟ๐ธ๐ |
fraktur | upper, lower | ๐ฐ๐ญ๐ฅ๐ฆ๐ซ๐ต ๐ฌ๐ฃ ๐๐ฉ๐๐ ๐จ ๐ฎ๐ฒ๐๐ฏ๐ฑ๐ท, ๐ง๐ฒ๐ก๐ค๐ข ๐ช๐ถ ๐ณ๐ฌ๐ด |
fraktur-bold | upper, lower | ๐๐๐๐๐๐ ๐๐ ๐๐๐๐๐ ๐๐๐๐๐๐, ๐๐๐๐๐ ๐๐ ๐๐๐ |
monospace | upper, lower, digits, zero | ๐๐๐๐๐๐ก ๐๐ ๐๐๐๐๐ ๐๐๐๐๐๐ฃ, ๐๐๐๐๐ ๐๐ข ๐๐๐ |
double-struck | upper, lower, digits, zero | ๐ค๐ก๐๐๐๐ฉ ๐ ๐ ๐๐๐๐๐ ๐ข๐ฆ๐๐ฃ๐ฅ๐ซ, ๐๐ฆ๐๐๐ ๐๐ช ๐ง๐ ๐จ |
Enclosed Alphanumerics & Supplement
Style | Support | Sample |
---|---|---|
circled | upper, lower, digits, zero | โขโโโโโง โโ โโโโโ โ โคโโกโฃโฉ, โโคโโโ โโจ โฅโโฆ |
negative-circled | upper, zero | ๐ ข๐ ๐ ๐ ๐ ๐ ง ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ค๐ ๐ ก๐ ฃ๐ ฉ, ๐ ๐ ค๐ ๐ ๐ ๐ ๐ จ ๐ ฅ๐ ๐ ฆ |
parenthesized-small | lower, digits | โฎโซโฃโคโฉโณ โชโก โโงโโโฆ โฌโฐโโญโฏโต, โฅโฐโโขโ โจโด โฑโชโฒ |
parenthesized-large | upper | ๐ข๐๐๐๐๐ง ๐๐ ๐๐๐๐๐ ๐ ๐ค๐๐ก๐ฃ๐ฉ, ๐๐ค๐๐๐ ๐๐จ ๐ฅ๐๐ฆ |
squared | upper | ๐ ๐ฟ๐ท๐ธ๐ฝ๐ ๐พ๐ต ๐ฑ๐ป๐ฐ๐ฒ๐บ ๐ ๐ ๐ฐ๐ ๐ ๐ , ๐น๐ ๐ณ๐ถ๐ด ๐ผ๐ ๐ ๐พ๐ |
negative-squared | upper | ๐๐ ฟ๐ ท๐ ธ๐ ฝ๐ ๐ พ๐ ต ๐ ฑ๐ ป๐ ฐ๐ ฒ๐ บ ๐๐๐ ฐ๐๐๐, ๐ น๐๐ ณ๐ ถ๐ ด ๐ ผ๐ ๐ ๐ พ๐ |
Acknowledgements
This article and this other article were really useful for understanding the way Unicode strings work in JavaScript. The demo uses the awesome Bulma CSS framework <3.
License
MIT License
Copyright (c) 2020 Joshy Nosh
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.