File tree 4 files changed +43
-28
lines changed
4 files changed +43
-28
lines changed Original file line number Diff line number Diff line change 5
5
body {
6
6
background-color : # 2d2d30 ;
7
7
color : # ccc ;
8
+ transition : all 2s ;
9
+ }
10
+
11
+ a {
12
+ color : mediumpurple;
13
+ text-decoration : underline;
14
+ }
15
+
16
+ .light-theme {
17
+ background-color : # eee ;
18
+ color : # 333 ;
19
+ }
20
+
21
+ .light-theme a {
22
+ color : blue;
8
23
}
9
24
10
25
.half-screen {
@@ -25,29 +40,12 @@ body {
25
40
height : 95vh ;
26
41
}
27
42
28
- textarea {
29
- width : 100% ;
30
- height : 100% ;
31
- min-width : 250px ;
32
- background-color : # 1e1e1e ;
33
- border : none;
34
- color : # ccc ;
35
- font-size : 1.2rem ;
36
- padding : 10px ;
37
- font-family : Consolas, monospace;
38
- }
39
-
40
- ::placeholder {
41
- color : # 818180 ;
42
- }
43
-
44
- .left h1 {
45
- /* padding-left: 20px; */
43
+ # text-editor-container {
44
+ transition : all 2s ;
46
45
}
47
46
48
47
.instructions {
49
48
padding-right : 20px ;
50
- /* padding-left: 20px; */
51
49
font-size : 1.2rem ;
52
50
}
53
51
@@ -65,30 +63,32 @@ textarea {
65
63
padding : 1rem ;
66
64
}
67
65
68
- a {
69
- color : mediumpurple;
70
- text-decoration : underline;
71
- }
72
-
73
66
.btn-container {
74
67
display : flex;
75
- /* margin-left: 20px; */
76
68
}
77
69
78
- .btn {
70
+ .btn ,
71
+ .light-theme .btn {
79
72
text-decoration : none;
80
73
display : flex;
81
74
align-items : center;
82
75
justify-content : center;
83
76
background-color : # 555 ;
84
- border : 1px # 000 solid;
77
+ /* border: 1px #000 solid; */
78
+ border : none;
85
79
border-radius : 5px ;
86
80
padding : 10px ;
87
81
margin : 10px ;
88
82
color : # eee ;
89
83
font-size : 1.5rem ;
90
84
cursor : pointer;
91
85
font-family : monospace;
86
+ transition : all 2s ;
87
+ }
88
+
89
+ .light-theme .btn {
90
+ background-color : # fff ;
91
+ color : # 000 ;
92
92
}
93
93
94
94
.contributing p {
Original file line number Diff line number Diff line change @@ -25,6 +25,9 @@ <h1>Speech Programmer</h1>
25
25
Clear Code
26
26
</ button >
27
27
< a class ="btn readme " href ='./readme.html ' target ="_blank "> Readme</ a >
28
+ < button class ="btn " id ="changeThemeButton " onClick ="changeTheme(event) ">
29
+ Change Theme
30
+ </ button >
28
31
</ div >
29
32
30
33
< div class ="contributing ">
Original file line number Diff line number Diff line change @@ -24,3 +24,15 @@ function startStopButton(event) {
24
24
recognition . stop ( ) ;
25
25
}
26
26
}
27
+
28
+ // function to switch between light and dark themes
29
+ function changeTheme ( event ) {
30
+
31
+ // add light-theme css to body
32
+ document . body . classList . toggle ( 'light-theme' ) ;
33
+
34
+ // change theme of monaco editor with a delay
35
+ setTimeout ( function ( ) {
36
+ programTextArea . _themeService . getTheme ( ) . id === 'vs vs' ? monaco . editor . setTheme ( 'vs-dark' ) : monaco . editor . setTheme ( 'vs-light' ) ;
37
+ } , 1000 ) ;
38
+ }
Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ require(["vs/editor/editor.main"], function () {
20
20
theme : 'vs-dark' ,
21
21
formatOnType : true ,
22
22
formatOnPaste : true ,
23
+ automaticLayout : true ,
23
24
} ) ;
24
25
25
-
26
26
programTextArea = editor ;
27
27
} ) ;
You can’t perform that action at this time.
0 commit comments