@adriansteffan/reactive 0.1.9 → 0.1.11
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/{mod-EKiYITB-.js → mod-DWwiBaRy.js} +4812 -4801
- package/dist/reactive.es.js +1 -1
- package/dist/reactive.umd.js +619 -619
- package/dist/{web-qI9jYH18.js → web-jSsAWdvl.js} +1 -1
- package/dist/{web-DmM3ievP.js → web-mrTTNLP_.js} +1 -1
- package/package.json +1 -1
- package/src/components/tutorial.tsx +15 -2
package/package.json
CHANGED
|
@@ -97,6 +97,17 @@ export const Tutorial = ({
|
|
|
97
97
|
|
|
98
98
|
const canProgress = progressMap[page] !== false;
|
|
99
99
|
|
|
100
|
+
const prevCanProgress = useRef(canProgress);
|
|
101
|
+
const [pulse, setPulse] = useState(false);
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
if (canProgress && !prevCanProgress.current) {
|
|
104
|
+
setPulse(true);
|
|
105
|
+
const timer = setTimeout(() => setPulse(false), 300);
|
|
106
|
+
return () => clearTimeout(timer);
|
|
107
|
+
}
|
|
108
|
+
prevCanProgress.current = canProgress;
|
|
109
|
+
}, [canProgress]);
|
|
110
|
+
|
|
100
111
|
const handleSetCanProgress = useCallback(
|
|
101
112
|
(value: boolean) => {
|
|
102
113
|
setProgressMap((prev) => ({ ...prev, [page]: value }));
|
|
@@ -218,14 +229,16 @@ export const Tutorial = ({
|
|
|
218
229
|
</div>
|
|
219
230
|
|
|
220
231
|
<div style={{ justifySelf: 'start', marginLeft: '1rem' }}>
|
|
221
|
-
<button
|
|
232
|
+
<motion.button
|
|
222
233
|
onClick={goNextIfCan}
|
|
223
234
|
tabIndex={-1}
|
|
224
235
|
onKeyDown={(e) => { if (e.key === ' ' || e.key === 'Enter') e.preventDefault(); }}
|
|
236
|
+
animate={{ scale: pulse ? 1.2 : 1 }}
|
|
237
|
+
transition={{ type: 'spring', stiffness: 500, damping: 15 }}
|
|
225
238
|
className={(canProgress ? NAV_BTN_ACTIVE : NAV_BTN_DISABLED) + (page === slides.length - 1 ? ' px-8' : '')}
|
|
226
239
|
>
|
|
227
240
|
{page === slides.length - 1 ? finishText : '→'}
|
|
228
|
-
</button>
|
|
241
|
+
</motion.button>
|
|
229
242
|
</div>
|
|
230
243
|
</div>
|
|
231
244
|
</div>
|