diff --git a/front/components/PartitionVisualizer/PhaserCanvas.tsx b/front/components/PartitionVisualizer/PhaserCanvas.tsx index 41d7d2e..eb7b4fa 100644 --- a/front/components/PartitionVisualizer/PhaserCanvas.tsx +++ b/front/components/PartitionVisualizer/PhaserCanvas.tsx @@ -24,7 +24,7 @@ const myFindLast = (a: T[], p: (_: T, _2: number) => boolean) => { } } return undefined; -} +}; const playNotes = (notes: PianoCursorNote[], soundPlayer: SplendidGrandPiano) => { notes.forEach(({ note, duration }) => { @@ -68,7 +68,7 @@ const getPianoScene = ( if (status === 'playing') { const transitionTime = 75; - const cP = myFindLast(cursorPositions, (cP: { timestamp: number; }, idx: number) => { + const cP = myFindLast(cursorPositions, (cP: { timestamp: number }, idx: number) => { if ( cP.timestamp < currentTimestamp + transitionTime && idx > this.cursorPositionsIdx diff --git a/front/views/PlayView.tsx b/front/views/PlayView.tsx index 5977e6a..d3f0bf0 100644 --- a/front/views/PlayView.tsx +++ b/front/views/PlayView.tsx @@ -152,7 +152,7 @@ const PlayView = ({ songId, type, route }: RouteProps) => { console.log('Websocket closed', endMsgReceived); if (!endMsgReceived) { toast.show({ description: 'Connection lost with Scorometer' }); - // the special case when the front send the end message succesfully + // the special case when the front send the end message succesfully // but the websocket is closed before the end message is received // is not handled return; @@ -268,109 +268,104 @@ const PlayView = ({ songId, type, route }: RouteProps) => { } return ( - - - - - - - setPartitionRendered(true)} + + + - {!partitionRendered && } - + + + + setPartitionRendered(true)} + /> + {!partitionRendered && } + - - + + - - Score: {score}% - - -
- {song.data.name} -
- - {midiKeyboardFound && ( - <> - + Score: {score}% + +
+
+ {song.data.name} +
+ + {midiKeyboardFound && ( + <> + } + onPress={() => { + if (paused) { + onResume(); + } else { + onPause(); } - onPress={() => { - if (paused) { - onResume(); - } else { - onPause(); - } - }} - /> - - {time < 0 - ? paused - ? '0:00' - : Math.floor((time % 60000) / 1000) - .toFixed(0) - .toString() - : `${Math.floor(time / 60000)}:${Math.floor( - (time % 60000) / 1000 - ) + }} + /> + + {time < 0 + ? paused + ? '0:00' + : Math.floor((time % 60000) / 1000) .toFixed(0) .toString() - .padStart(2, '0')}`} - - } - onPress={() => { - onEnd(); - }} - /> - - )} - + : `${Math.floor(time / 60000)}:${Math.floor( + (time % 60000) / 1000 + ) + .toFixed(0) + .toString() + .padStart(2, '0')}`} + + } + onPress={() => { + onEnd(); + }} + /> + + )}
-
+ +
); };