Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/wp-digital/wp-block-counter
- Owner: wp-digital
- Created: 2021-05-27T08:53:46.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-21T15:54:31.000Z (over 1 year ago)
- Last Synced: 2024-04-01T20:02:31.403Z (9 months ago)
- Topics: block, counter, gutenberg-blocks, wordpress-plugin
- Language: JavaScript
- Homepage: https://demo.wpd.digital/counter-block/
- Size: 1.31 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.