Skip to content

Commit e152a7b

Browse files
Fix font on all languages and removed unnecessary code
1 parent 4e37a05 commit e152a7b

File tree

3 files changed

+28
-114
lines changed

3 files changed

+28
-114
lines changed

src/css/custom.css

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,11 @@
77

88

99

10+
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300;400&display=swap');
1011

11-
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300&display=swap');
1212
/* You can override the default Infima variables here. */
1313
:root {
14-
/* --ifm-font-family-base: "Roboto Mono"; */
15-
/* --ifm-font-family-mono: "Robot Mono"; */
16-
/* --ifm-font-family-mono: "Roboto Mono"; */
14+
1715
--ifm-color-primary: #2e8555;
1816
--ifm-color-primary-dark: #29784c;
1917
--ifm-color-primary-darker: #277148;

src/pages/index.js

Lines changed: 25 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,10 @@ import Layout from '@theme/Layout';
77
import HomepageFeatures from '@site/src/components/HomepageFeatures';
88
import CodeEditor from '@site/src/components/CodeEditor2';
99
import { Box,TextField,MenuItem } from '@mui/material';
10-
import Select, { SelectChangeEvent } from '@mui/material/Select'
11-
12-
13-
14-
15-
1610
import useGeoLocation from "react-ipgeolocation";
17-
1811
import { useColorMode } from '@docusaurus/theme-common';
19-
20-
21-
import { EditorView } from '@codemirror/view';
22-
12+
import { EditorView } from '@codemirror/view';
2313
import { Blocks } from 'react-loader-spinner'
24-
2514
import useIsBrowser from '@docusaurus/useIsBrowser';
2615

2716

@@ -43,7 +32,7 @@ export const defaultLightThemeOption = EditorView.theme(
4332
import styles from './index.module.css';
4433
import { height } from '@mui/system';
4534

46-
35+
//Array of Languages on right side of code editor
4736
const languages = [
4837

4938
{
@@ -55,8 +44,9 @@ const languages = [
5544
direction: "rtl",
5645
fontFamily: "'Roboto Mono'",
5746
toEnglishDict: "'languages/ur/ur_native.lang.yaml'",
47+
fontWeights: "bold",
5848
style: {
59-
fontWeight: "bold",
49+
6050
direction: "rtl"
6151
}
6252
},
@@ -67,17 +57,18 @@ const languages = [
6757
code2: "hi",
6858
name: "Hindi",
6959
i18nName: "Hindi",
70-
fontFamily: "'Hack', 'Courier New', monospaced",
60+
fontFamily: "'Roboto Mono'",
61+
7162
toEnglishDict: "'languages/hi/hi_native.lang.yaml'",
7263
},
7364
{
7465
id: "EN",
75-
// default: true,
7666
code3: "eng",
7767
code2: "en",
7868
name: "English",
7969
i18nName: "English",
80-
fontFamily: "'Hack', 'Courier New', monospaced",
70+
fontFamily: "'Roboto Mono'",
71+
8172
}
8273
]
8374

@@ -339,15 +330,15 @@ export default function Home() {
339330
***********************************************
340331
*********************************************** */}
341332

342-
<div style={{
343-
padding: "80px"
344-
345-
}}>
333+
<div style={{
334+
padding: "80px"
335+
336+
}}>
346337

347338

348339

349340
<Box width="250px">
350-
<TextField select fullWidth label="Select preset" onChange={(e) => {
341+
<TextField select fullWidth label="Select Preset" onChange={(e) => {
351342
console.log("e.target.value:", e.target.value);
352343
console.log(`languages.find(l => l.id === e.target.value)`, initialCodes.find(l => l.id === e.target.value))
353344
setCode(initialCodes.find(l => l.id === e.target.value).en);
@@ -367,54 +358,24 @@ export default function Home() {
367358
}
368359
<MenuItem value="custom">Custom</MenuItem>
369360
</TextField>
370-
371361
</Box>
372362

373-
363+
{/* *****************************************
364+
********DIV FOR THE LANGUAGE SECTION**********
365+
***********************************************
366+
************************************************/}
374367

375368

376-
{/* <select style={{
377-
flex: 1,
378-
// // width: "100%",
379-
margin: "12px",
380-
381-
382-
383-
384-
385-
}}
386-
387-
onChange={(e) => {
388-
console.log("e.target.value:", e.target.value);
389-
console.log(`languages.find(l => l.id === e.target.value)`, initialCodes.find(l => l.id === e.target.value))
390-
setCode(initialCodes.find(l => l.id === e.target.value).en);
391-
}}
392-
value={initialCodes.find(c => {
393-
console.log("c.en === code:", c.en === code);
394-
return c.en === code
395-
})?.id || "custom"}
396-
key={code}
397-
>
398-
{
399-
initialCodes.map((l, idx) => {
400-
return (
401-
<option value={l.id}>{l.name}</option>
402-
)
403-
})
404-
}
405-
<option value="custom">Custom</option>
406-
</select> */}
407-
<div style={{
408-
display: "flex",
409-
flexDirection: "row",
410-
marginTop: "12px",
411-
}}>
412-
<div
369+
<div style={{
370+
display: "flex",
371+
flexDirection: "row",
372+
marginTop: "12px",
373+
}}>
374+
<div
413375
style={{
414376
flex: 1,
415377
}}>
416378

417-
{/* **************************Language*********************************** */}
418379
<Box width="250px">
419380
<TextField label="Select Language"fullWidth select onChange={(e) => {
420381
console.log("e.target.value:", e.target.value);
@@ -434,28 +395,6 @@ export default function Home() {
434395
</TextField>
435396
</Box>
436397

437-
{/* <select style={{
438-
flex: 1,
439-
// width: "100%",
440-
margin: "12px",
441-
442-
}}
443-
444-
onChange={(e) => {
445-
console.log("e.target.value:", e.target.value);
446-
console.log(`languages.find(l => l.id === e.target.value)`, languages.find(l => l.id === e.target.value))
447-
setSourceLanguage(languages.find(l => l.id === e.target.value));
448-
}}
449-
value={sourceLanguage?.id}
450-
>
451-
{
452-
languages.map((l, idx) => {
453-
return (
454-
<option value={l.id}>{l.name}</option>
455-
)
456-
})
457-
}
458-
</select> */}
459398
<IDE id="python-code-editor1"
460399
value={code}
461400
mode="python"
@@ -497,7 +436,7 @@ export default function Home() {
497436
&#8644;
498437
</button>
499438

500-
<div
439+
<div
501440
style={{
502441
flex: 1,
503442
marginLeft: "12px",
@@ -512,7 +451,7 @@ export default function Home() {
512451
}}
513452
value={targetLanguage?.id}
514453
>
515-
{
454+
{
516455
languages.map((l, idx) => {
517456
return (
518457
<MenuItem value={l.id}>{l.name} {targetLanguage?.id === l.id ? isDetected ? " - detected" : "" : ""}</MenuItem>
@@ -522,29 +461,6 @@ export default function Home() {
522461
</TextField>
523462
</Box>
524463

525-
{/* <select style={{
526-
flex: 1,
527-
// width: "100%",
528-
margin: "12px",
529-
530-
}}
531-
532-
onChange={(e) => {
533-
console.log("e.target.value:", e.target.value);
534-
console.log(`languages.find(l => l.id === e.target.value)`, languages.find(l => l.id === e.target.value))
535-
setTargetLanguage(languages.find(l => l.id === e.target.value));
536-
setIsDetected(false);
537-
}}
538-
value={targetLanguage?.id}
539-
>
540-
{
541-
languages.map((l, idx) => {
542-
return (
543-
<option value={l.id}>{l.name} {targetLanguage?.id === l.id ? isDetected ? " - detected" : "" : ""}</option>
544-
)
545-
})
546-
}
547-
</select> */}
548464
<IDE
549465
id="python-code-editor2"
550466
// value={code

src/pages/index.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* CSS files with the .module.css suffix will be treated as CSS modules
33
* and scoped locally.
44
*/
5-
/* @import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300&display=swap'); */
5+
66

77
.heroBanner {
88
padding: 4rem 0;

0 commit comments

Comments
 (0)