Skip to content

Commit

Permalink
✨ Remove wasd
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryScaletta committed Dec 29, 2023
1 parent 80284b9 commit b6813b4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 75 deletions.
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

- https://honeykingdom.github.io/#nytick
- https://honeykingdom.github.io/#gg
- https://honeykingdom.github.io/#wasd
- https://honeykingdom.github.io/#youtube=dQw4w9WgXcQ

### Goodgame
Expand All @@ -19,16 +18,6 @@
- https://honeykingdom.github.io/#gg-nuke73
- https://honeykingdom.github.io/#gg-praden

### Wasd

- https://honeykingdom.github.io/#wasd-cake
- https://honeykingdom.github.io/#wasd-zanuda
- https://honeykingdom.github.io/#wasd-lasqa
- https://honeykingdom.github.io/#wasd-segall
- https://honeykingdom.github.io/#wasd-guit88man
- https://honeykingdom.github.io/#wasd-nuke73
- https://honeykingdom.github.io/#wasd-arrowwoods

## Параметры

| параметр | описание | пример |
Expand All @@ -43,7 +32,6 @@
| twitch | название_канала | honeymad |
| youtube | youtube@id_видео | youtube@dQw4w9WgXcQ |
| goodgame | goodgame@id_канала \* | goodgame@41677 |
| wasd | wasd@id_канала | wasd@22196 |
| rutube | rutube@id_канала | rutube@22196 |
| vkplay | vkplay@название_канала | vkplay@guitman |

Expand All @@ -54,5 +42,3 @@
https://honeykingdom.github.io/?player=nytick&chats=honeymad,nytick

https://honeykingdom.github.io/?player=goodgame@41677&chats=honeymad,goodgame@41677

https://honeykingdom.github.io/?player=wasd@22196&chats=honeymad,wasd@22196
20 changes: 2 additions & 18 deletions src/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,6 @@ const PlayerWrapper = styled.div<PlayerWrapperProps>`
flex-grow: 1;
height: 100%;
${(p) =>
p.$service === StreamService.wasd &&
css`
--wasd-offset-top: 48px;
height: calc(100% + var(--wasd-offset-top));
margin-top: calc(-1 * var(--wasd-offset-top));
margin-right: -320px;
`};
${(p) =>
p.$isMobile &&
css`
Expand Down Expand Up @@ -165,19 +155,14 @@ const Home = () => {
const { player, chats } = usePlayerAndChat();
const [activeChat, setActiveChat] = useState(chats[0].url);

const isMobileSize = useIsMobile();
const isMobile = isMobileSize && player.service !== StreamService.wasd;
const isMobile = useIsMobile();

useEffect(() => setActiveChat(chats[0].url), [setActiveChat, chats]);

// remove wads chat if it the same as the player
const renderedChatFrames = chats.filter(
({ service, payload }: Frame) =>
!(service === StreamService.wasd && payload === player.payload),
({ payload }: Frame) => payload !== player.payload,
);

console.log({ player, chats });

return (
<>
<Container $isMobile={isMobile}>
Expand All @@ -187,7 +172,6 @@ const Home = () => {
title={`${player.service} - ${player.payload}`}
/>
</PlayerWrapper>
{player.service === StreamService.wasd && <WasdIconOverflow />}
<ChatsWrapper $isMobile={isMobile}>
<ChatTabs>
<ChatTabsInner>
Expand Down
33 changes: 0 additions & 33 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export enum StreamService {
twitch = 'twitch',
youtube = 'youtube',
goodgame = 'goodgame',
wasd = 'wasd',
rutube = 'rutube',
vkplay = 'vkplay',
}
Expand Down Expand Up @@ -58,38 +57,6 @@ export const PRESETS: Record<string, Preset> = {
player: 'goodgame@176695',
chats: 'praden,goodgame@176695',
},
wasd: {
player: 'wasd@22196',
chats: 'honeymad,wasd@22196',
},
'wasd-cake': {
player: 'wasd@40656',
chats: 'c_a_k_e,wasd@40656',
},
'wasd-zanuda': {
player: 'wasd@20402',
chats: 'zanuda,wasd@20402',
},
'wasd-lasqa': {
player: 'wasd@164328',
chats: 'lasqa,goodgame@99600,wasd@164328',
},
'wasd-segall': {
player: 'wasd@166801',
chats: 'segall,wasd@166801',
},
'wasd-guit88man': {
player: 'wasd@111152',
chats: 'guit88man,wasd@111152',
},
'wasd-nuke73': {
player: 'wasd@103444',
chats: 'nuke73,wasd@103444',
},
'wasd-arrowwoods': {
player: 'wasd@47282',
chats: 'arrowwoods,goodgame@180813,wasd@47282',
},
youtube: {
player: (id: string) => `youtube@${id}`,
chats: (id: string) => `honeymad,youtube@${id}`,
Expand Down
14 changes: 6 additions & 8 deletions src/utils/getPlayerAndChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { StreamService, PRESETS } from './constants';

const YOUTUBE_PRESET_REGEX = /^(youtube)=([a-zA-Z0-9_-]{11})$/;

export const DEFAULT_PRESET = PRESETS.wasd;
const {
player: DEFAULT_PLAYER,
chats: DEFAULT_CHATS,
} = DEFAULT_PRESET as PresetText;
export const DEFAULT_PRESET = PRESETS['gg-arrowwoods'];
const { player: DEFAULT_PLAYER, chats: DEFAULT_CHATS } =
DEFAULT_PRESET as PresetText;

const CHANNEL_SEPARATOR = '@';
const CHATS_SEPARATOR = ',';
Expand Down Expand Up @@ -64,9 +62,9 @@ export const getChatFrames = (urlParam: string | null) => {
const chats = getChats(urlParam || DEFAULT_CHATS);
const validChats = chats.filter(Boolean);

return (validChats.length > 0
? validChats
: getChats(DEFAULT_CHATS)) as Frame[];
return (
validChats.length > 0 ? validChats : getChats(DEFAULT_CHATS)
) as Frame[];
};

type GetPlayerAndChatParams = {
Expand Down
2 changes: 0 additions & 2 deletions src/utils/streamServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const chats: StreamServiceLinksMap = {
[StreamService.twitch]: (channel: string) => `//www.twitch.tv/embed/${channel}/chat?darkpopout&parent=${window.location.host}`,
[StreamService.youtube]: (id: string) => `//www.youtube.com/live_chat?v=${id}&is_popout=1`,
[StreamService.goodgame]: (id: string) => `//goodgame.ru/chat/${id}`,
[StreamService.wasd]: (id: string) => `//wasd.tv/chat?channel_id=${id}`,
[StreamService.rutube]: (id: string) => `//rutube.ru/pl/?pl_id&pl_type&pl_video=${id}`,
[StreamService.vkplay]: (channel: string) => `//vkplay.live/${channel}/only-chat?initialMode=0`,
};
Expand All @@ -17,7 +16,6 @@ const players: StreamServiceLinksMap = {
[StreamService.twitch]: (channel: string) => `//player.twitch.tv/?channel=${channel}&parent=${window.location.host}`,
[StreamService.youtube]: (id: string) => `//www.youtube.com/embed/${id}?autoplay=1`,
[StreamService.goodgame]: (id: string) => `//goodgame.ru/player?${id}`,
[StreamService.wasd]: (id: string) => `//wasd.tv/channel/${id}`,
[StreamService.rutube]: (id: string) => `//rutube.ru/chat/?videoId=${id}`,
[StreamService.vkplay]: (channel: string) => `//vkplay.live/app/embed/${channel}`,
};
Expand Down

0 comments on commit b6813b4

Please sign in to comment.