File tree Expand file tree Collapse file tree 5 files changed +124
-11
lines changed Expand file tree Collapse file tree 5 files changed +124
-11
lines changed Original file line number Diff line number Diff line change 1+ // Fetch API:
2+ const url = "https://api.dictionaryapi.dev/api/v2/entries/en/clone" ;
3+
4+ fetch ( url )
5+ . then ( ( response ) => {
6+ console . log ( response . status ) ; // returns status code from server request
7+ console . log ( response . ok ) ; // if status code is in-between 200-299 it returns true else false
8+ console . log ( response . headers ) ; //we can provide aditional url attributes e.g. access token
9+ return response . json ( ) ; // we can only provide a single body read function at time
10+ // return response.text();
11+ } )
12+ . then ( ( data ) => {
13+ console . log ( `Success: ${ data } ` ) ;
14+ } )
15+ . catch ( ( error ) => {
16+ console . log ( `Error: ${ error } ` ) ;
17+ } ) ;
Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+
4+ < head >
5+ < meta charset ="UTF-8 ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < title > Chapter10: Network Requests & Storing Data</ title >
8+ < link rel ="stylesheet " href ="style.css ">
9+ < script defer src ="chapter10.js "> </ script >
10+ </ head >
11+
12+ < body >
13+ < h1 >
14+ Chapter10: Network Requests & Storing Data
15+ </ h1 >
16+ </ body >
17+
18+ </ html >
Original file line number Diff line number Diff line change 1+ * {
2+ margin : 0% ;
3+ padding : 0% ;
4+ box-sizing : border-box;
5+ }
6+
7+ body {
8+ height : 100vh ;
9+ width : 100% ;
10+ background-color : # 6082b6 ;
11+ color : # ffff ;
12+ display : flex;
13+ justify-content : center;
14+ align-items : center;
15+ font-family : monospace;
16+ font-size : 2vw ;
17+ }
Exercise05-JavaScript-Series Original file line number Diff line number Diff line change 4040.btn {
4141 border-width : 0vw ;
4242 border-radius : 0.3vw ;
43- height : 2vw ;
43+ height : 3vw ;
44+ width : 5vw ;
4445 background-color : rgb (2 , 177 , 2 );
4546 font-size : 1vw ;
4647 font-weight : 700 ;
5354}
5455# username {
5556 height : 3vw ;
56- min-width : 20vw ;
57- width : 22vw ;
57+ width : 30vw ;
5858 margin-right : 1vw ;
5959 border : none;
6060 outline : none;
7070 color : # 03ab30 ;
7171 margin-top : 1vw ;
7272 background-color : # 000000b7 ;
73- width : 60 % ;
73+ width : 70 % ;
7474 height : 32vw ;
7575 border-radius : 0.6vw ;
7676 border : solid # 0beb47 0.1vw ;
@@ -104,7 +104,7 @@ body {
104104 color : rgb (238 , 255 , 0 );
105105}
106106
107- @media (max-width : 600 px ) {
107+ @media (max-width : 575.98 px ) {
108108 # terminal {
109109 padding : 2vw ;
110110 width : 90% ;
@@ -130,17 +130,11 @@ body {
130130 }
131131 .inputUsername {
132132 margin-top : 2vw ;
133- display : flex;
134- align-items : center;
135- justify-content : center;
136133 min-width : 100vmax ;
137134 min-height : 5vmin ;
138135 }
139136 # glitchedUsername {
140137 margin-top : 2vw ;
141- display : flex;
142- align-items : center;
143- justify-content : center;
144138 height : 6vw ;
145139 width : 100% ;
146140 }
@@ -152,3 +146,70 @@ body {
152146 height : 13vw ;
153147 }
154148}
149+ @media (min-width : 576px ) and (max-width : 767.98px ) {
150+ # terminal {
151+ padding : 2vmin ;
152+ width : 90% ;
153+ height : 90vmin ;
154+ border-radius : 1vmin ;
155+ font-size : 2.1vmin ;
156+ margin-bottom : 1vmin ;
157+ }
158+ # username {
159+ height : 4vw ;
160+ width : 40vw ;
161+ margin-right : 2.5vw ;
162+ border-radius : 0.6vw ;
163+ font-size : 1.7vw ;
164+ padding-left : 1.7vw ;
165+ }
166+ .btn {
167+ width : 7vw ;
168+ border-radius : 0.6vw ;
169+ height : 4vw ;
170+ font-size : 1vw ;
171+ font-weight : 700 ;
172+ padding : 0.2vw 0.8vw ;
173+ }
174+ .inputUsername {
175+ margin-top : 1.7vw ;
176+ min-width : 100vmax ;
177+ min-height : 5vmin ;
178+ }
179+ # glitchedUsername {
180+ margin-top : 1.7vw ;
181+ height : 5.3vw ;
182+ width : 100% ;
183+ }
184+ # glitchedUsername h2 {
185+ font-size : 3.5vmin ;
186+ }
187+ .Heading {
188+ font-size : 1.3vmin ;
189+ height : 15vw ;
190+ }
191+ }
192+ @media (min-width : 768px ) and (max-width : 991.98px ) {
193+ # terminal {
194+ width : 80% ;
195+ height : 90vmin ;
196+ }
197+ # username {
198+ height : 4vmin ;
199+ width : 35vmax ;
200+ margin-right : 2.5vw ;
201+ border-radius : 0.6vw ;
202+ font-size : 1.3vw ;
203+ padding-left : 1.7vw ;
204+ }
205+ .btn {
206+ width : 6vmin ;
207+ height : 4vmin ;
208+ font-size : 1vmin ;
209+ font-weight : 700 ;
210+ padding : 0.2vw 0.8vw ;
211+ }
212+ .Heading {
213+ font-size : 1.2vmin ;
214+ }
215+ }
You can’t perform that action at this time.
0 commit comments