mirror of
https://ghproxy.com/https://github.com/StreakingMan/solvable-sheep-game
synced 2026-07-29 19:51:48 +08:00
feat(themes): 骚猪主题音效
This commit is contained in:
@@ -12,10 +12,14 @@ interface Sound<T = string> {
|
||||
src: string;
|
||||
}
|
||||
|
||||
type Operation = 'shift' | 'undo' | 'wash';
|
||||
|
||||
export interface Theme<SoundNames> {
|
||||
title: string;
|
||||
desc?: ReactNode;
|
||||
name: string;
|
||||
bgm?: string;
|
||||
icons: Icon<SoundNames>[];
|
||||
sounds: Sound<SoundNames>[];
|
||||
operateSoundMap?: Record<Operation, SoundNames>;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
// 骚猪主题
|
||||
import React from 'react';
|
||||
import { Theme } from '../interface';
|
||||
import { DefaultSoundNames, defaultSounds } from '../default';
|
||||
import { defaultSounds } from '../default';
|
||||
import bgm from './sounds/bgm.mp3';
|
||||
|
||||
const soundUrls = import.meta.glob('./sounds/*.mp3', {
|
||||
import: 'default',
|
||||
eager: true,
|
||||
});
|
||||
|
||||
const sounds = Object.entries(soundUrls).map(([key, value]) => ({
|
||||
name: key.slice(9, -4),
|
||||
src: value,
|
||||
})) as Theme<string>['sounds'];
|
||||
|
||||
const imagesUrls = import.meta.glob('./images/*.png', {
|
||||
import: 'default',
|
||||
eager: true,
|
||||
@@ -16,15 +26,28 @@ const images = Object.entries(imagesUrls).map(([key, value]) => ({
|
||||
content: <img src={value} alt="" />,
|
||||
}));
|
||||
|
||||
export const pddTheme: Theme<DefaultSoundNames> = {
|
||||
export const pddTheme: Theme<string> = {
|
||||
title: '🐷猪了个猪🐷',
|
||||
desc: (
|
||||
<p>
|
||||
感谢
|
||||
<a
|
||||
href="https://space.bilibili.com/81966051"
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
>
|
||||
猪酱的日常
|
||||
</a>
|
||||
提供素材
|
||||
</p>
|
||||
),
|
||||
name: '骚猪',
|
||||
bgm: 'https://m10.music.126.net/20220922020823/e92de2ba173e404bab61a4719b8d624b/ymusic/0759/010e/0e5d/03e18aa0e96daf33193797e61f6a314d.mp3',
|
||||
bgm: bgm,
|
||||
icons: images.map(({ name, content }) => ({
|
||||
name,
|
||||
content,
|
||||
clickSound: 'button-click',
|
||||
tripleSound: 'triple',
|
||||
tripleSound: name,
|
||||
})),
|
||||
sounds: defaultSounds,
|
||||
sounds: [defaultSounds[0], ...sounds],
|
||||
};
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user