clear-react-router 1.2.1 → 1.2.2
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/dist/index.js +25 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -283,6 +283,31 @@ var useLoader = (routeList) => {
|
|
|
283
283
|
//#endregion
|
|
284
284
|
//#region hooks/useApplyCustomAnimation.ts
|
|
285
285
|
var useApplyCustomAnimation = (animationOptions) => {
|
|
286
|
+
useEffect(() => {
|
|
287
|
+
const style = document.createElement("style");
|
|
288
|
+
style.id = "spinner-style";
|
|
289
|
+
style.textContent = `
|
|
290
|
+
@keyframes cr-spin {
|
|
291
|
+
0% { transform: rotate(0deg); }
|
|
292
|
+
100% { transform: rotate(360deg); }
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.cr-spinner {
|
|
296
|
+
position: fixed;
|
|
297
|
+
top: 5px;
|
|
298
|
+
left: 5px;
|
|
299
|
+
z-index: 9999;
|
|
300
|
+
width: 1rem;
|
|
301
|
+
height: 1rem;
|
|
302
|
+
border: 2px solid gray;
|
|
303
|
+
border-bottom-color: transparent;
|
|
304
|
+
border-radius: 50%;
|
|
305
|
+
animation: cr-spin 1s linear infinite;
|
|
306
|
+
}
|
|
307
|
+
`;
|
|
308
|
+
document.head.appendChild(style);
|
|
309
|
+
return () => style.remove();
|
|
310
|
+
}, []);
|
|
286
311
|
useEffect(() => {
|
|
287
312
|
if (!animationOptions?.duration) return;
|
|
288
313
|
const style = document.createElement("style");
|