Skip to content

Commit f133951

Browse files
committed
fix responsiveness (final)
1 parent c7b75b7 commit f133951

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

src/pages/index.js

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Head from '@docusaurus/Head';
66
import Layout from '@theme/Layout';
77
import HomepageFeatures from '@site/src/components/HomepageFeatures';
88
import CodeEditor from '@site/src/components/CodeEditor2';
9-
import { Box,TextField,MenuItem } from '@mui/material';
9+
import { Box,TextField,MenuItem, Button } from '@mui/material';
1010
import useGeoLocation from "react-ipgeolocation";
1111
import { useColorMode } from '@docusaurus/theme-common';
1212
import { EditorView } from '@codemirror/view';
@@ -32,7 +32,7 @@ export const defaultLightThemeOption = EditorView.theme(
3232

3333

3434
import styles from './index.module.css';
35-
import { height, width } from '@mui/system';
35+
import { border, height, width } from '@mui/system';
3636

3737
//Array of Languages on right side of code editor
3838
const languages = [
@@ -463,28 +463,36 @@ export default function Home() {
463463
</div>
464464

465465
{/* IDE convertor button */}
466-
<button style={{
467-
opacity: 0.45,
468-
height: isMobile ? "fit" : "100%", // Adjust height
469-
width: "100%", // Adjust width
470-
// backgroundColor: isMobile ? "gray" : "transparent",
471-
borderRadius: '0.4rem',
472-
border: "none",
473-
cursor: "pointer",
474-
width: isMobile ? "100%" : "5%", // Full width on mobile
475-
fontSize: "1.5rem",
476-
padding: isMobile ? "10px 0" : 0, // Add padding on mobile
477-
// transform: isMobile ? "rotate(90deg)" : "none", // Rotate arrow on mobile
478-
margin: isMobile ? "10px 0" : 0, // Add margin on mobile
479-
}} onClick={()=>{
466+
<Button
467+
sx={{
468+
// opacity: 0.45,
469+
height: 'fit-content',
470+
width: { xs: '100%', md: '5%' },
471+
borderRadius: '0.4rem',
472+
border: 'none',
473+
cursor: 'pointer',
474+
fontSize: '1.5rem',
475+
p: { xs: '10px 0', md: 0 },
476+
m: { xs: '10px 0', md: 0 },
477+
display: 'flex',
478+
alignItems: 'center',
479+
justifyContent: 'center',
480+
// backgroundColor: 'transparent',
481+
// color: 'black',
482+
border: 'none',
483+
'&:hover': {
484+
opacity: 0.8,
485+
backgroundColor: 'rgba(0, 0, 0, 0.04)'
486+
},
487+
transition: 'all 0.3s ease'
488+
}} onClick={()=>{
480489
setTargetLanguage(sourceLanguage);
481490
setSourceLanguage(targetLanguage);
482491
var element = document.getElementById("python-code-editor2");
483492
setCode(element.innerHTML.replaceAll("<br>", "\n").replaceAll("&nbsp;", " "))
484493
}}>
485-
{/* &#8660; */}
486494
&#8644;
487-
</button>
495+
</Button>
488496

489497
<div
490498
style={{

0 commit comments

Comments
 (0)