File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,8 @@ declare module 'react' {
1010 interface CSSProperties {
1111 '--diameter' ?: string ;
1212 '--delta' ?: string ;
13+ '--icon-size' ?: string ;
14+ '--button-size' ?: string ;
1315 }
1416}
1517
@@ -19,6 +21,9 @@ function CircularMenu({ circleSize }) {
1921 const linkChunks = _ . chunk ( itemsMenu ( ) , chunkSize ) ;
2022 const location = useLocation ( ) ;
2123
24+ const buttonSize = Math . min ( circleSize * 0.15 , 38 ) ;
25+ const iconSize = buttonSize - 8 ;
26+
2227 const calculateDiameter = ( index , circleSize ) => {
2328 const menuCircleDiameter = circleSize / 2 + 40 * ( index + 1 ) - 10 ;
2429 const nextLevelMenuAngle = index === 1 ? 11 : 0 ;
@@ -68,6 +73,8 @@ function CircularMenu({ circleSize }) {
6873 style = { {
6974 '--diameter' : `${ menuCircleDiameter } px` ,
7075 '--delta' : `${ nextLevelMenuAngle } deg` ,
76+ '--icon-size' : `${ iconSize } px` ,
77+ '--button-size' : `${ buttonSize } px` ,
7178 } }
7279 >
7380 { chunk . map ( ( item , index ) => {
Original file line number Diff line number Diff line change 55 opacity : 1 ;
66 background-color : #101010 ;
77 border-radius : 50% ;
8- width : 38px ;
9- height : 38px ;
8+ width : var ( --button-size , 38px ) ;
9+ height : var ( --button-size , 38px ) ;
1010 justify-content : center ;
1111 align-items : center ;
1212 display : flex ;
3030}
3131
3232.icon {
33- width : 30px ;
34- height : 30px ;
33+ width : var ( --icon-size , 30px ) ;
34+ height : var ( --icon-size , 30px ) ;
3535 object-fit : fill ;
3636 border-radius : 50% ;
3737 justify-content : center ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ function MainLayout({ children }: { children: JSX.Element }) {
2828 const dispatch = useAppDispatch ( ) ;
2929 const [ isRenderGraph , setIsRenderGraph ] = useState ( false ) ;
3030
31- const graphSize = 220 ;
31+ const graphSize = Math . min ( viewportWidth * 0.13 , 220 ) ;
3232 const isMobile =
3333 viewportWidth <= Number ( stylesOracle . mobileBreakpoint . replace ( 'px' , '' ) ) ;
3434
You can’t perform that action at this time.
0 commit comments