feat(themes): 骚猪主题

This commit is contained in:
streakingman 2022-09-21 19:27:29 +08:00
parent b3b5737e5c
commit 30bb7a0277
17 changed files with 41 additions and 5 deletions

View File

@ -27,7 +27,7 @@
- 撤销:撤销上一次操作,无限次数
- 洗牌:哗啦哗啦,无限次数
- 关卡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" /> 主题等(露出黑脚)
开心就好 😄

View File

@ -31,8 +31,8 @@
// 如果您基于此项目二创,可以删除以下代码
// 否则请标明原仓库地址
setTimeout(()=>{
const {host} = location
if(host!=='localhost'&&!host.endsWith('streakingman.com')){
const {hostname} = location
if(hostname!=='localhost'&&!hostname.endsWith('streakingman.com')){
const a = document.createElement('a')
a.setAttribute('href','https://github.com/StreakingMan/solvable-sheep-game')
a.setAttribute('target','_blank')

View File

@ -14,9 +14,10 @@ import { Icon, Theme } from './themes/interface';
import { fishermanTheme } from './themes/fisherman';
import { jinlunTheme } from './themes/jinlun';
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;
@ -370,7 +371,7 @@ const App: FC = () => {
return (
<>
<h2>(DEMO)</h2>
<h2>{curTheme.title}</h2>
<h6>
<GithubIcon />
</h6>

View File

@ -29,6 +29,7 @@ export const defaultSounds: Theme<DefaultSoundNames>['sounds'] = [
];
export const defaultTheme: Theme<DefaultSoundNames> = {
title: '有解的羊了个羊(DEMO)',
name: '默认',
icons: icons.map((icon) => ({
name: icon,

View File

@ -16,6 +16,7 @@ const fishes = Object.entries(imagesUrls).map(([key, value]) => ({
}));
export const fishermanTheme: Theme<DefaultSoundNames> = {
title: '🐟鱼了个鱼🐟',
name: '钓鱼佬',
icons: fishes.map(({ name, content }) => ({
name,

View File

@ -52,6 +52,7 @@ const icons = Object.entries(imagesUrls).map(([key, value]) => ({
}));
export const ikunTheme: Theme<SoundNames> = {
title: '🐔鸡了个鸡🐔',
name: 'iKun',
bgm,
icons: icons.map(({ name, content }) => ({

View File

@ -13,6 +13,7 @@ interface Sound<T = string> {
}
export interface Theme<SoundNames> {
title: string;
name: string;
bgm?: string;
icons: Icon<SoundNames>[];

View File

@ -24,6 +24,7 @@ const icons = Object.entries(imagesUrls).map(([key, value]) => ({
}));
export const jinlunTheme: Theme<string> = {
title: '🐎马了个马🐎',
name: '金轮',
icons: icons.map(({ name, content }) => ({
name,

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

BIN
src/themes/pdd/images/2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

BIN
src/themes/pdd/images/3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

BIN
src/themes/pdd/images/6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

BIN
src/themes/pdd/images/7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

BIN
src/themes/pdd/images/8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 KiB

BIN
src/themes/pdd/images/9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 KiB

30
src/themes/pdd/index.tsx Normal file
View 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,
};

Binary file not shown.