|
| 1 | +"use strict"; |
| 2 | +var __importDefault = (this && this.__importDefault) || function (mod) { |
| 3 | + return (mod && mod.__esModule) ? mod : { "default": mod }; |
| 4 | +}; |
| 5 | +Object.defineProperty(exports, "__esModule", { value: true }); |
| 6 | +const plugin_1 = __importDefault(require("tailwindcss/plugin")); |
| 7 | +const shimmerBefore = { |
| 8 | + content: "attr(text-shimmer-data)", |
| 9 | + position: "absolute", |
| 10 | + inset: "0", |
| 11 | + "pointer-events": "none", |
| 12 | + color: "transparent", |
| 13 | + "background-clip": "text", |
| 14 | + "background-image": "linear-gradient(90deg, #0000, #0000, #0000, #fff, #0000, #0000, #0000)", |
| 15 | + "background-size": "200% 100%", |
| 16 | + "background-position": "150% 0", |
| 17 | + filter: "drop-shadow(0 0 1px #ffffff) drop-shadow(0 0 2px rgba(255,255,255,0.5))", |
| 18 | +}; |
| 19 | +exports.default = (0, plugin_1.default)(function ({ addUtilities, addComponents }) { |
| 20 | + addUtilities({ |
| 21 | + "@keyframes text-shimmer": { |
| 22 | + "0%": { "background-position": "150% 0" }, |
| 23 | + "100%": { "background-position": "-250% 0" }, |
| 24 | + }, |
| 25 | + }); |
| 26 | + addComponents({ |
| 27 | + ".text-shimmer": { |
| 28 | + position: "relative", |
| 29 | + display: "inline-block", |
| 30 | + }, |
| 31 | + ".text-shimmer::before": Object.assign(Object.assign({}, shimmerBefore), { animation: "text-shimmer 5s linear infinite" }), |
| 32 | + ".hover-text-shimmer": { |
| 33 | + position: "relative", |
| 34 | + display: "inline-block", |
| 35 | + }, |
| 36 | + ".hover-text-shimmer::before": Object.assign(Object.assign({}, shimmerBefore), { opacity: "0" }), |
| 37 | + ".hover-text-shimmer:hover::before": { |
| 38 | + animation: "text-shimmer 5s linear infinite", |
| 39 | + opacity: "1", |
| 40 | + }, |
| 41 | + ".group-hover-text-shimmer": { |
| 42 | + position: "relative", |
| 43 | + display: "inline-block", |
| 44 | + }, |
| 45 | + ".group-hover-text-shimmer::before": Object.assign(Object.assign({}, shimmerBefore), { opacity: "0" }), |
| 46 | + ".group:hover .group-hover-text-shimmer::before": { |
| 47 | + animation: "text-shimmer 5s linear infinite", |
| 48 | + opacity: "1", |
| 49 | + }, |
| 50 | + }); |
| 51 | +}); |
0 commit comments