mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-21 09:09:01 +00:00
Upgrade prettier
This commit is contained in:
parent
6185d95c47
commit
ebad033dbf
19 changed files with 69 additions and 94 deletions
|
|
@ -194,4 +194,3 @@
|
|||
left: 240px;
|
||||
top: 38px;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ body {
|
|||
font-size: 15px;
|
||||
}
|
||||
|
||||
::selection{
|
||||
::selection {
|
||||
background: none;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,8 +48,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
duration: 5.322286,
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Diablo_Swing_Orchestra_-_01_-_Heroines.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Diablo_Swing_Orchestra_-_01_-_Heroines.mp3",
|
||||
duration: 322.612245,
|
||||
metaData: {
|
||||
title: "Heroines",
|
||||
|
|
@ -58,8 +57,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Eclectek_-_02_-_We_Are_Going_To_Eclecfunk_Your_Ass.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Eclectek_-_02_-_We_Are_Going_To_Eclecfunk_Your_Ass.mp3",
|
||||
duration: 190.093061,
|
||||
metaData: {
|
||||
title: "We Are Going To Eclecfunk Your Ass",
|
||||
|
|
@ -68,8 +66,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Auto-Pilot_-_03_-_Seventeen.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Auto-Pilot_-_03_-_Seventeen.mp3",
|
||||
duration: 214.622041,
|
||||
metaData: {
|
||||
title: "Seventeen",
|
||||
|
|
@ -78,8 +75,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Muha_-_04_-_Microphone.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Muha_-_04_-_Microphone.mp3",
|
||||
duration: 181.838367,
|
||||
metaData: {
|
||||
title: "Microphone",
|
||||
|
|
@ -88,8 +84,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Just_Plain_Ant_-_05_-_Stumble.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Just_Plain_Ant_-_05_-_Stumble.mp3",
|
||||
duration: 86.047347,
|
||||
metaData: {
|
||||
title: "Stumble",
|
||||
|
|
@ -98,8 +93,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Sleaze_-_06_-_God_Damn.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Sleaze_-_06_-_God_Damn.mp3",
|
||||
duration: 226.795102,
|
||||
metaData: {
|
||||
title: "God Damn",
|
||||
|
|
@ -108,8 +102,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Juanitos_-_07_-_Hola_Hola_Bossa_Nova.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Juanitos_-_07_-_Hola_Hola_Bossa_Nova.mp3",
|
||||
duration: 207.072653,
|
||||
metaData: {
|
||||
title: "Hola Hola Bossa Nova",
|
||||
|
|
@ -118,8 +111,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Entertainment_for_the_Braindead_-_08_-_Resolutions_Chris_Summer_Remix.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Entertainment_for_the_Braindead_-_08_-_Resolutions_Chris_Summer_Remix.mp3",
|
||||
duration: 314.331429,
|
||||
metaData: {
|
||||
title: "Resolutions (Chris Summer Remix)",
|
||||
|
|
@ -128,8 +120,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Nobara_Hayakawa_-_09_-_Trail.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Nobara_Hayakawa_-_09_-_Trail.mp3",
|
||||
duration: 204.042449,
|
||||
metaData: {
|
||||
title: "Trail",
|
||||
|
|
@ -138,8 +129,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Paper_Navy_-_10_-_Tongue_Tied.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/Paper_Navy_-_10_-_Tongue_Tied.mp3",
|
||||
duration: 201.116735,
|
||||
metaData: {
|
||||
title: "Tongue Tied",
|
||||
|
|
@ -148,8 +138,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/60_Tigres_-_11_-_Garage.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/60_Tigres_-_11_-_Garage.mp3",
|
||||
duration: 245.394286,
|
||||
metaData: {
|
||||
title: "Garage",
|
||||
|
|
@ -158,8 +147,7 @@ export const defaultInitialTracks: URLTrack[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
url:
|
||||
"https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/CM_aka_Creative_-_12_-_The_Cycle_Featuring_Mista_Mista.mp3",
|
||||
url: "https://raw.githubusercontent.com/captbaritone/webamp-music/4b556fbf/CM_aka_Creative_-_12_-_The_Cycle_Featuring_Mista_Mista.mp3",
|
||||
duration: 221.44,
|
||||
metaData: {
|
||||
title: "The Cycle (Featuring Mista Mista)",
|
||||
|
|
|
|||
|
|
@ -107,12 +107,11 @@ function logEventFromAction(action: Action): GoogleAnalyticsEvent | null {
|
|||
return null;
|
||||
}
|
||||
|
||||
export const loggerMiddleware = () => (next: (action: Action) => void) => (
|
||||
action: Action
|
||||
) => {
|
||||
const event = logEventFromAction(action);
|
||||
if (event != null) {
|
||||
log(event);
|
||||
}
|
||||
return next(action);
|
||||
};
|
||||
export const loggerMiddleware =
|
||||
() => (next: (action: Action) => void) => (action: Action) => {
|
||||
const event = logEventFromAction(action);
|
||||
if (event != null) {
|
||||
log(event);
|
||||
}
|
||||
return next(action);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -70,9 +70,9 @@ async function main() {
|
|||
about.style.visibility = "hidden";
|
||||
}
|
||||
if (!WebampLazy.browserIsSupported()) {
|
||||
(document.getElementById(
|
||||
"browser-compatibility"
|
||||
) as HTMLDivElement).style.display = "block";
|
||||
(
|
||||
document.getElementById("browser-compatibility") as HTMLDivElement
|
||||
).style.display = "block";
|
||||
(document.getElementById("app") as HTMLDivElement).style.visibility =
|
||||
"hidden";
|
||||
return;
|
||||
|
|
@ -80,9 +80,9 @@ async function main() {
|
|||
about.classList.add("loaded");
|
||||
|
||||
if (isButterchurnSupported()) {
|
||||
(document.getElementById(
|
||||
"butterchurn-share"
|
||||
) as HTMLDivElement).style.display = "flex";
|
||||
(
|
||||
document.getElementById("butterchurn-share") as HTMLDivElement
|
||||
).style.display = "flex";
|
||||
}
|
||||
let soundcloudPlaylist = null;
|
||||
if (soundcloudPlaylistId != null) {
|
||||
|
|
|
|||
|
|
@ -18,10 +18,11 @@ export default function ContextMenuWraper({
|
|||
renderContents,
|
||||
...passThroughProps
|
||||
}: Props) {
|
||||
const [openPosition, setOpenPosition] = useState<{
|
||||
x: number;
|
||||
y: number;
|
||||
} | null>(null);
|
||||
const [openPosition, setOpenPosition] =
|
||||
useState<{
|
||||
x: number;
|
||||
y: number;
|
||||
} | null>(null);
|
||||
|
||||
const closeMenu = useCallback(() => {
|
||||
setOpenPosition(null);
|
||||
|
|
|
|||
|
|
@ -17,9 +17,10 @@ function EqGraph() {
|
|||
|
||||
const [canvasNode, setCanvasNode] = useState<HTMLCanvasElement | null>(null);
|
||||
|
||||
const canvasCtx = useMemo(() => canvasNode?.getContext("2d") ?? null, [
|
||||
canvasNode,
|
||||
]);
|
||||
const canvasCtx = useMemo(
|
||||
() => canvasNode?.getContext("2d") ?? null,
|
||||
[canvasNode]
|
||||
);
|
||||
const colorPattern = useColorPattern(canvasCtx);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
|
|
|
|||
|
|
@ -35,9 +35,8 @@ function Visualizer({ analyser, width, height }: Props) {
|
|||
const isEnabledVisualizer = visualizerStyle === VISUALIZERS.MILKDROP;
|
||||
|
||||
const canvasRef = useRef(null);
|
||||
const [visualizer, setVisualizer] = useState<ButterchurnVisualizer | null>(
|
||||
null
|
||||
);
|
||||
const [visualizer, setVisualizer] =
|
||||
useState<ButterchurnVisualizer | null>(null);
|
||||
|
||||
// Initialize the visualizer
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -16,9 +16,10 @@ function rightPad(str: string, len: number, fillChar: string): string {
|
|||
|
||||
const RunningTimeDisplay = () => {
|
||||
const runningTimeMessage = useTypedSelector(Actions.getRunningTimeMessage);
|
||||
const text = useMemo(() => rightPad(runningTimeMessage, 18, " "), [
|
||||
runningTimeMessage,
|
||||
]);
|
||||
const text = useMemo(
|
||||
() => rightPad(runningTimeMessage, 18, " "),
|
||||
[runningTimeMessage]
|
||||
);
|
||||
return (
|
||||
<div className="playlist-running-time-display draggable">
|
||||
{/* This div is probably not strictly needed */}
|
||||
|
|
|
|||
|
|
@ -16,9 +16,8 @@ interface Props {
|
|||
function ResizeTarget(props: Props) {
|
||||
const { currentSize, setWindowSize, widthOnly, ...passThroughProps } = props;
|
||||
const [mouseDown, setMouseDown] = useState(false);
|
||||
const [mouseStart, setMouseStart] = useState<null | { x: number; y: number }>(
|
||||
null
|
||||
);
|
||||
const [mouseStart, setMouseStart] =
|
||||
useState<null | { x: number; y: number }>(null);
|
||||
useEffect(() => {
|
||||
if (mouseDown === false || mouseStart == null) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -32,9 +32,8 @@ function useHandleMouseDown(propsWindows: {
|
|||
const browserWindowSize = useTypedSelector(Selectors.getBrowserWindowSize);
|
||||
const updateWindowPositions = useActionCreator(Actions.updateWindowPositions);
|
||||
|
||||
const [draggingState, setDraggingState] = useState<DraggingState | null>(
|
||||
null
|
||||
);
|
||||
const [draggingState, setDraggingState] =
|
||||
useState<DraggingState | null>(null);
|
||||
|
||||
// When the mouse is down, attach a listener to track mouse move events.
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -7,16 +7,7 @@ import {
|
|||
} from "./types";
|
||||
import baseSkin from "./baseSkin.json";
|
||||
export const BANDS: Band[] = [
|
||||
60,
|
||||
170,
|
||||
310,
|
||||
600,
|
||||
1000,
|
||||
3000,
|
||||
6000,
|
||||
12000,
|
||||
14000,
|
||||
16000,
|
||||
60, 170, 310, 600, 1000, 3000, 6000, 12000, 14000, 16000,
|
||||
];
|
||||
|
||||
export const WINDOWS = {
|
||||
|
|
|
|||
|
|
@ -162,10 +162,10 @@ export function useActionCreator<T extends (...args: any[]) => Action | Thunk>(
|
|||
actionCreator: T
|
||||
): (...funcArgs: Parameters<T>) => void {
|
||||
const dispatch = useDispatch();
|
||||
return useCallback((...args) => dispatch(actionCreator(...args)), [
|
||||
dispatch,
|
||||
actionCreator,
|
||||
]);
|
||||
return useCallback(
|
||||
(...args) => dispatch(actionCreator(...args)),
|
||||
[dispatch, actionCreator]
|
||||
);
|
||||
}
|
||||
|
||||
export function useTypedDispatch(): (action: Action | Thunk) => void {
|
||||
|
|
|
|||
|
|
@ -203,11 +203,8 @@ const windows = (
|
|||
})),
|
||||
};
|
||||
case LOAD_SERIALIZED_STATE: {
|
||||
const {
|
||||
genWindows,
|
||||
focused,
|
||||
positionsAreRelative,
|
||||
} = action.serializedState.windows;
|
||||
const { genWindows, focused, positionsAreRelative } =
|
||||
action.serializedState.windows;
|
||||
return {
|
||||
...state,
|
||||
positionsAreRelative,
|
||||
|
|
|
|||
|
|
@ -567,9 +567,10 @@ export function getEqualizerAuto(state: AppState): boolean {
|
|||
return state.equalizer.auto;
|
||||
}
|
||||
|
||||
export function getBrowserWindowSize(
|
||||
state: AppState
|
||||
): { height: number; width: number } {
|
||||
export function getBrowserWindowSize(state: AppState): {
|
||||
height: number;
|
||||
width: number;
|
||||
} {
|
||||
return state.windows.browserWindowSize;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -163,13 +163,10 @@ export const percentToRange = (percent: number, min: number, max: number) =>
|
|||
export const percentToIndex = (percent: number, length: number): number =>
|
||||
percentToRange(percent, 0, length - 1);
|
||||
|
||||
const rebound = (
|
||||
oldMin: number,
|
||||
oldMax: number,
|
||||
newMin: number,
|
||||
newMax: number
|
||||
) => (oldValue: number): number =>
|
||||
percentToRange(toPercent(oldMin, oldMax, oldValue), newMin, newMax);
|
||||
const rebound =
|
||||
(oldMin: number, oldMax: number, newMin: number, newMax: number) =>
|
||||
(oldValue: number): number =>
|
||||
percentToRange(toPercent(oldMin, oldMax, oldValue), newMin, newMax);
|
||||
|
||||
// Convert an .eqf value to a 0-100
|
||||
export const normalizeEqBand = rebound(1, 64, 0, 100);
|
||||
|
|
|
|||
|
|
@ -195,10 +195,8 @@ class Winamp {
|
|||
// TODO: Make this much cleaner
|
||||
let convertPreset = null;
|
||||
if (__butterchurnOptions != null) {
|
||||
const {
|
||||
importConvertPreset,
|
||||
presetConverterEndpoint,
|
||||
} = __butterchurnOptions;
|
||||
const { importConvertPreset, presetConverterEndpoint } =
|
||||
__butterchurnOptions;
|
||||
|
||||
if (importConvertPreset != null && presetConverterEndpoint != null) {
|
||||
convertPreset = async (file: File): Promise<Object> => {
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@
|
|||
"jest-puppeteer": "^4.4.0",
|
||||
"postcss": "^7.0.18",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"prettier": "^2.0.4",
|
||||
"prettier": "^2.3.0",
|
||||
"puppeteer": "^1.15.0",
|
||||
"react-test-renderer": "^17.0.1",
|
||||
"redux-devtools-extension": "^2.13.2",
|
||||
|
|
|
|||
|
|
@ -11782,6 +11782,11 @@ prettier@^2.0.4, prettier@^2.0.5:
|
|||
version "2.0.5"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4"
|
||||
|
||||
prettier@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
|
||||
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==
|
||||
|
||||
pretty-error@^2.0.2:
|
||||
version "2.1.1"
|
||||
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue