feat(nds): add whoosh effect for nds 3d animation and for the gallery transition
This commit is contained in:
@@ -102,6 +102,8 @@ const animateIntro = () => {
|
|||||||
if (hasAnimated.value) return;
|
if (hasAnimated.value) return;
|
||||||
hasAnimated.value = true;
|
hasAnimated.value = true;
|
||||||
|
|
||||||
|
assets.audio.whoosh.play();
|
||||||
|
|
||||||
gsap
|
gsap
|
||||||
.timeline()
|
.timeline()
|
||||||
.to(
|
.to(
|
||||||
@@ -538,11 +540,6 @@ const releaseButton = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleMouseDown = (event: MouseEvent) => {
|
const handleMouseDown = (event: MouseEvent) => {
|
||||||
if (!hasAnimated.value) {
|
|
||||||
animateIntro();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
handleInteraction(event.clientX, event.clientY, (canvas, intersection) => {
|
handleInteraction(event.clientX, event.clientY, (canvas, intersection) => {
|
||||||
dispatchScreenEvent("mousedown", canvas, intersection);
|
dispatchScreenEvent("mousedown", canvas, intersection);
|
||||||
});
|
});
|
||||||
@@ -602,11 +599,6 @@ const handleTouchStart = (event: TouchEvent) => {
|
|||||||
swipeStartX = touch.clientX;
|
swipeStartX = touch.clientX;
|
||||||
swipeStartY = touch.clientY;
|
swipeStartY = touch.clientY;
|
||||||
|
|
||||||
if (!hasAnimated.value) {
|
|
||||||
animateIntro();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
handleInteraction(touch.clientX, touch.clientY, (canvas, intersection) => {
|
handleInteraction(touch.clientX, touch.clientY, (canvas, intersection) => {
|
||||||
dispatchScreenEvent("mousedown", canvas, intersection);
|
dispatchScreenEvent("mousedown", canvas, intersection);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -114,6 +114,11 @@ export const useGalleryStore = defineStore("gallery", {
|
|||||||
this.shouldAnimateOutro = true;
|
this.shouldAnimateOutro = true;
|
||||||
navigateTo("/gallery");
|
navigateTo("/gallery");
|
||||||
}, ANIMATION.NAVIGATE_DELAY);
|
}, ANIMATION.NAVIGATE_DELAY);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
const { assets } = useAssets();
|
||||||
|
assets.audio.whooshSmall.play(0.6);
|
||||||
|
}, 500);
|
||||||
},
|
},
|
||||||
|
|
||||||
animateOutro() {
|
animateOutro() {
|
||||||
@@ -191,6 +196,9 @@ export const useGalleryStore = defineStore("gallery", {
|
|||||||
app.navigateTo("home");
|
app.navigateTo("home");
|
||||||
app.allowHints();
|
app.allowHints();
|
||||||
}, ANIMATION.NAVIGATE_DELAY);
|
}, ANIMATION.NAVIGATE_DELAY);
|
||||||
|
|
||||||
|
const { assets } = useAssets();
|
||||||
|
assets.audio.whooshSmallReverse.play(0.6);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
BIN
public/nds/audio/whoosh-small-reverse.mp3
Normal file
BIN
public/nds/audio/whoosh-small-reverse.mp3
Normal file
Binary file not shown.
BIN
public/nds/audio/whoosh-small.mp3
Normal file
BIN
public/nds/audio/whoosh-small.mp3
Normal file
Binary file not shown.
BIN
public/nds/audio/whoosh.mp3
Normal file
BIN
public/nds/audio/whoosh.mp3
Normal file
Binary file not shown.
Reference in New Issue
Block a user