mirror of
https://github.com/tabler/tabler.git
synced 2025-12-21 17:34:25 +04:00
input mask component
This commit is contained in:
34
js/tabler.js
34
js/tabler.js
@@ -1,22 +1,6 @@
|
||||
import {CountUp} from "countup.js";
|
||||
|
||||
const tabler = {
|
||||
hexToRgbA: function (hex, opacity) {
|
||||
let c;
|
||||
|
||||
opacity = opacity || 1;
|
||||
|
||||
if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {
|
||||
c = hex.substring(1).split('');
|
||||
if (c.length === 3) {
|
||||
c = [c[0], c[0], c[1], c[1], c[2], c[2]];
|
||||
}
|
||||
c = '0x' + c.join('');
|
||||
return 'rgba(' + [(c >> 16) & 255, (c >> 8) & 255, c & 255].join(',') + ',' + opacity + ')';
|
||||
}
|
||||
throw new Error('Bad Hex');
|
||||
},
|
||||
|
||||
toggleFullscreen: function (elem) {
|
||||
elem = elem || document.documentElement;
|
||||
if (
|
||||
@@ -73,24 +57,6 @@ $(document).ready(function () {
|
||||
let countup = new CountUp(countups[i], parseFloat(countups[i].innerText), dataCountUp);
|
||||
countup.start();
|
||||
}
|
||||
|
||||
/*
|
||||
Imask plugin
|
||||
*/
|
||||
if (window.IMask) {
|
||||
(function () {
|
||||
const $elem = $('[data-mask]');
|
||||
|
||||
if ($elem) {
|
||||
$elem.each(function () {
|
||||
IMask($(this).get(0), {
|
||||
mask: $(this).attr('data-mask'),
|
||||
lazy: $(this).attr('data-mask-visible') === 'true',
|
||||
});
|
||||
});
|
||||
}
|
||||
})();
|
||||
}
|
||||
});
|
||||
|
||||
window.tabler = tabler;
|
||||
|
||||
Reference in New Issue
Block a user