-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add widget: Melbank Graph: ctrl+alt+m
- Loading branch information
Showing
5 changed files
with
167 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
src/components/Integrations/Spotify/Widgets/MGraphFlotaing/MGraphFloating.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,28 @@ | ||
import { Box } from '@mui/material' | ||
|
||
import useStyle from './MgFloating.styles' | ||
import MgFloating from './MgFloating' | ||
import MGraph from '../../../../MGraph' | ||
|
||
const MGraphFloating = () => { | ||
const classes = useStyle() | ||
|
||
return ( | ||
<Box component={MgFloating}> | ||
<div className={classes.Widget}> | ||
<Box | ||
bgcolor="#111" | ||
height={50} | ||
alignItems="center" | ||
justifyContent="center" | ||
display="flex" | ||
> | ||
Audio Graph | ||
</Box> | ||
<MGraph /> | ||
</div> | ||
</Box> | ||
) | ||
} | ||
|
||
export default MGraphFloating |
46 changes: 46 additions & 0 deletions
46
src/components/Integrations/Spotify/Widgets/MGraphFlotaing/MgFloating.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,46 @@ | ||
import { makeStyles } from '@mui/styles' | ||
|
||
const useStyles = makeStyles(() => ({ | ||
Widget: { | ||
padding: 0, | ||
overflow: 'hidden', | ||
borderRadius: 16, | ||
width: 960, | ||
maxWidth: '100%', | ||
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/MGraphFlotaing/MgFloating.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 MgFloating = ({ children }: any) => { | ||
const mgX = useStore((state) => state.ui.mgX) | ||
const setMgX = useStore((state) => state.ui.setMgX) | ||
const mgY = useStore((state) => state.ui.mgY) | ||
const setMgY = useStore((state) => state.ui.setMgY) | ||
|
||
return ( | ||
<Rnd | ||
size={{ width: 960, height: 'auto' }} | ||
position={{ x: mgX, y: mgY }} | ||
onDragStop={(e, d) => { | ||
setMgX(d.x) | ||
setMgY(d.y) | ||
}} | ||
onResizeStop={(_e, _direction, ref, _delta, position) => { | ||
setMgX(position.x) | ||
setMgY(position.y) | ||
}} | ||
style={{ zIndex: 10 }} | ||
> | ||
{children} | ||
</Rnd> | ||
) | ||
} | ||
|
||
export default MgFloating |
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