Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wp-digital/wp-block-counter

Number animation by user interaction. Columns with numbers which are start animation when user scrolls to block.
https://github.com/wp-digital/wp-block-counter

block counter gutenberg-blocks wordpress-plugin

Last synced: about 1 month ago
JSON representation

Number animation by user interaction. Columns with numbers which are start animation when user scrolls to block.

Awesome Lists containing this project

README

        

# Counter Block

### Description

Number animation by user interaction. Columns with numbers which are start animation
when user scrolls to block.

### Demo

[Counter Block](https://demo.wpd.digital/counter-block/)

### Install

- Preferable way is to use [Composer](https://getcomposer.org/):

````
composer require wp-digital/wp-block-counter
````

- Alternate way is to clone this repo to `wp-content/plugins/`:

````
cd wp-content/plugins/
git clone [email protected]:wp-digital/wp-block-counter.git
````

Activate **Counter Block** with [WP-CLI](https://make.wordpress.org/cli/handbook/)
`wp plugin activate wp-block-counter` or from **Plugins** page.

### Documentation

Add icons with hook `wpd.block.icons` for global icons and `wpd.block-counter.icons`
for specific block set. **Example**:

```
wp.hooks.addFilter( 'wpd.block.icons', 'my-theme', () => [
{
value: 'smiley', // Required. If only a value is specified, Dashicons will be used.
}, {
value: 'counter', // Custom icon.
icon: (






),
},
] );
```

There are more hooks in [constants](./src/constants/editor.js) which give a possibility to
customize behaviour a bit.

### Notes

[Counter-Up2](https://github.com/bfintal/Counter-Up2) library is using on frontend for
counting animation. To show and animate blocks on scroll
[Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)
is used and if you need to support [older browsers](https://caniuse.com/?search=Intersection%20Observer)
then add [polyfill](https://www.npmjs.com/package/intersection-observer) additionally.