Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 620e4ca

Browse files
author
takuma-hmng8
committed
fix:interpolate function
1 parent b369f55 commit 620e4ca

File tree

11 files changed

+263
-258
lines changed

11 files changed

+263
-258
lines changed

‎app/ShaderFx.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const ShaderFx = ({
5454
setDpr(Math.round((0.5 + 1.5 * factor) * 10) / 10);
5555
}}>
5656
{children}
57-
<Perf position={"bottom-left"} minimal={false} />
57+
{/* <Perf position={"bottom-left"} minimal={false} /> */}
5858
</PerformanceMonitor>
5959
</Canvas>
6060
</Suspense>

‎app/stickers/Playground.tsx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,19 @@ export const Playground = () => {
4545

4646
// control clock state
4747
if (canvasState.stickerState.isNotSticked) {
48-
const eased = Easing.easeOutSine(
49-
Math.sin(clock.getElapsedTime() * 3.5) * 0.5 + 0.5
50-
);
5148
canvasState.clockState.waiting = Utils.interpolate(
5249
canvasState.clockState.waiting,
53-
eased,
50+
Easing.easeOutSine(
51+
Math.sin(clock.getElapsedTime() * 3.5) * 0.5 + 0.5
52+
),
5453
0.1
5554
);
5655
} else if (canvasState.clockState.waiting > 0) {
57-
canvasState.clockState.waiting =
58-
canvasState.clockState.waiting > 0.001
59-
? Utils.interpolate(canvasState.clockState.waiting, 0, 0.16)
60-
: 0;
56+
canvasState.clockState.waiting = Utils.interpolate(
57+
canvasState.clockState.waiting,
58+
0,
59+
0.16
60+
);
6161
}
6262
});
6363
return (

‎app/stickers/StickerBall/index.tsx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ export const StickerBall = memo(
9595
// Only let them wobble when the sticker is pressed.
9696
if (canvasState.stickerState.wobbleStrength > 0) {
9797
canvasState.stickerState.wobbleStrength -= delta;
98+
} else {
99+
canvasState.stickerState.wobbleStrength = 0;
98100
}
99101

100102
wobbleVal.current = Utils.interpolate(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /