@aristobyte-ui/utils 2.8.1 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/aristobyte-ui.settings.scss +9 -16
- package/es/.tsbuildinfo +1 -1
- package/es/helpers/ripple.d.ts +1 -0
- package/es/helpers/ripple.js +4 -4
- package/lib/.tsbuildinfo +1 -1
- package/lib/helpers/ripple.d.ts +1 -0
- package/lib/helpers/ripple.js +4 -4
- package/package.json +1 -1
package/es/helpers/ripple.d.ts
CHANGED
package/es/helpers/ripple.js
CHANGED
|
@@ -3,15 +3,15 @@ export var renderRipple = function (_a) {
|
|
|
3
3
|
var button = ref.current;
|
|
4
4
|
if (!button)
|
|
5
5
|
return;
|
|
6
|
-
var circle = document.createElement(
|
|
6
|
+
var circle = document.createElement('span');
|
|
7
7
|
var diameter = Math.max(button.clientWidth, button.clientHeight);
|
|
8
8
|
var radius = diameter / 2;
|
|
9
|
-
circle.id =
|
|
10
|
-
var style = document.createElement(
|
|
9
|
+
circle.id = 'ripple';
|
|
10
|
+
var style = document.createElement('style');
|
|
11
11
|
style.innerHTML = "\n #ripple {\n animation: ripple 300ms linear;\n background-color: rgba(255, 255, 255, 0.3);\n border-radius: 50%;\n height: ".concat(diameter, "px;\n left: ").concat(clientX - button.getBoundingClientRect().left - radius, "px;\n pointer-events: none;\n position: absolute;\n top: ").concat(clientY - button.getBoundingClientRect().top - radius, "px;\n transform: scale(0);\n width: ").concat(diameter, "px;\n z-index: 0;\n }\n \n @keyframes ripple {\n to {\n opacity: 0;\n transform: scale(2);\n }\n }\n ");
|
|
12
12
|
button.appendChild(style);
|
|
13
13
|
button.appendChild(circle);
|
|
14
|
-
circle.addEventListener(
|
|
14
|
+
circle.addEventListener('animationend', function () {
|
|
15
15
|
circle.remove();
|
|
16
16
|
style.remove();
|
|
17
17
|
});
|