-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
362 additions
and
195 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from "react"; | ||
|
||
const Equalizer = () => { | ||
return ( | ||
<div className="gap-1 relative h-12 w-[18.75rem]"> | ||
<span className="bg-white w-4 h-full rounded-sm animate-equalizerBarOne absolute bottom-0" /> | ||
<span className="bg-white w-4 h-full rounded-sm animate-equalizerBarTwo absolute ml-5 bottom-0" /> | ||
<span className="bg-white w-4 h-full rounded-sm animate-equalizerBarThree absolute ml-10 bottom-0" /> | ||
<span className="bg-white w-4 h-full rounded-sm animate-equalizerBarFour absolute ml-[3.75rem] bottom-0" /> | ||
<span className="bg-white w-4 h-full rounded-sm animate-equalizerBarFive absolute ml-[5rem] bottom-0" /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Equalizer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React, { Dispatch, SetStateAction, FC } from "react"; | ||
import { VPause, VPlay } from "../__modules__/_Vectors"; | ||
|
||
interface PlayerControlerProps { | ||
index: number; | ||
isPlaying: number; | ||
isPaused: boolean; | ||
setIsPaused: Dispatch<SetStateAction<boolean>>; | ||
setIsPlaying: Dispatch<SetStateAction<number>>; | ||
} | ||
|
||
const PlayerController: FC<PlayerControlerProps> = ({ | ||
index, | ||
isPaused, | ||
isPlaying, | ||
setIsPaused, | ||
setIsPlaying, | ||
}) => { | ||
return ( | ||
<div | ||
onClick={() => { | ||
if (isPlaying === index && !isPaused) { | ||
setIsPaused(true); | ||
setIsPlaying(index); | ||
} else { | ||
setIsPaused(false); | ||
} | ||
setIsPlaying(index); | ||
}} | ||
className="px-4" | ||
> | ||
{isPlaying === index && !isPaused ? ( | ||
<VPause className="w-6 h-6" /> | ||
) : ( | ||
<VPlay className="w-6 h-6" /> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default PlayerController; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,55 @@ | ||
import React, { FC } from "react"; | ||
import { VPrev, VNext, VPlay, VPause } from "../../__modules__/_Vectors" | ||
interface AudioControlsProps{ | ||
isPlaying:boolean; | ||
onPlayPauseClick:Function; | ||
onPrevClick: Function; | ||
onNextClick:Function; | ||
import { VPrev, VNext, VPlay, VPause } from "../../__modules__/_Vectors"; | ||
interface AudioControlsProps { | ||
isPlaying: boolean; | ||
onPlayPauseClick: Function; | ||
onPrevClick: Function; | ||
onNextClick: Function; | ||
} | ||
|
||
const AudioControls: FC<AudioControlsProps> = ({ | ||
isPlaying, | ||
onPlayPauseClick, | ||
onPrevClick, | ||
onNextClick | ||
isPlaying, | ||
onPlayPauseClick, | ||
onPrevClick, | ||
onNextClick, | ||
}) => ( | ||
<div className="flex justify-center p-4 space-x-9"> | ||
<button | ||
type="button" | ||
className="prev" | ||
aria-label="Previous" | ||
onClick={()=>onPrevClick}> | ||
<VPrev className="w-12 h-12" /> | ||
</button> | ||
{isPlaying ? ( | ||
<button | ||
type="button" | ||
className="pause" | ||
onClick={() => onPlayPauseClick(false)} | ||
aria-label="Pause" | ||
> | ||
<VPause className="w-12 h-12" /> | ||
</button> | ||
) : ( | ||
<button | ||
type="button" | ||
className="play" | ||
onClick={() => onPlayPauseClick(true)} | ||
aria-label="Play" | ||
> | ||
<VPlay className="w-12 h-12" /> | ||
</button> | ||
)} | ||
<button | ||
type="button" | ||
className="next" | ||
aria-label="Next" | ||
onClick={()=>onNextClick} | ||
> | ||
<VNext className="w-12 h-12" /> | ||
</button> | ||
</div> | ||
<div className="flex justify-center p-4 space-x-9"> | ||
<button | ||
type="button" | ||
className="prev" | ||
aria-label="Previous" | ||
onClick={() => onPrevClick} | ||
> | ||
<VPrev className="w-12 h-12" /> | ||
</button> | ||
{isPlaying ? ( | ||
<button | ||
type="button" | ||
className="pause" | ||
onClick={() => onPlayPauseClick(false)} | ||
aria-label="Pause" | ||
> | ||
<VPause className="w-12 h-12" /> | ||
</button> | ||
) : ( | ||
<button | ||
type="button" | ||
className="play" | ||
onClick={() => onPlayPauseClick(true)} | ||
aria-label="Play" | ||
> | ||
<VPlay className="w-12 h-12" /> | ||
</button> | ||
)} | ||
<button | ||
type="button" | ||
className="next" | ||
aria-label="Next" | ||
onClick={() => onNextClick} | ||
> | ||
<VNext className="w-12 h-12" /> | ||
</button> | ||
</div> | ||
); | ||
|
||
export default AudioControls; |
Oops, something went wrong.