2.0.1 • Published 1 year ago

moe-counter-busuanzi v2.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Moe-Counter-Busuanzi

Make your site moe moe 🪄!

A static version of Moe-Counter, so you don't need a server to deploy. Busuanzi is used to count page views.

Demo

npm.io

Check Moe-Counter to see more themes.

Visit here to see the live demo.

Installation

Recommended (npm):

npm install moe-counter-busuanzi

Usage

  • fetchBusuanziCounter: get the page view count
  • generateCounterImage: generate the counter image SVG string
<!-- Remember to add type="module" to the script tag -->
<script type="module">
import { generateCounterImage, fetchBusuanziCounter } from "moe-counter-busuanzi";
// Or import it from jsdelivr CDN:
// import { generateCounterImage, fetchBusuanziCounter } from 'https://cdn.jsdelivr.net/npm/moe-counter-busuanzi@2'

const busuanziResult = await fetchBusuanziCounter();
const counterSVGString = generateCounterImage(
  busuanziResult.page_pv,   // site_uv, page_pv, site_pv
  6,                        // The length of the counter
  true                      // use the default theme, moebooru
);
document.getElementById("counter")!.innerHTML = counterSVGString;
</script>

You can also import or customize themes. Check all themes under themes folder.

import { moebooruEcchiImages } from 'moe-counter-busuanzi/dist/themes/mbh.js'
const counterSVGString = generateCounterImage(
  busuanziResult.page_pv,
  6,
  false,                 // don't use the default theme
  moebooruEcchiImages    // custom theme
);

Credits

2.0.1

1 year ago

2.0.0

1 year ago

1.2.0

1 year ago

1.1.0

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago