2023-07-03 22:20:35 +00:00
|
|
|
import BaseDirective from 'primevue/basedirective';
|
|
|
|
import { useStyle } from 'primevue/usestyle';
|
|
|
|
|
|
|
|
const styles = `
|
2022-09-06 12:03:37 +00:00
|
|
|
@keyframes ripple {
|
|
|
|
100% {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale(2.5);
|
|
|
|
}
|
|
|
|
}
|
2023-09-25 19:11:55 +00:00
|
|
|
|
|
|
|
@layer primevue {
|
|
|
|
.p-ripple {
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-ink {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
background: rgba(255, 255, 255, 0.5);
|
|
|
|
border-radius: 100%;
|
|
|
|
transform: scale(0);
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-ink-active {
|
|
|
|
animation: ripple 0.4s linear;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-ripple-disabled .p-ink {
|
|
|
|
display: none !important;
|
|
|
|
}
|
|
|
|
}
|
2023-07-03 22:20:35 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: 'p-ink'
|
|
|
|
};
|
|
|
|
|
|
|
|
const { load: loadStyle } = useStyle(styles, { name: 'ripple', manual: true });
|
|
|
|
|
|
|
|
const BaseRipple = BaseDirective.extend({
|
|
|
|
css: {
|
|
|
|
classes,
|
|
|
|
loadStyle
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default BaseRipple;
|