feat(themes): 骚猪主题
|
@ -27,7 +27,7 @@
|
||||||
- 撤销:撤销上一次操作,无限次数
|
- 撤销:撤销上一次操作,无限次数
|
||||||
- 洗牌:哗啦哗啦,无限次数
|
- 洗牌:哗啦哗啦,无限次数
|
||||||
- 关卡:50 关玩到爽,可直接跳
|
- 关卡:50 关玩到爽,可直接跳
|
||||||
- 主题:金轮<img style="width:36px" src="src/themes/jinlun/images/肌肉金轮1.png" />、ikun<img style="width:36px" src="src/themes/ikun/images/kun.png" /> 主题等(露出黑脚)
|
- 主题:金轮<img style="width:36px" src="src/themes/jinlun/images/肌肉金轮1.png" />、骚猪<img style="width:36px" src="src/themes/pdd/images/1.png" />、ikun<img style="width:36px" src="src/themes/ikun/images/kun.png" /> 主题等(露出黑脚)
|
||||||
|
|
||||||
开心就好 😄
|
开心就好 😄
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
// 如果您基于此项目二创,可以删除以下代码
|
// 如果您基于此项目二创,可以删除以下代码
|
||||||
// 否则请标明原仓库地址
|
// 否则请标明原仓库地址
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
const {host} = location
|
const {hostname} = location
|
||||||
if(host!=='localhost'&&!host.endsWith('streakingman.com')){
|
if(hostname!=='localhost'&&!hostname.endsWith('streakingman.com')){
|
||||||
const a = document.createElement('a')
|
const a = document.createElement('a')
|
||||||
a.setAttribute('href','https://github.com/StreakingMan/solvable-sheep-game')
|
a.setAttribute('href','https://github.com/StreakingMan/solvable-sheep-game')
|
||||||
a.setAttribute('target','_blank')
|
a.setAttribute('target','_blank')
|
||||||
|
|
|
@ -14,9 +14,10 @@ import { Icon, Theme } from './themes/interface';
|
||||||
import { fishermanTheme } from './themes/fisherman';
|
import { fishermanTheme } from './themes/fisherman';
|
||||||
import { jinlunTheme } from './themes/jinlun';
|
import { jinlunTheme } from './themes/jinlun';
|
||||||
import { ikunTheme } from './themes/ikun';
|
import { ikunTheme } from './themes/ikun';
|
||||||
|
import { pddTheme } from './themes/pdd';
|
||||||
|
|
||||||
// 主题
|
// 主题
|
||||||
const themes = [defaultTheme, fishermanTheme, jinlunTheme, ikunTheme];
|
const themes = [defaultTheme, fishermanTheme, jinlunTheme, ikunTheme, pddTheme];
|
||||||
|
|
||||||
// 最大关卡
|
// 最大关卡
|
||||||
const maxLevel = 50;
|
const maxLevel = 50;
|
||||||
|
@ -370,7 +371,7 @@ const App: FC = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<h2>有解的羊了个羊(DEMO)</h2>
|
<h2>{curTheme.title}</h2>
|
||||||
<h6>
|
<h6>
|
||||||
<GithubIcon />
|
<GithubIcon />
|
||||||
</h6>
|
</h6>
|
||||||
|
|
|
@ -29,6 +29,7 @@ export const defaultSounds: Theme<DefaultSoundNames>['sounds'] = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const defaultTheme: Theme<DefaultSoundNames> = {
|
export const defaultTheme: Theme<DefaultSoundNames> = {
|
||||||
|
title: '有解的羊了个羊(DEMO)',
|
||||||
name: '默认',
|
name: '默认',
|
||||||
icons: icons.map((icon) => ({
|
icons: icons.map((icon) => ({
|
||||||
name: icon,
|
name: icon,
|
||||||
|
|
|
@ -16,6 +16,7 @@ const fishes = Object.entries(imagesUrls).map(([key, value]) => ({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const fishermanTheme: Theme<DefaultSoundNames> = {
|
export const fishermanTheme: Theme<DefaultSoundNames> = {
|
||||||
|
title: '🐟鱼了个鱼🐟',
|
||||||
name: '钓鱼佬',
|
name: '钓鱼佬',
|
||||||
icons: fishes.map(({ name, content }) => ({
|
icons: fishes.map(({ name, content }) => ({
|
||||||
name,
|
name,
|
||||||
|
|
|
@ -52,6 +52,7 @@ const icons = Object.entries(imagesUrls).map(([key, value]) => ({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const ikunTheme: Theme<SoundNames> = {
|
export const ikunTheme: Theme<SoundNames> = {
|
||||||
|
title: '🐔鸡了个鸡🐔',
|
||||||
name: 'iKun',
|
name: 'iKun',
|
||||||
bgm,
|
bgm,
|
||||||
icons: icons.map(({ name, content }) => ({
|
icons: icons.map(({ name, content }) => ({
|
||||||
|
|
|
@ -13,6 +13,7 @@ interface Sound<T = string> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Theme<SoundNames> {
|
export interface Theme<SoundNames> {
|
||||||
|
title: string;
|
||||||
name: string;
|
name: string;
|
||||||
bgm?: string;
|
bgm?: string;
|
||||||
icons: Icon<SoundNames>[];
|
icons: Icon<SoundNames>[];
|
||||||
|
|
|
@ -24,6 +24,7 @@ const icons = Object.entries(imagesUrls).map(([key, value]) => ({
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const jinlunTheme: Theme<string> = {
|
export const jinlunTheme: Theme<string> = {
|
||||||
|
title: '🐎马了个马🐎',
|
||||||
name: '金轮',
|
name: '金轮',
|
||||||
icons: icons.map(({ name, content }) => ({
|
icons: icons.map(({ name, content }) => ({
|
||||||
name,
|
name,
|
||||||
|
|
BIN
src/themes/pdd/images/10.png
Normal file
After Width: | Height: | Size: 203 KiB |
BIN
src/themes/pdd/images/2.png
Normal file
After Width: | Height: | Size: 236 KiB |
BIN
src/themes/pdd/images/3.png
Normal file
After Width: | Height: | Size: 134 KiB |
BIN
src/themes/pdd/images/6.png
Normal file
After Width: | Height: | Size: 195 KiB |
BIN
src/themes/pdd/images/7.png
Normal file
After Width: | Height: | Size: 204 KiB |
BIN
src/themes/pdd/images/8.png
Normal file
After Width: | Height: | Size: 148 KiB |
BIN
src/themes/pdd/images/9.png
Normal file
After Width: | Height: | Size: 181 KiB |
30
src/themes/pdd/index.tsx
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
// 骚猪主题
|
||||||
|
import React from 'react';
|
||||||
|
import { Theme } from '../interface';
|
||||||
|
import { DefaultSoundNames, defaultSounds } from '../default';
|
||||||
|
import bgm from './sounds/bgm.mp3';
|
||||||
|
|
||||||
|
const imagesUrls = import.meta.glob('./images/*.png', {
|
||||||
|
import: 'default',
|
||||||
|
eager: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
const images = Object.entries(imagesUrls).map(([key, value]) => ({
|
||||||
|
name: key.slice(9, -4),
|
||||||
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
|
// @ts-ignore
|
||||||
|
content: <img src={value} alt="" />,
|
||||||
|
}));
|
||||||
|
|
||||||
|
export const pddTheme: Theme<DefaultSoundNames> = {
|
||||||
|
title: '🐷猪了个猪🐷',
|
||||||
|
name: '骚猪',
|
||||||
|
bgm,
|
||||||
|
icons: images.map(({ name, content }) => ({
|
||||||
|
name,
|
||||||
|
content,
|
||||||
|
clickSound: 'button-click',
|
||||||
|
tripleSound: 'triple',
|
||||||
|
})),
|
||||||
|
sounds: defaultSounds,
|
||||||
|
};
|