diff --git a/src/App.css b/src/App.css index a41e174..fd6c4d2 100644 --- a/src/App.css +++ b/src/App.css @@ -34,6 +34,7 @@ transition: 150ms; left: 0; top: 0; + border-radius: 8px; } .symbol-inner { diff --git a/src/App.tsx b/src/App.tsx index 70ba885..ff75629 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,4 @@ import React, { - ChangeEventHandler, FC, MouseEventHandler, useEffect, @@ -10,11 +9,13 @@ import React, { import './App.css'; import { GithubIcon } from './GithubIcon'; import { randomString, waitTimeout } from './utils'; -import { DefaultSoundNames, defaultTheme } from './themes/default'; +import { defaultTheme } from './themes/default'; import { Icon, Theme } from './themes/interface'; import { fishermanTheme } from './themes/fisherman'; +import { jinlunTheme } from './themes/jinlun'; -const themes = [defaultTheme, fishermanTheme]; +// 主题 +const themes = [defaultTheme, fishermanTheme, jinlunTheme]; // 最大关卡 const maxLevel = 50; @@ -123,13 +124,14 @@ const Symbol: FC = ({ x, y, icon, isCover, status, onClick }) => { className="symbol" style={{ transform: `translateX(${x}%) translateY(${y}%)`, + backgroundColor: isCover ? '#999' : 'white', opacity: status < 2 ? 1 : 0, }} onClick={onClick} >
{typeof icon.content === 'string' ? ( {icon.content} @@ -142,8 +144,7 @@ const Symbol: FC = ({ x, y, icon, isCover, status, onClick }) => { }; const App: FC = () => { - const [curTheme, setCurTheme] = - useState>(defaultTheme); + const [curTheme, setCurTheme] = useState>(defaultTheme); const [scene, setScene] = useState(makeScene(1, curTheme.icons)); const [level, setLevel] = useState(1); const [queue, setQueue] = useState([]); @@ -162,8 +163,10 @@ const App: FC = () => { const [bgmOn, setBgmOn] = useState(false); const [once, setOnce] = useState(false); useEffect(() => { + if (!bgmRef.current) return; if (bgmOn) { - bgmRef.current?.play(); + bgmRef.current.volume = 0.15; + bgmRef.current.play(); } else { bgmRef.current?.pause(); } @@ -301,6 +304,7 @@ const App: FC = () => { // 点击音效 if (soundRefMap.current) { + console.log(soundRefMap.current, symbol.icon); soundRefMap.current[symbol.icon.clickSound].currentTime = 0; soundRefMap.current[symbol.icon.clickSound].play(); } diff --git a/src/themes/jinlun/images/中指.png b/src/themes/jinlun/images/中指.png new file mode 100644 index 0000000..d8ca9b0 Binary files /dev/null and b/src/themes/jinlun/images/中指.png differ diff --git a/src/themes/jinlun/images/我黑切呢.png b/src/themes/jinlun/images/我黑切呢.png new file mode 100644 index 0000000..8e9b04b Binary files /dev/null and b/src/themes/jinlun/images/我黑切呢.png differ diff --git a/src/themes/jinlun/images/笑1.png b/src/themes/jinlun/images/笑1.png new file mode 100644 index 0000000..e95031c Binary files /dev/null and b/src/themes/jinlun/images/笑1.png differ diff --git a/src/themes/jinlun/images/笑2.png b/src/themes/jinlun/images/笑2.png new file mode 100644 index 0000000..993cfaf Binary files /dev/null and b/src/themes/jinlun/images/笑2.png differ diff --git a/src/themes/jinlun/images/笑3.png b/src/themes/jinlun/images/笑3.png new file mode 100644 index 0000000..311bc6d Binary files /dev/null and b/src/themes/jinlun/images/笑3.png differ diff --git a/src/themes/jinlun/images/笑4.png b/src/themes/jinlun/images/笑4.png new file mode 100644 index 0000000..a9b31f4 Binary files /dev/null and b/src/themes/jinlun/images/笑4.png differ diff --git a/src/themes/jinlun/images/肌肉金轮1.png b/src/themes/jinlun/images/肌肉金轮1.png new file mode 100644 index 0000000..0200791 Binary files /dev/null and b/src/themes/jinlun/images/肌肉金轮1.png differ diff --git a/src/themes/jinlun/images/肌肉金轮2.png b/src/themes/jinlun/images/肌肉金轮2.png new file mode 100644 index 0000000..d35aa62 Binary files /dev/null and b/src/themes/jinlun/images/肌肉金轮2.png differ diff --git a/src/themes/jinlun/images/肌肉金轮3.png b/src/themes/jinlun/images/肌肉金轮3.png new file mode 100644 index 0000000..58f3592 Binary files /dev/null and b/src/themes/jinlun/images/肌肉金轮3.png differ diff --git a/src/themes/jinlun/images/韩委员.png b/src/themes/jinlun/images/韩委员.png new file mode 100644 index 0000000..bbf38f4 Binary files /dev/null and b/src/themes/jinlun/images/韩委员.png differ diff --git a/src/themes/jinlun/index.tsx b/src/themes/jinlun/index.tsx new file mode 100644 index 0000000..ca35e08 --- /dev/null +++ b/src/themes/jinlun/index.tsx @@ -0,0 +1,35 @@ +import { Theme } from '../interface'; +import React from 'react'; + +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['sounds']; + +const imagesUrls = import.meta.glob('./images/*.png', { + import: 'default', + eager: true, +}); + +const icons = Object.entries(imagesUrls).map(([key, value]) => ({ + name: key.slice(9, -4), + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore + content: , +})); + +export const jinlunTheme: Theme = { + name: '金轮', + icons: icons.map(({ name, content }) => ({ + name, + content, + clickSound: name, + tripleSound: '起飞啦', + })), + sounds, +}; diff --git a/src/themes/jinlun/sounds/中指.mp3 b/src/themes/jinlun/sounds/中指.mp3 new file mode 100644 index 0000000..e833bf2 Binary files /dev/null and b/src/themes/jinlun/sounds/中指.mp3 differ diff --git a/src/themes/jinlun/sounds/我黑切呢.mp3 b/src/themes/jinlun/sounds/我黑切呢.mp3 new file mode 100644 index 0000000..397996a Binary files /dev/null and b/src/themes/jinlun/sounds/我黑切呢.mp3 differ diff --git a/src/themes/jinlun/sounds/笑1.mp3 b/src/themes/jinlun/sounds/笑1.mp3 new file mode 100644 index 0000000..1d02a30 Binary files /dev/null and b/src/themes/jinlun/sounds/笑1.mp3 differ diff --git a/src/themes/jinlun/sounds/笑2.mp3 b/src/themes/jinlun/sounds/笑2.mp3 new file mode 100644 index 0000000..3905190 Binary files /dev/null and b/src/themes/jinlun/sounds/笑2.mp3 differ diff --git a/src/themes/jinlun/sounds/笑3.mp3 b/src/themes/jinlun/sounds/笑3.mp3 new file mode 100644 index 0000000..1dbd128 Binary files /dev/null and b/src/themes/jinlun/sounds/笑3.mp3 differ diff --git a/src/themes/jinlun/sounds/笑4.mp3 b/src/themes/jinlun/sounds/笑4.mp3 new file mode 100644 index 0000000..17b8020 Binary files /dev/null and b/src/themes/jinlun/sounds/笑4.mp3 differ diff --git a/src/themes/jinlun/sounds/肌肉金轮1.mp3 b/src/themes/jinlun/sounds/肌肉金轮1.mp3 new file mode 100644 index 0000000..ce1d5c9 Binary files /dev/null and b/src/themes/jinlun/sounds/肌肉金轮1.mp3 differ diff --git a/src/themes/jinlun/sounds/肌肉金轮2.mp3 b/src/themes/jinlun/sounds/肌肉金轮2.mp3 new file mode 100644 index 0000000..59db7d4 Binary files /dev/null and b/src/themes/jinlun/sounds/肌肉金轮2.mp3 differ diff --git a/src/themes/jinlun/sounds/肌肉金轮3.mp3 b/src/themes/jinlun/sounds/肌肉金轮3.mp3 new file mode 100644 index 0000000..504f64a Binary files /dev/null and b/src/themes/jinlun/sounds/肌肉金轮3.mp3 differ diff --git a/src/themes/jinlun/sounds/起飞啦.mp3 b/src/themes/jinlun/sounds/起飞啦.mp3 new file mode 100644 index 0000000..e5fca95 Binary files /dev/null and b/src/themes/jinlun/sounds/起飞啦.mp3 differ diff --git a/src/themes/jinlun/sounds/韩委员.mp3 b/src/themes/jinlun/sounds/韩委员.mp3 new file mode 100644 index 0000000..5c02a7a Binary files /dev/null and b/src/themes/jinlun/sounds/韩委员.mp3 differ