feat(nds): add audio in all menus
This commit is contained in:
@@ -63,6 +63,9 @@ export const useAchievementsStore = defineStore("achievements", () => {
|
||||
|
||||
storage.value.unlocked.push(name);
|
||||
|
||||
const { assets } = useAssets();
|
||||
assets.audio.messageReceived.play(0.5);
|
||||
|
||||
if (storage.value.unlocked.length === ACHIEVEMENTS.length) {
|
||||
confetti.spawn();
|
||||
} else {
|
||||
|
||||
@@ -137,6 +137,9 @@ export const useAchievementsScreen = defineStore("achievementsScreen", {
|
||||
this.isIntro = false;
|
||||
this.isOutro = true;
|
||||
|
||||
const { assets } = useAssets();
|
||||
assets.audio.menuConfirmed.play();
|
||||
|
||||
gsap
|
||||
.timeline()
|
||||
.fromTo(
|
||||
|
||||
@@ -45,6 +45,18 @@ export const useConfirmationModal = defineStore("confirmationModal", {
|
||||
this.isClosing = false;
|
||||
this.isOpen = true;
|
||||
|
||||
const { assets } = useAssets();
|
||||
if (
|
||||
options.aLabel !== undefined ||
|
||||
options.bLabel !== undefined ||
|
||||
options.onActivateA !== undefined ||
|
||||
options.onActivateB !== undefined
|
||||
) {
|
||||
assets.audio.menuOpen.play();
|
||||
} else {
|
||||
assets.audio.menuConfirmed.play();
|
||||
}
|
||||
|
||||
gsap
|
||||
.timeline()
|
||||
// standard buttons down
|
||||
@@ -83,6 +95,20 @@ export const useConfirmationModal = defineStore("confirmationModal", {
|
||||
|
||||
this.isClosing = true;
|
||||
|
||||
if (
|
||||
this.aLabel !== null ||
|
||||
this.bLabel !== null ||
|
||||
this.onActivateA !== null ||
|
||||
this.onActivateB !== null
|
||||
) {
|
||||
const { assets } = useAssets();
|
||||
if (choice === "A") {
|
||||
assets.audio.menuConfirmed.play();
|
||||
} else {
|
||||
assets.audio.menuError.play();
|
||||
}
|
||||
}
|
||||
|
||||
const keepButtonsDown =
|
||||
typeof this.keepButtonsDown === "function"
|
||||
? this.keepButtonsDown(choice)
|
||||
|
||||
@@ -77,6 +77,9 @@ export const useContactStore = defineStore("contact", {
|
||||
pushNotification(content: string) {
|
||||
this.notifications.push(content);
|
||||
|
||||
const { assets } = useAssets();
|
||||
assets.audio.messageSent.play();
|
||||
|
||||
gsap.fromTo(
|
||||
this,
|
||||
{ notificationsYOffset: 20 },
|
||||
@@ -92,6 +95,9 @@ export const useContactStore = defineStore("contact", {
|
||||
animateOutro() {
|
||||
this.isOutro = true;
|
||||
|
||||
const { assets } = useAssets();
|
||||
assets.audio.menuConfirmed.play();
|
||||
|
||||
const timeline = gsap.timeline({
|
||||
onComplete: () => {
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -113,6 +113,9 @@ export const useCreditsStore = defineStore("credits", {
|
||||
this.isIntro = false;
|
||||
this.isOutro = true;
|
||||
|
||||
const { assets } = useAssets();
|
||||
assets.audio.menuConfirmed.play();
|
||||
|
||||
gsap
|
||||
.timeline()
|
||||
.fromTo(
|
||||
|
||||
@@ -102,6 +102,9 @@ export const useHomeStore = defineStore("home", {
|
||||
},
|
||||
|
||||
animateOutro(to: AppScreen) {
|
||||
const { assets } = useAssets();
|
||||
assets.audio.menuOpen.play();
|
||||
|
||||
if (to === "achievements") {
|
||||
const achievementsScreen = useAchievementsScreen();
|
||||
achievementsScreen.animateFadeToBlackIntro();
|
||||
|
||||
@@ -32,6 +32,15 @@ export const useIntroStore = defineStore("intro", {
|
||||
this.isIntro = false;
|
||||
},
|
||||
})
|
||||
.call(
|
||||
() => {
|
||||
const now = new Date();
|
||||
const isBirthday = now.getMonth() === 3 && now.getDate() === 25;
|
||||
(isBirthday ? assets.audio.birthdayStartup : assets.audio.startUp).play();
|
||||
},
|
||||
undefined,
|
||||
delay,
|
||||
)
|
||||
.to(
|
||||
this.intro,
|
||||
{
|
||||
@@ -59,6 +68,9 @@ export const useIntroStore = defineStore("intro", {
|
||||
animateOutro() {
|
||||
this.isOutro = true;
|
||||
|
||||
const { assets } = useAssets();
|
||||
assets.audio.tinyClick.play(0.8);
|
||||
|
||||
gsap
|
||||
.timeline()
|
||||
.to(this.outro, {
|
||||
|
||||
@@ -68,6 +68,9 @@ export const useSettingsStore = defineStore("settings", {
|
||||
},
|
||||
|
||||
async openSubMenu(submenu: SettingsSubMenu) {
|
||||
const { assets } = useAssets();
|
||||
assets.audio.menuOpen.play();
|
||||
|
||||
await gsap
|
||||
.timeline()
|
||||
.to(this.submenuTransition, {
|
||||
@@ -99,7 +102,12 @@ export const useSettingsStore = defineStore("settings", {
|
||||
}
|
||||
},
|
||||
|
||||
async closeSubMenu() {
|
||||
async closeSubMenu(silent = false) {
|
||||
if (!silent) {
|
||||
const { assets } = useAssets();
|
||||
assets.audio.menuError.play();
|
||||
}
|
||||
|
||||
await gsap
|
||||
.timeline()
|
||||
.to(this, {
|
||||
@@ -148,6 +156,8 @@ export const useSettingsStore = defineStore("settings", {
|
||||
animateIntro() {
|
||||
this.isIntro = true;
|
||||
|
||||
const { assets } = useAssets();
|
||||
|
||||
gsap
|
||||
.timeline()
|
||||
// bars
|
||||
@@ -178,6 +188,7 @@ export const useSettingsStore = defineStore("settings", {
|
||||
{ 1: 0, duration: 0.1, ease: "none" },
|
||||
0.2,
|
||||
)
|
||||
.call(() => assets.audio.settingsMenuIntro.play(), undefined, 0.2)
|
||||
.fromTo(
|
||||
this.menuOffsets,
|
||||
{ 2: -48 },
|
||||
@@ -198,8 +209,11 @@ export const useSettingsStore = defineStore("settings", {
|
||||
animateOutro() {
|
||||
this.isOutro = true;
|
||||
|
||||
const { assets } = useAssets();
|
||||
|
||||
gsap
|
||||
.timeline()
|
||||
.call(() => assets.audio.settingsMenuOutro.play())
|
||||
// title notification
|
||||
.fromTo(
|
||||
this,
|
||||
|
||||
Reference in New Issue
Block a user