repo stringlengths 7 64 | file_url stringlengths 81 338 | file_path stringlengths 5 257 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:25:31 2026-01-05 01:50:38 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Camera/CameraManager.ts | src/modules/Camera/CameraManager.ts | import Listener from 'modules/utils/Listener';
import storage from 'modules/utils/storage';
const CAMERA_GRANT_KEY = 'CAMERA_GRANT_KEY';
const storedGrant = storage.local.getItem(CAMERA_GRANT_KEY);
class CameraManager extends Listener<[boolean]> {
private canvas: HTMLCanvasElement;
private video: HTMLVideoElemen... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Players/utils.ts | src/modules/Players/utils.ts | import { SelectedPlayerInput } from 'modules/Players/PlayersManager';
export const getInputId = (input: Pick<SelectedPlayerInput, 'deviceId' | 'channel'>) =>
`${input.deviceId};${input.channel}`;
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Players/PlayersManager.ts | src/modules/Players/PlayersManager.ts | import { debounce } from 'es-toolkit';
import GameState from 'modules/GameEngine/GameState/GameState';
import InputManager from 'modules/GameEngine/Input/InputManager';
import events from 'modules/GameEvents/GameEvents';
import RemoteMicServer from 'modules/RemoteMic/Network/Server';
import RemoteMicManager from 'modul... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/SmoothLink.tsx | src/modules/Elements/SmoothLink.tsx | import useSmoothNavigate from 'modules/hooks/useSmoothNavigate';
import { ComponentProps, HTMLAttributes, MouseEventHandler } from 'react';
import { Link } from 'wouter';
interface Props extends Omit<ComponentProps<typeof Link>, 'href' | 'to'> {
to: string;
disabled?: boolean;
onClick?: HTMLAttributes<HTMLElemen... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/BackgroundContext.ts | src/modules/Elements/BackgroundContext.ts | import { backgroundTheme } from 'modules/Elements/LayoutWithBackground';
import { createContext, useContext, useEffect } from 'react';
export const BackgroundContext = createContext({
visible: true,
theme: 'regular' as backgroundTheme,
setVisibility: (_visible: boolean): void => undefined,
setTheme: (_theme: b... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/cssMixins.ts | src/modules/Elements/cssMixins.ts | import styles from 'modules/GameEngine/Drawing/styles';
export const focused = {
animation: `focusAnimation 1000ms ease-in-out infinite both`,
};
export const focusedStatic = {
boxShadow: `inset 0px 0px 0px 4px ${styles.colors.text.active}`,
};
export const typography = {
fontWeight: 'bold',
WebkitTextStroke... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Tooltip.test.tsx | src/modules/Elements/Tooltip.test.tsx | import { render, screen } from '@testing-library/react';
import { userEvent } from '@testing-library/user-event';
import { ClosableTooltip } from 'modules/Elements/Tooltip';
import { act } from 'react';
import { afterEach } from 'vitest';
describe('Tooltip', () => {
const baseProps = {
dismissKey: 'dismissKey',
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Logo.tsx | src/modules/Elements/Logo.tsx | import dotparty from 'modules/Elements/dotparty.gif';
import logoMp4 from 'modules/Elements/logo.mp4';
import logoWebm from 'modules/Elements/logo.webm';
import pride from 'modules/Elements/pride.png';
import santaHat from 'modules/Elements/santas-hat.webp';
import { FeatureFlags } from 'modules/utils/featureFlags';
im... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/NormalizeFontSize.tsx | src/modules/Elements/NormalizeFontSize.tsx | export default function NormalizeFontSize({ size = 16 }) {
return (
<style>
{`html {
font-size: ${size}px !important;
}`}
</style>
);
}
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Snow.tsx | src/modules/Elements/Snow.tsx | import useViewportSize from 'modules/hooks/useViewportSize';
import { useEffect, useRef } from 'react';
const NUMBER_OF_SNOWFLAKES = 45;
const MAX_SNOWFLAKE_SIZE = 7;
const MAX_SNOWFLAKE_SPEED = 0.005;
const SNOWFLAKE_COLOUR = '#ddd';
const snowflakes: any[] = [];
// from https://codepen.io/codebubb/pen/LYqovoV
expor... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/LayoutWithBackground.tsx | src/modules/Elements/LayoutWithBackground.tsx | import { css } from '@emotion/react';
import styled from '@emotion/styled';
import { EurovisionBackground } from 'modules/Elements/Background/Eurovision';
import { BackgroundContext as BackgroundContext1 } from 'modules/Elements/BackgroundContext';
import Snow from 'modules/Elements/Snow';
import { colorSets } from 'mo... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/GameScreens.tsx | src/modules/Elements/GameScreens.tsx | import styled from '@emotion/styled';
import { typography } from 'modules/Elements/cssMixins';
import styles, { colorSets } from 'modules/GameEngine/Drawing/styles';
export const GameScreens = styled.div`
:root {
// not sure if this will be needed :shrug:
--player-blue-text: ${colorSets.blue.text};
--pla... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Badge.tsx | src/modules/Elements/Badge.tsx | import styled from '@emotion/styled';
import { typography } from 'modules/Elements/cssMixins';
import styles from 'modules/GameEngine/Drawing/styles';
export const Badge = styled.span`
position: absolute;
transform: translate(40%, -50%);
top: 0;
right: 0;
background: ${styles.colors.text.active};
font-siz... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Button.stories.tsx | src/modules/Elements/Button.stories.tsx | import { Meta, StoryFn } from '@storybook/react';
import { ComponentProps } from 'react';
import { Button } from './Button';
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
title: 'Legacy/Button',
component: Button,
} as Meta<ComponentProp... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/NoPrerender.tsx | src/modules/Elements/NoPrerender.tsx | import isPreRendering from 'modules/utils/isPreRendering';
import { PropsWithChildren } from 'react';
export default function NoPrerender(props: PropsWithChildren) {
if (isPreRendering) {
return null;
}
return props.children;
}
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/MenuWithLogo.tsx | src/modules/Elements/MenuWithLogo.tsx | import { Menu } from 'modules/Elements/AKUI/Menu';
import { useBackground } from 'modules/Elements/BackgroundContext';
import Logo from 'modules/Elements/Logo';
import RecommendedBrowsers from 'modules/Elements/RecommendedBrowsers';
import { PropsWithChildren } from 'react';
import LayoutGame from 'routes/LayoutGame';
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/LayoutWithBackgroundEmotion.tsx | src/modules/Elements/LayoutWithBackgroundEmotion.tsx | import { css } from '@emotion/react';
import styled from '@emotion/styled';
import { colorSets } from 'modules/GameEngine/Drawing/styles';
import React, { useState } from 'react';
import { GraphicSetting, useSettingValue } from 'routes/Settings/SettingsState';
import { BackgroundContext } from './BackgroundContext';
im... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/ErrorFallback.tsx | src/modules/Elements/ErrorFallback.tsx | import styled from '@emotion/styled';
import { Warning } from '@mui/icons-material';
import { FallbackRender } from '@sentry/react';
import localForage from 'localforage';
import { MenuButton } from 'modules/Elements/Menu';
import MenuWithLogo from 'modules/Elements/MenuWithLogo';
import storage from 'modules/utils/sto... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Modal.tsx | src/modules/Elements/Modal.tsx | import styled from '@emotion/styled';
import { AnimatePresence, motion } from 'motion/react';
import { PropsWithChildren } from 'react';
interface Props extends PropsWithChildren {
open: boolean;
onClose?: () => void;
}
export default function Modal({ children, open, onClose }: Props) {
return (
<AnimatePres... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Autocomplete.tsx | src/modules/Elements/Autocomplete.tsx | import styled from '@emotion/styled';
import { typography } from 'modules/Elements/cssMixins';
import { Input } from 'modules/Elements/Input';
import { nextIndex } from 'modules/Elements/Utils/indexes';
import styles from 'modules/GameEngine/Drawing/styles';
import {
ComponentProps,
ComponentRef,
KeyboardEventHan... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/RecommendedBrowsers.tsx | src/modules/Elements/RecommendedBrowsers.tsx | import Box from 'modules/Elements/AKUI/Primitives/Box';
import Typography from 'modules/Elements/AKUI/Primitives/Typography';
import isChromium from 'modules/utils/isChromium';
function RecommendedBrowsers() {
return (
<>
{!isChromium() && (
<Box className="w-full rounded-none bg-red-900 py-12 text... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/MicIcon.tsx | src/modules/Elements/MicIcon.tsx | import { SVGProps } from 'react';
import { twc } from 'react-twc';
interface Props extends SVGProps<SVGSVGElement> {
christmas?: boolean;
}
export const MicIcon = ({ christmas, ...props }: Props) => (
<svg viewBox="0 0 512 512" fill="currentcolor" {...props}>
<path
stroke="black"
strokeWidth="2%"
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Autocomplete.spec.tsx | src/modules/Elements/Autocomplete.spec.tsx | import { expect, test } from '@playwright/experimental-ct-react';
import { AutocompleteTestWrapper } from 'modules/Elements/Autocomplete';
test.use({ viewport: { width: 500, height: 500 } });
test('should properly input using the autocomplete box', async ({ mount }) => {
const component = await mount(
<Autocomp... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/VolumeIndicator.tsx | src/modules/Elements/VolumeIndicator.tsx | import styled from '@emotion/styled';
import styles from 'modules/GameEngine/Drawing/styles';
import PlayersManager from 'modules/Players/PlayersManager';
import { usePlayerMicData } from 'modules/hooks/players/usePlayerMic';
import { ComponentProps, ForwardedRef, forwardRef, useCallback, useMemo, useRef } from 'react'... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Button.tsx | src/modules/Elements/Button.tsx | import { css } from '@emotion/react';
import styles from 'modules/GameEngine/Drawing/styles';
import { Button as AKUIButton } from 'modules/Elements/AKUI/Button';
import isE2E from 'modules/utils/isE2E';
/* eslint-disable react-refresh/only-export-components */
export const buttonFocusedAnimated = css`
@keyframes b... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Switcher.tsx | src/modules/Elements/Switcher.tsx | import styled from '@emotion/styled';
import { InputWrapper } from 'modules/Elements/AKUI/InputWrapper';
import { typography } from 'modules/Elements/cssMixins';
import styles from 'modules/GameEngine/Drawing/styles';
import { AnimatePresence, motion } from 'motion/react';
import { ComponentProps, PropsWithChildren, Re... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Menu.tsx | src/modules/Elements/Menu.tsx | import { Menu } from 'modules/Elements/AKUI/Menu';
export const MenuButton = Menu.Button;
export const MenuContainer = Menu;
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/GameTip.tsx | src/modules/Elements/GameTip.tsx | import { QrCode2 } from '@mui/icons-material';
import { randomInt } from 'modules/utils/randomValue';
import { HTMLProps, ReactNode, useMemo } from 'react';
const data = [
<>
You can follow the updates and give feedback on the game through the Facebook Page:{' '}
<a href="https://www.facebook.com/allkaraoke.... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Loader.tsx | src/modules/Elements/Loader.tsx | import CircularProgress from '@mui/material/CircularProgress';
import { ComponentProps } from 'react';
export default function Loader(props: ComponentProps<typeof CircularProgress>) {
return <CircularProgress {...props} />;
}
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/PageLoader.tsx | src/modules/Elements/PageLoader.tsx | import styled from '@emotion/styled';
import { useEffect, useState } from 'react';
import LogoIcon from 'routes/LandingPage/LogoIcon';
export default function PageLoader() {
const [visible, setVisible] = useState(false);
useEffect(() => {
const timeout = setTimeout(() => {
setVisible(true);
}, 500);
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Flag.tsx | src/modules/Elements/Flag.tsx | import styled from '@emotion/styled';
import { Song } from 'interfaces';
import languageNameToIsoCode from 'modules/utils/languageNameToIsoCode';
import { ComponentProps, useLayoutEffect, useState } from 'react';
const overrides = import.meta.glob<string>('./Flag/flags/*.svg', { query: '?url', eager: true, import: 'de... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Input.tsx | src/modules/Elements/Input.tsx | import styled from '@emotion/styled';
import { InputWrapper } from 'modules/Elements/AKUI/InputWrapper';
import { typography } from 'modules/Elements/cssMixins';
import styles from 'modules/GameEngine/Drawing/styles';
import { REGULAR_ALPHA_CHARS } from 'modules/hooks/useKeyboard';
import { AnimatePresence, motion } fr... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Tooltip.tsx | src/modules/Elements/Tooltip.tsx | import styled from '@emotion/styled';
import { typography } from 'modules/Elements/cssMixins';
import styles from 'modules/GameEngine/Drawing/styles';
import storage from 'modules/utils/storage';
import { cloneElement, ComponentProps, ReactElement, useCallback, useEffect, useMemo, useRef, useState } from 'react';
impor... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/AKUI/Button.stories.tsx | src/modules/Elements/AKUI/Button.stories.tsx | import { Meta, StoryFn } from '@storybook/react';
import { ComponentProps } from 'react';
import { Button, ButtonLink } from './Button';
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
title: 'AKUI/Button',
component: Button,
} as Meta<Com... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/AKUI/InputWrapper.tsx | src/modules/Elements/AKUI/InputWrapper.tsx | import { ReactNode } from 'react';
import Typography from './Primitives/Typography';
export const InputWrapper = (props: React.PropsWithChildren<{ info?: ReactNode }>) => {
const { info, children } = props;
if (!info) {
return children;
}
return (
<div className="flex flex-col gap-2">
{children... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/AKUI/Checkbox.tsx | src/modules/Elements/AKUI/Checkbox.tsx | import { CheckBox, CheckBoxOutlineBlank } from '@mui/icons-material';
import { MenuButton } from 'modules/Elements/Menu';
import { twMerge } from 'tailwind-merge';
export const Checkbox = ({
checked = false,
className,
...props
}: React.ComponentProps<typeof MenuButton> & { checked?: boolean }) => {
return (
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/AKUI/Button.tsx | src/modules/Elements/AKUI/Button.tsx | import Box from 'modules/Elements/AKUI/Primitives/Box';
import isE2E from 'modules/utils/isE2E';
import { ComponentProps, ComponentType, HTMLProps, PropsWithChildren, ReactNode } from 'react';
import { twc } from 'react-twc';
import { twMerge } from 'tailwind-merge';
export const ButtonBase = twc(Box)((props) => {
r... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/AKUI/types.ts | src/modules/Elements/AKUI/types.ts | export type PolymorphicProps<E extends React.ElementType> = React.PropsWithChildren<
React.ComponentPropsWithoutRef<E> & {
as?: E;
}
>;
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/AKUI/Menu.tsx | src/modules/Elements/AKUI/Menu.tsx | import { MenuButton } from 'modules/Elements/AKUI/Menu/MenuButton';
import Box from 'modules/Elements/AKUI/Primitives/Box';
import Typography from 'modules/Elements/AKUI/Primitives/Typography';
import { HTMLProps, PropsWithChildren, ReactNode } from 'react';
import { twc } from 'react-twc';
const MenuContainer = twc(
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/AKUI/Menu/Menu.stories.tsx | src/modules/Elements/AKUI/Menu/Menu.stories.tsx | import { Meta, StoryFn } from '@storybook/react';
import { ComponentProps } from 'react';
import { Menu } from '../Menu';
// More on default export: https://storybook.js.org/docs/react/writing-stories/introduction#default-export
export default {
title: 'AKUI/Menu',
component: Menu,
} as Meta<ComponentProps<typeof ... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/AKUI/Menu/MenuButton.tsx | src/modules/Elements/AKUI/Menu/MenuButton.tsx | import { Button, ButtonLink } from 'modules/Elements/AKUI/Button';
import { InputWrapper } from 'modules/Elements/AKUI/InputWrapper';
import { ComponentProps, ReactNode } from 'react';
type Props = Omit<ComponentProps<typeof Button> | ComponentProps<typeof ButtonLink>, 'size'> & {
info?: ReactNode;
size?: 'regular... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/AKUI/Primitives/Typography.tsx | src/modules/Elements/AKUI/Primitives/Typography.tsx | import { PolymorphicProps } from 'modules/Elements/AKUI/types';
import { ElementType } from 'react';
import { twMerge } from 'tailwind-merge';
type Props<T extends ElementType> = PolymorphicProps<T> & {
active?: boolean;
};
export function Typography<T extends ElementType = 'span'>({ as, className, children, active... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/AKUI/Primitives/Box.tsx | src/modules/Elements/AKUI/Primitives/Box.tsx | import { PolymorphicProps } from 'modules/Elements/AKUI/types';
import { ElementType } from 'react';
import { twMerge } from 'tailwind-merge';
type Props<T extends ElementType> = PolymorphicProps<T>;
export default function Box<T extends ElementType = 'div'>({ as, className, children, ...props }: Props<T>) {
const ... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Utils/indexes.ts | src/modules/Elements/Utils/indexes.ts | import { ValuesType } from 'utility-types';
export function nextIndex<T extends readonly any[]>(values: T, current: number, direction: 1 | -1 = 1): number {
return direction === 1 ? (current + 1) % values.length : (current + values.length - 1) % values.length;
}
export function nextValueIndex<T extends readonly any... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Menu/Heading.tsx | src/modules/Elements/Menu/Heading.tsx | import styled from '@emotion/styled';
import { ComponentProps } from 'react';
export const Heading = styled.h1`
display: flex;
justify-content: center;
align-items: center;
position: relative;
`;
// From https://codepen.io/haniotis/pen/KwvYLO
const SCompletedAnim = styled.svg`
--curve: cubic-bezier(0.65, 0,... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Flag/mapping.ts | src/modules/Elements/Flag/mapping.ts | /**
* https://en.wikipedia.org/wiki/List_of_official_languages_by_country_and_territory
const data = {};
(() => {
let countryCodes = (() => {
const langNames = new Intl.DisplayNames(['en'], { type: 'region' });
const langMap = {};
for (let i = 0; i < 26; i++) {
for (let j = 0; j < 26; j++) {
let code = String... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/VideoPlayer/VideoState.tsx | src/modules/Elements/VideoPlayer/VideoState.tsx | export enum VideoState {
UNSTARTED = 'UNSTARTED',
ENDED = 'ENDED',
PLAYING = 'PLAYING',
PAUSED = 'PAUSED',
BUFFERING = 'BUFFERING',
CUED = 'CUED',
}
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/VideoPlayer/DirectVideo.tsx | src/modules/Elements/VideoPlayer/DirectVideo.tsx | import {
ComponentProps,
ForwardedRef,
forwardRef,
useEffect,
useImperativeHandle,
useMemo,
useRef,
useState,
} from 'react';
import { VideoState } from 'modules/Elements/VideoPlayer/VideoState';
import sleep from 'modules/utils/sleep';
import Youtube, { VideoPlayerRef } from './Youtube';
type Props =... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/VideoPlayer/Offline.tsx | src/modules/Elements/VideoPlayer/Offline.tsx | import { ComponentProps, ForwardedRef, forwardRef } from 'react';
import DirectVideo from 'modules/Elements/VideoPlayer/DirectVideo';
import Youtube, { VideoPlayerRef } from './Youtube';
import dummyLongVideo from './dummy-video-long.webm';
import dummyVideo from './dummy-video.webm';
type Props = ComponentProps<type... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/VideoPlayer/index.tsx | src/modules/Elements/VideoPlayer/index.tsx | import isE2E from 'modules/utils/isE2E';
import { ComponentProps, ForwardedRef, forwardRef } from 'react';
import OfflineVideoPlayer from './Offline';
import YoutubeVideoPlayer, { VideoPlayerRef } from './Youtube';
const VideoPlayer = forwardRef(
(props: ComponentProps<typeof YoutubeVideoPlayer>, ref: ForwardedRef<V... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/VideoPlayer/Youtube.tsx | src/modules/Elements/VideoPlayer/Youtube.tsx | import { seconds } from 'interfaces';
import { VideoState } from 'modules/Elements/VideoPlayer/VideoState';
import usePlayerVolume from 'modules/hooks/usePlayerVolume';
import useUnstuckYouTubePlayer from 'modules/hooks/useUnstuckYouTubePlayer';
import { ForwardedRef, forwardRef, useImperativeHandle, useRef, useState }... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Elements/Background/Eurovision.tsx | src/modules/Elements/Background/Eurovision.tsx | import {
eurovisionBlueFillBase,
eurovisionGreenFillBase,
eurovisionPinkFillBase,
eurovisionRedFillBase,
} from 'modules/GameEngine/Drawing/styles';
import { useEffect, useRef } from 'react';
import { useWindowSize } from 'react-use';
import eurovisionIcon from './eurovision-icon.png';
const icon = new Image()... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Stats/lastVisit.ts | src/modules/Stats/lastVisit.ts | import storage from 'modules/utils/storage';
const CURRENT_VISIT_KEY = 'CURRENT_VISIT_KEY';
const LAST_VISIT_KEY = 'LAST_VISIT_KEY';
const VISIT_TIMEOUT_MS = 3 * 60 * 60 * 1_000;
const currentTime = Date.now();
const currentVisit = Number(storage.local?.getItem(CURRENT_VISIT_KEY) ?? currentTime);
// One of the few ... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Stats/players.ts | src/modules/Stats/players.ts | import { PLAYER_NAMES_SESSION_STORAGE_KEY, PREVIOUS_PLAYER_NAMES_STORAGE_KEY } from 'modules/hooks/players/consts';
import events from 'modules/GameEvents/GameEvents';
import PlayersManager from 'modules/Players/PlayersManager';
import { isNonNull } from 'modules/utils/isNonNull';
import storage from 'modules/utils/st... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Stats/index.ts | src/modules/Stats/index.ts | import 'modules/Songs/stats/eventListeners';
import './lastVisit';
import './players';
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils.ts | src/modules/Songs/utils.ts | import { Song, SongPreview } from 'interfaces';
import clearString from '../utils/clearString';
import getSongId from './utils/getSongId';
import { getFirstNoteStartFromSections } from './utils/notesSelectors';
const generateSearchString = (song: Pick<Song, 'title' | 'artist'>) => clearString(`${song.artist}${song.tit... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/RemoteMicSongList.ts | src/modules/Songs/RemoteMicSongList.ts | import { uniq } from 'es-toolkit';
import events from 'modules/GameEvents/GameEvents';
import { NetworkRemoteMicMyListMessage } from 'modules/RemoteMic/Network/messages';
import Listener from 'modules/utils/Listener';
class RemoteMicSongList extends Listener<[string[]]> {
private lists: Record<string, string[]> = {}... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/SongsService.ts | src/modules/Songs/SongsService.ts | import dayjs from 'dayjs';
import { Song, SongPreview } from 'interfaces';
import convertTxtToSong from 'modules/Songs/utils/convertTxtToSong';
import { generatePlayerChangesForTrack } from 'modules/Songs/utils/generatePlayerChanges';
import getSongId from 'modules/Songs/utils/getSongId';
import mergeTracks from 'modul... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/hooks/useLanguageList.ts | src/modules/Songs/hooks/useLanguageList.ts | import { SongPreview } from 'interfaces';
import { useMemo } from 'react';
export const useLanguageList = (list: Pick<SongPreview, 'language'>[]) => {
return useMemo(() => {
const langs: Record<string, { name: string; count: number }> = {};
list.forEach((song) => {
if (!song.language) return;
co... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/hooks/useSong.ts | src/modules/Songs/hooks/useSong.ts | import { Song } from 'interfaces';
import SongDao from 'modules/Songs/SongsService';
import { processSong } from 'modules/Songs/utils/processSong/processSong';
import { useEffect, useState } from 'react';
export default function useSong(songId: string) {
const [song, setSong] = useState<Song | null>(null);
useEff... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/hooks/useRemoteMicSongList.ts | src/modules/Songs/hooks/useRemoteMicSongList.ts | import remoteMicSongList from 'modules/Songs/RemoteMicSongList';
import { useEffect, useState } from 'react';
export default function useRemoteMicSongList() {
const [list, setList] = useState<string[]>(() => remoteMicSongList.getSongList());
useEffect(() => {
remoteMicSongList.addListener(setList);
retur... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/hooks/useSetlist.ts | src/modules/Songs/hooks/useSetlist.ts | import { decodeSongList, SetlistEntity } from 'modules/Songs/utils/setlists';
import storage from 'modules/utils/storage';
const currentSetlist = storage.session.getItem<SetlistEntity | null>('currentSetlist');
const urlParams = new URLSearchParams(window.location.search);
const setlistParam = urlParams.get('setlist'... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/hooks/useSongIndex.ts | src/modules/Songs/hooks/useSongIndex.ts | import { useSetlist } from 'modules/Songs/hooks/useSetlist';
import SongDao from 'modules/Songs/SongsService';
import { useCallback, useEffect, useMemo, useState } from 'react';
export default function useSongIndex(includeDeleted = false) {
const currentIndex = SongDao.getCurrentIndex();
const [songIndex, setSongI... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/stats/common.ts | src/modules/Songs/stats/common.ts | import { SingSetup, SongPreview } from 'interfaces';
import SongsService from 'modules/Songs/SongsService';
import storage from 'modules/utils/storage';
let store: Promise<LocalForage | typeof storage.memory> | null = null;
async function getStorage() {
if (!store) {
if ('localStorage' in globalThis) {
tr... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/stats/eventListeners.ts | src/modules/Songs/stats/eventListeners.ts | import localForage from 'localforage';
import events from 'modules/GameEvents/GameEvents';
import { getSongKey, SongStats, storeSongStats } from 'modules/Songs/stats/common';
events.songEnded.subscribe(async (song, setup, scores, progress) => {
if (scores.every((score) => score.score === 0)) {
return;
}
let ... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/stats/hooks.ts | src/modules/Songs/stats/hooks.ts | import { SongPreview } from 'interfaces';
import events from 'modules/GameEvents/GameEvents';
import { useEventEffect } from 'modules/GameEvents/hooks';
import { SongStats, fetchSongStats, getSongKey, storeSongStats } from 'modules/Songs/stats/common';
import { useEffect, useState } from 'react';
export const useSongS... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/getSongFirstNoteMs.ts | src/modules/Songs/utils/getSongFirstNoteMs.ts | import { milliseconds, Song, SongPreview } from 'interfaces';
import beatToMs from 'modules/GameEngine/GameState/Helpers/beatToMs';
import { getFirstNoteStartFromSections } from 'modules/Songs/utils/notesSelectors';
export default function getSongFirstNoteMs(song: Song | SongPreview): milliseconds {
const firstNote ... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/getSongId.ts | src/modules/Songs/utils/getSongId.ts | import { Song, SongPreview } from 'interfaces';
import { removeAccents } from '../../utils/clearString';
export function normalizeSting(str: string) {
return (
removeAccents(str)
.toLowerCase()
/// remove non-alphanumeric characters and replace spaces with dashes
.replace(/[^a-z0-9\s-]/g, '')
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/convertTxtToSong.ts | src/modules/Songs/utils/convertTxtToSong.ts | import { ExtractOptional, NotesSection, Section, Song } from 'interfaces';
import { ValuesType } from 'utility-types';
import notFalsy from '../../utils/notFalsy';
import { generatePlayerChangesForTrack } from './generatePlayerChanges';
import getSongId from './getSongId';
import mergeTracks from './mergeTracks';
expo... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/specialSongsThemeChecks.ts | src/modules/Songs/utils/specialSongsThemeChecks.ts | import { Song, SongPreview } from 'interfaces';
import clearString from 'modules/utils/clearString';
export function isChristmasSong(song: SongPreview | Song) {
return clearString(song.edition ?? '') === 'christmas';
}
export const getEurovisionYear = (song: SongPreview | Song) => {
return (
song.edition
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/generatePlayerChanges.test.ts | src/modules/Songs/utils/generatePlayerChanges.test.ts | import { readFileSync } from 'fs';
import convertTxtToSong from 'modules/Songs/utils/convertTxtToSong';
import generatePlayerChanges from 'modules/Songs/utils/generatePlayerChanges';
import { generateSection, generateSong } from 'modules/utils/testUtils';
describe('generatePlayerChanges', () => {
it('should generate... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/convertSongToTxt.test.ts | src/modules/Songs/utils/convertSongToTxt.test.ts | import convertSongToTxt from 'modules/Songs/utils/convertSongToTxt';
import { mulitrack } from 'modules/Songs/utils/song-fixture';
describe('convertSongToTxt', () => {
it('should properly convert the song', () => {
expect(convertSongToTxt(mulitrack)).toMatchSnapshot();
});
it('should use known metadata keys... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/isNotesSection.ts | src/modules/Songs/utils/isNotesSection.ts | import { NotesSection, Section } from 'interfaces';
export default function isNotesSection(section: Section | undefined | null): section is NotesSection {
return section?.type === 'notes' && !!section.notes.length;
}
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/mergeTracks.test.ts | src/modules/Songs/utils/mergeTracks.test.ts | import { readFileSync } from 'fs';
import { Song, SongTrack } from 'interfaces';
import convertTxtToSong from 'modules/Songs/utils/convertTxtToSong';
import isNotesSection from 'modules/Songs/utils/isNotesSection';
import mergeTracks from 'modules/Songs/utils/mergeTracks';
import { getLastNoteEnd } from 'modules/Songs/... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/song-fixture.ts | src/modules/Songs/utils/song-fixture.ts | import { Song } from 'interfaces';
export const mulitrack: Song = {
id: 'multitrack',
shortId: 1,
artist: 'E2ETest',
artistOrigin: undefined,
title: 'Multitrack',
video: 'koBUXESJZ8g',
language: ['Polish'],
year: '1994',
gap: 1000,
bpm: 350,
bar: 4,
sourceUrl: undefined,
author: undefined,
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/setlists.ts | src/modules/Songs/utils/setlists.ts | export const encodeSongList = (songList: number[], isEditable: boolean) => {
return (isEditable ? '1' : '0') + songList.map((song) => song.toString(36).padStart(3, '0')).join('');
};
export interface SetlistEntity {
songList: number[] | null;
isEditable: boolean;
}
export const decodeSongList = ([editableMarked... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/convertTxtToSong.test.ts | src/modules/Songs/utils/convertTxtToSong.test.ts | import { readdirSync, readFileSync } from 'fs';
import { Note, Section, Song } from 'interfaces';
import convertSongToTxt from 'modules/Songs/utils/convertSongToTxt';
import convertTxtToSong, { txtTypesMap } from 'modules/Songs/utils/convertTxtToSong';
import isNotesSection from 'modules/Songs/utils/isNotesSection';
im... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/importSongsFromPostHog.ts | src/modules/Songs/utils/importSongsFromPostHog.ts | import { Song } from 'interfaces';
import SongsService from 'modules/Songs/SongsService';
import storage from 'modules/utils/storage';
import { importSongsFromPostHogBase } from './importSongsFromPostHogBase';
const importSongsFromPostHog = async () => {
const posthogKey = storage.session.getItem('posthog_key') || p... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/generatePlayerChanges.ts | src/modules/Songs/utils/generatePlayerChanges.ts | import { NotesSection, Section, Song, SongTrack } from 'interfaces';
import range from '../../utils/range';
import getSongBeatLength from './getSongBeatLength';
import isNotesSection from './isNotesSection';
import { getFirstNoteStartFromSections, getLastNoteEndFromSections } from './notesSelectors';
const MAX_SECTION... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/isSongRecentlyUpdated.ts | src/modules/Songs/utils/isSongRecentlyUpdated.ts | import dayjs from 'dayjs';
import { SongPreview } from 'interfaces';
const after = dayjs().subtract(31, 'days');
export default function isSongRecentlyUpdated(song: SongPreview): boolean {
return !!song.lastUpdate && dayjs(song.lastUpdate).isAfter(after);
}
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/getSongBeatCount.ts | src/modules/Songs/utils/getSongBeatCount.ts | import { Song } from 'interfaces';
import isNotesSection from 'modules/Songs/utils/isNotesSection';
import { getLastNoteEnd } from 'modules/Songs/utils/notesSelectors';
export default function getSongBeatCount(song: Song) {
return Math.max(
...song.tracks.map((track) => {
const lastNoteSection = track.sect... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/notesSelectors.ts | src/modules/Songs/utils/notesSelectors.ts | import { milliseconds, NotesSection, Section, Song, songBeat } from 'interfaces';
import getSongBeatLength from './getSongBeatLength';
import isNotesSection from './isNotesSection';
export const getFirstNoteFromSection = (sections: Section[]) => {
const firstNoteSection = sections.find(isNotesSection);
return firs... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/convertSongToTxt.ts | src/modules/Songs/utils/convertSongToTxt.ts | import { Note, Song } from 'interfaces';
import notFalsy from '../../utils/notFalsy';
import { knownSongTxtKeys, txtTypesMap } from './convertTxtToSong';
import isNotesSection from './isNotesSection';
function toTxtValue(key: knownSongTxtKeys, value: string | string[] | number | undefined) {
if (value === undefined)... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/importSongsFromPostHogBase.ts | src/modules/Songs/utils/importSongsFromPostHogBase.ts | import { Song, SongPreview } from 'interfaces';
import convertTxtToSong from './convertTxtToSong';
import getSongId from './getSongId';
const API_URL = 'https://eu.posthog.com';
const PROJECT_ID = '281';
const AFTER_DATE = new Date(Date.now() - 1000 * 3600 * 24 * 28).toISOString();
const suffixes = ['(tv)', '(album v... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/getSkipIntroTime.ts | src/modules/Songs/utils/getSkipIntroTime.ts | import { seconds, Song, SongPreview } from 'interfaces';
import getSongFirstNoteMs from 'modules/Songs/utils/getSongFirstNoteMs';
import isDev from 'modules/utils/isDev';
import isE2E from 'modules/utils/isE2E';
export const SKIP_INTRO_MS = isDev() || isE2E() ? 1_000 : 8_000;
export default function getSkipIntroTime(... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/mergeTracks.ts | src/modules/Songs/utils/mergeTracks.ts | import { NotesSection, Song, SongTrack } from 'interfaces';
import clearString from '../../utils/clearString';
import { generatePlayerChangesForTrack } from './generatePlayerChanges';
import isNotesSection from './isNotesSection';
import { getLastNoteEnd } from './notesSelectors';
const isBetween = (start: number, end... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/getSongBeatLength.ts | src/modules/Songs/utils/getSongBeatLength.ts | import { memoize } from 'es-toolkit';
import { milliseconds, Song, SongPreview } from 'interfaces';
export default memoize(function getSongBeatLength(song: Song | SongPreview): milliseconds {
return (60 / song.bpm / (song.bar ?? 4)) * 1000;
});
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/fixVideoGap.test.ts | src/modules/Songs/utils/processSong/fixVideoGap.test.ts | import fixVideoGap from 'modules/Songs/utils/processSong/fixVideoGap';
import { generateNote, generateSong } from 'modules/utils/testUtils';
describe('fixVideoGap', () => {
it('should change the video gap if its more than the start of the song', () => {
const song = generateSong(
[
[
{ ty... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/normaliseLyricSpaces.ts | src/modules/Songs/utils/processSong/normaliseLyricSpaces.ts | import { Note, Song, SongTrack } from 'interfaces';
import isNotesSection from 'modules/Songs/utils/isNotesSection';
const normaliseSpaces = (notes: Note[]): Note[] => {
notes.forEach((note, index) => {
if (note.lyrics.startsWith(' ')) {
note.lyrics = note.lyrics.trimStart();
if (index > 0) {
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/addHeadstart.ts | src/modules/Songs/utils/processSong/addHeadstart.ts | import { Section, Song, SongTrack } from 'interfaces';
import getSongBeatLength from 'modules/Songs/utils/getSongBeatLength';
import isNotesSection from 'modules/Songs/utils/isNotesSection';
import { HEADSTART_MS } from 'modules/Songs/utils/processSong/normaliseSectionPaddings';
const shiftSections = (sections: Sectio... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/normaliseSectionPaddings.ts | src/modules/Songs/utils/processSong/normaliseSectionPaddings.ts | import { NotesSection, Section, Song, SongTrack } from 'interfaces';
import getSongBeatLength from 'modules/Songs/utils/getSongBeatLength';
import isNotesSection from 'modules/Songs/utils/isNotesSection';
export const HEADSTART_MS = 1000;
const shortenNoteSections = (sections: NotesSection[]): NotesSection[] =>
sec... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/normaliseGap.ts | src/modules/Songs/utils/processSong/normaliseGap.ts | import { Section, Song, SongTrack } from 'interfaces';
import getSongBeatLength from 'modules/Songs/utils/getSongBeatLength';
import isNotesSection from 'modules/Songs/utils/isNotesSection';
import { getFirstNoteStartFromSections } from 'modules/Songs/utils/notesSelectors';
const shiftSections = (sections: Section[], ... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/normaliseLyricSpaces.test.ts | src/modules/Songs/utils/processSong/normaliseLyricSpaces.test.ts | import normaliseLyricSpaces from 'modules/Songs/utils/processSong/normaliseLyricSpaces';
import { generateNote, generateSong } from 'modules/utils/testUtils';
describe('normaliseLyricSpaces', () => {
it('should move prefix spaces to end of previous syllabe', () => {
const song = generateSong([
[
{
... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/normaliseGap.test.ts | src/modules/Songs/utils/processSong/normaliseGap.test.ts | import normaliseGap from 'modules/Songs/utils/processSong/normaliseGap';
import { generateNote, generateSong } from 'modules/utils/testUtils';
describe('normaliseGap', () => {
it('should normalise when first section and note doesnt start at 0', () => {
const song = generateSong(
[
[
{ typ... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/addHeadstart.test.ts | src/modules/Songs/utils/processSong/addHeadstart.test.ts | import addHeadstart from 'modules/Songs/utils/processSong/addHeadstart';
import { generateNote, generateSong } from 'modules/utils/testUtils';
describe('addHeadstart', () => {
it('should add desired headstart if theres enough gap of it', () => {
const song = generateSong(
[
[
{ type: 'not... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/processSong.ts | src/modules/Songs/utils/processSong/processSong.ts | import { Song } from 'interfaces';
import addHeadstart from 'modules/Songs/utils/processSong/addHeadstart';
import fixVideoGap from 'modules/Songs/utils/processSong/fixVideoGap';
import normaliseGap from 'modules/Songs/utils/processSong/normaliseGap';
import normaliseLyricSpaces from 'modules/Songs/utils/processSong/no... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/fixVideoGap.ts | src/modules/Songs/utils/processSong/fixVideoGap.ts | import { Song } from 'interfaces';
import getSongFirstNoteMs from 'modules/Songs/utils/getSongFirstNoteMs';
export default function fixVideoGap(song: Song) {
const firstNote = getSongFirstNoteMs(song);
return {
...song,
videoGap: Math.round(Math.max(0, Math.min(song.videoGap ?? 0, firstNote / 1000 - 15)))... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/Songs/utils/processSong/normaliseSectionPaddings.test.ts | src/modules/Songs/utils/processSong/normaliseSectionPaddings.test.ts | import normaliseSectionPaddings from 'modules/Songs/utils/processSong/normaliseSectionPaddings';
import { generateNote, generateSong } from 'modules/utils/testUtils';
describe('normaliseSectionPaddings', () => {
it('should add max possible padding to the next section if theres no space to optimal one', () => {
c... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/UserMedia/userMediaService.ts | src/modules/UserMedia/userMediaService.ts | import Listener from 'modules/utils/Listener';
type accessStatus = 'uninitialised' | 'requested' | 'accepted' | 'declined';
class UserMediaService extends Listener<[accessStatus]> {
private status: accessStatus = 'uninitialised';
public getUserMedia: typeof navigator.mediaDevices.getUserMedia = async (...args) =>... | typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Asvarox/allkaraoke | https://github.com/Asvarox/allkaraoke/blob/2143688edab9de7166d87a6c703a394abc450293/src/modules/UserMedia/hooks.ts | src/modules/UserMedia/hooks.ts | import userMediaService from 'modules/UserMedia/userMediaService';
import { useEffect, useState } from 'react';
export const useMicrophoneStatus = () => {
const [status, setStatus] = useState(userMediaService.getStatus());
useEffect(() => userMediaService.addListener(setStatus), []);
return status;
};
| typescript | MIT | 2143688edab9de7166d87a6c703a394abc450293 | 2026-01-05T04:35:37.445262Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.