diff --git a/js/tabler.js b/js/tabler.js index 79ebc0a96..ee9bc5440 100644 --- a/js/tabler.js +++ b/js/tabler.js @@ -1,3 +1,5 @@ +import { CountUp } from "countup.js"; + const tabler = { hexToRgbA: function(hex, opacity) { let c; @@ -59,6 +61,19 @@ $(document).ready(function() { // $('[data-toggle="tooltip"]').tooltip(); // $('[data-toggle="popover"]').popover(); + /* + CountUp + */ + let countups = document.querySelectorAll("[data-countup]"); + for(let i = 0;i30000 +{% endexample %} + +### Duration + +Set the `duration` of the countup. (2s is set by default) + +{% example %} +

30000

+

30000

+

30000

+{% endexample %} + +### Starting value + +Set the start value of countup using `startVal`. +If you set it bigger than the `count`, countup will run reverse. + +{% example %} +

30000

+

30000

+{% endexample %} + +### Decimal places + +Set how many decimal places to show using `decimalPlaces`. + +{% example %} +

3.123

+

3.123

+

3.123

+

3.123

+{% endexample %} + +### Easing + +Disable easing using `"useEasing": false`. (`true` by default) + +{% example %} +

30000

+

30000

+{% endexample %} + +### Use grouping + +Disable grouping using `"useGrouping": false`. (`true` by default) + +{% example %} +

30000

+

30000

+{% endexample %} + +### Separator + +Set seperator that seperates groups using `separator`. (`,` by default) + +{% example %} +

3000000

+

3000000

+

3000000

+

3000000

+{% endexample %} + +### Decimal separator + +Set decimal separator using `decimal`. (`.` by default) + +{% example %} +

3.12

+

3.12

+

3.12

+

3.12

+{% endexample %} + +### Prefix + +Set countup prefix using `prefix`. + +{% example %} +

30000

+

30000

+

30000

+{% endexample %} + +### Suffix + +Set countup suffix using `suffix`. + +{% example %} +

30

+

30

+

30

+{% endexample %} + +Of course you can mix all of these: + +{% example %} +

64547834.76

+{% endexample %} + +To do more advanced stuff with countups go [**here**](https://inorganik.github.io/countUp.js/) to check how it's done. \ No newline at end of file diff --git a/pages/tmp4.html b/pages/tmp4.html new file mode 100644 index 000000000..36dc0c042 --- /dev/null +++ b/pages/tmp4.html @@ -0,0 +1,39 @@ +--- +tmp: true +menu: a.c.d +--- + + +
+
+

CountUp

+
+
+
+
+

30000

+ (Default) +
+
+

30000

+ (Duration 10s) +
+
+

30000

+ (No comma) +
+
+

30000000

+ (Space) +
+
+

30

+ (Suffix) +
+
+

30000

+ (Prefix) +
+
+
+
\ No newline at end of file