mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
feat: recoil
This commit is contained in:
1 parent
8446e3fbbd
commit
3205630a0f
2 files changed
+23
-9
No files matched your search
+12
@@ -7,3 +7,15 @@
|
||||
background: var(--white-a3);
|
||||
transition: none;
|
||||
}
|
||||
|
||||
.reload {
|
||||
width: 65%;
|
||||
height: 65%;
|
||||
transition-duration: 200ms;
|
||||
}
|
||||
|
||||
.reload.go {
|
||||
width: 70%;
|
||||
height: 70%;
|
||||
transition: none;
|
||||
}
|
||||
+11
-9
@@ -24,17 +24,22 @@ export function ReloadVisualizer({ stats }: StatsAcceptorProps) {
|
||||
const reloadGlow = useRef<HTMLDivElement>(null);
|
||||
const totalTime = useRef<HTMLSpanElement>(null);
|
||||
const progressTime = useRef<HTMLSpanElement>(null);
|
||||
const flash = useRef<HTMLDivElement>(null);
|
||||
|
||||
const state = useRef(0);
|
||||
|
||||
const shoot = useCallback(() => {
|
||||
const element = document.getElementById('reload-visualizer-flash');
|
||||
flash.current?.classList.add('go');
|
||||
reloadCircle.current?.classList.add('go');
|
||||
reloadGlow.current?.classList.add('go');
|
||||
|
||||
console.log('shoot');
|
||||
void flash.current?.offsetWidth;
|
||||
void reloadCircle.current?.offsetWidth;
|
||||
void reloadGlow.current?.offsetWidth;
|
||||
|
||||
element?.classList.add('go');
|
||||
void element?.offsetWidth;
|
||||
element?.classList.remove('go');
|
||||
flash.current?.classList.remove('go');
|
||||
reloadCircle.current?.classList.remove('go');
|
||||
reloadGlow.current?.classList.remove('go');
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -178,8 +183,6 @@ export function ReloadVisualizer({ stats }: StatsAcceptorProps) {
|
||||
position="absolute"
|
||||
top="50%"
|
||||
left="50%"
|
||||
width="65%"
|
||||
height="65%"
|
||||
className="reload"
|
||||
ref={reloadGlow}
|
||||
style={{
|
||||
@@ -194,8 +197,6 @@ export function ReloadVisualizer({ stats }: StatsAcceptorProps) {
|
||||
position="absolute"
|
||||
top="50%"
|
||||
left="50%"
|
||||
width="65%"
|
||||
height="65%"
|
||||
className="reload"
|
||||
ref={reloadCircle}
|
||||
style={{
|
||||
@@ -282,6 +283,7 @@ export function ReloadVisualizer({ stats }: StatsAcceptorProps) {
|
||||
|
||||
<Box
|
||||
id="reload-visualizer-flash"
|
||||
ref={flash}
|
||||
position="absolute"
|
||||
top="0"
|
||||
left="0"
|
||||
|
||||
Reference in new issue
Block a user