📜 ⬆️ ⬇️

Piecon - dynamic pie chart in favicon


A tiny (2 kilobytes in minifitsirovanny form) Piecon JavaScript library generates a pie chart in place of the favicon. The API is extremely simple and consists of three methods of the Piecon object.

The reset() method has no arguments and simply resets the counter, setProgress() takes one argument — the percentage of fullness of the pie chart, and setOptions() requires an object with basic favicon settings:

 Piecon.setOptions({ color: '#ff0084', //   background: '#bbb', //    shadow: '#fff', //   fallback: false //     (  - true, false, 'force') }); 


Browser compatibility:

')
In IE and Safari, only text reading has been implemented so far (the library is only a month old). The source of inspiration for Piecon was the animated Tinycon counter. View the demo here .

Source: https://habr.com/ru/post/150743/


All Articles