1.2.2 • Published 10 months ago

favorite-icon-badge v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

📛 Favorite Icon Badge

NPM version NPM downloads

Small library for badge manipulating with desktop favicon.

Desktop browser support

  • Chrome: ✅
  • Edge: ✅
  • Firefox: ✅
  • Opera: ✅
  • IE: ❌
  • Safari: ❌ (Safari hides favicons)

Installation

npm install favorite-icon-badge

Demo

Using

import { FaviconBadge } from 'favorite-icon-badge';

const badge = new FaviconBadge();

badge.set(count);

Advanced settings

import { FaviconBadge } from 'favorite-icon-badge';

const badge = new FaviconBadge({
    backgroundColor: '#ff0000',
    fontFamily: 'arial, sans-serif',
    fontStyle: 'normal',
    strokeColor: '#000',
    textColor: '#fff',
    faviconSrc: '/my-icon.png',
    maxCount: 99,
    size: Favicon.size,
    links: Favicon.icons,
    positionX: 'right',
    positionY: 'bottom'
});

badge.set(count);

API

.set(count: number)

Set the favicon with the badge.

import { FaviconBadge } from 'favorite-icon-badge';

const badge = new FaviconBadge();

badge.set(count);

.reset()

Reset the favicon.

import { FaviconBadge } from 'favorite-icon-badge';

const badge = new FaviconBadge();

// ...

badge.reset();

License

MIT License

1.2.0

11 months ago

1.1.0

11 months ago

1.0.0

11 months ago

1.2.2

10 months ago

1.2.1

10 months ago

0.5.0

11 months ago

0.3.0

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.2.0

5 years ago