Skip to content

arthursb2016/logo-loader

Repository files navigation

logo-loader

Web component to seamlessly create a loader from your logo image or icon

Installation

CDN / Script tag

<head>
  <script type="module" src="https://cdn.jsdelivr.net/npm/logo-loader@0.1.3/dist/logoLoader.esm.min.js"></script>
</head>

or

NPM

npm i logo-loader

then

// main.js|ts
import 'logo-loader'

Demo

Default:

Logo Loader Demo - Default Mode

Pulse mode:

Logo Loader Demo - Pulse Mode

Usage

<body>
  <logo-loader src="my-logo.png"></logo-loader>
</body>

or pass the image/icon as a slot:

<body>
  <logo-loader>
    <img src="my-logo.svg">
  </logo-loader>
</body>

Attributes

mode

Defines the animation style ("default" or "pulse")

<logo-loader src="..." mode="pulse"></logo-loader>

pause

Pauses the animation:

<logo-loader src="..." pause></logo-loader>

or

<logo-loader src="..." pause="true"></logo-loader>

width & height (works only when using the src attribute)

Sets the logo size:

<logo-loader src="..." width="150" height="150"></logo-loader>

or

<logo-loader src="..." width="5rem" height="5rem"></logo-loader>

Note

  1. You must apply the component in a single colored background in order for it correctly animate
  2. You might find some distortions if the parent background has an alpha channel (e.g. rgba(x, x, x, 0.3))

About

Web component to seamlessly create a loader from your logo image or icon

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors