-
Notifications
You must be signed in to change notification settings - Fork 22
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
18 changed files
with
581 additions
and
310 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
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
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
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
47 changes: 47 additions & 0 deletions
47
src/components/Integrations/Spotify/Widgets/SongDetector/SdFloating.styles.tsx
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,47 @@ | ||
import { makeStyles } from '@mui/styles' | ||
|
||
const useStyles = makeStyles(() => ({ | ||
Widget: { | ||
padding: 0, | ||
overflow: 'hidden', | ||
borderRadius: 16, | ||
width: 500, | ||
maxWidth: '100%', | ||
minHeight: 400, | ||
margin: '0', | ||
position: 'relative', | ||
zIndex: 1, | ||
backgroundColor: '#2229', | ||
backdropFilter: 'blur(40px)', | ||
'@media (max-width: 720px)': { | ||
'&&': { | ||
width: 400 | ||
} | ||
}, | ||
'&.small': { | ||
'&&': { | ||
width: 400 | ||
} | ||
} | ||
} | ||
})) | ||
|
||
export const VolSliderStyles = { | ||
color: '#fff', | ||
'& .MuiSlider-track': { | ||
border: 'none' | ||
}, | ||
'& .MuiSlider-thumb': { | ||
width: 16, | ||
height: 16, | ||
backgroundColor: '#fff', | ||
'&:before': { | ||
boxShadow: '0 4px 8px rgba(0,0,0,0.4)' | ||
}, | ||
'&:hover, &.Mui-focusVisible, &.Mui-active': { | ||
boxShadow: 'none' | ||
} | ||
} | ||
} | ||
|
||
export default useStyles |
29 changes: 29 additions & 0 deletions
29
src/components/Integrations/Spotify/Widgets/SongDetector/SdFloating.tsx
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,29 @@ | ||
import { Rnd } from 'react-rnd' | ||
import useStore from '../../../../../store/useStore' | ||
|
||
const SdFloating = ({ children }: any) => { | ||
const sdX = useStore((state) => state.ui.sdX) | ||
const setSdX = useStore((state) => state.ui.setSdX) | ||
const sdY = useStore((state) => state.ui.sdY) | ||
const setSdY = useStore((state) => state.ui.setSdY) | ||
|
||
return ( | ||
<Rnd | ||
size={{ width: 960, height: 'auto' }} | ||
position={{ x: sdX, y: sdY }} | ||
onDragStop={(e, d) => { | ||
setSdX(d.x) | ||
setSdY(d.y) | ||
}} | ||
onResizeStop={(_e, _direction, ref, _delta, position) => { | ||
setSdX(position.x) | ||
setSdY(position.y) | ||
}} | ||
style={{ zIndex: 10 }} | ||
> | ||
{children} | ||
</Rnd> | ||
) | ||
} | ||
|
||
export default SdFloating |
23 changes: 23 additions & 0 deletions
23
src/components/Integrations/Spotify/Widgets/SongDetector/SongDetector.tsx
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,23 @@ | ||
import { Box, TextField } from '@mui/material' | ||
import useStore from '../../../../../store/useStore' | ||
import SpTexterForm from '../SpotifyWidgetPro/SpTexterForm' | ||
|
||
const SongDetector = () => { | ||
const currentTrack = useStore((state) => state.spotify.currentTrack) | ||
|
||
return ( | ||
<Box sx={{ padding: 2 }}> | ||
<TextField | ||
label="Song" | ||
size="small" | ||
disabled | ||
value={currentTrack} | ||
sx={{ marginBottom: 2 }} | ||
fullWidth | ||
/> | ||
{currentTrack && currentTrack.length > 3 && <SpTexterForm />} | ||
</Box> | ||
) | ||
} | ||
|
||
export default SongDetector |
Oops, something went wrong.