Skip to content

MathiasWP/fancylog.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

fancylog - make your console.log(fancy) πŸ¦„

Demo:

Click here for demo

Β 

Install:

With NPM πŸ“¦:

npm install fancylog

With CDN 🌐:

<script src="https://cdn.jsdelivr.net/npm/fancylogjs@1.0.0"></script>

Locally πŸ“:

<script src="path/to/fancylogjs.js"></script>

Β 

API:

fancylog(<string>, <object>)

<string> info:

To divide the string parts for styling, simply declare them with <></> tags. To set the id of the tag, write #{id} within the first tag.

To add images, simply write <img src="src-to-image" />. You can also add id's to images, simply add a #{id} anywhere within the img-tag

<object> info:

The object sets the styling of the declared tags within the string. Use CSS in JS to declare properties and values.

Example:

fancylog('<#id1>Hello, i'm blue dabedeedabeda!</> I have no styling, <#id2>but i am underlined!</> <img src="/myimage.png" #image/>',
    {
        id1: {
            color: 'blue',
            fontWeight: 'bold',
            fontSize: '2rem'
        },
        id2: { textDecoration: 'underline' },
        image: {
            width: '300px',
            height: '200px'
        }
    });

Β 

Not supported:
  • Nested tags

Releases

No releases published

Packages

No packages published