Skip to content

Commit 797a0c5

Browse files
authoredOct 11, 2021
[Updated] home style and translation (axios#46)
* [Update] Index page styles `assets/style/index.scss` file updated and some commented statements uncommented so the desired css files will be generated, also some rules added back where it was exists in the css file but not in the scss file so now compiling the SCSS file will generate correct CSS files. * [Updated] index posts style for better management moved RTL specific styles up to the above of media queries so it's more scannable when others want to make changes this is a convention I picked up during CSS development and it's very helpful for future contributors. * [Added] better RTL support in home page - Corrected subheading in the kurdish translations where some english words where leaved mistakenly before. - Added these new fields for better translation of the home page, also updated the english file as it's the base language: - Website Copy Right Footer - View On Github - Axios Project Copy Right Footer - License Label Footer * [Fixed] an ejs error * [Fixed] typo in Kurdish translations
1 parent 06bb98e commit 797a0c5

File tree

6 files changed

+114
-326
lines changed

6 files changed

+114
-326
lines changed
 

‎assets/style/index.css

+16-273
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
font-size: 5px;
1717
}
1818

19-
.typed-cursor {
20-
animation: dissapear linear 8s forwards;
21-
}
22-
2319
@media screen and (min-width: 370px) {
2420
:root {
2521
font-size: 7px;
@@ -164,7 +160,6 @@ section#hero div.content .buttons {
164160
-webkit-box-shadow: 0px 10px 50px rgba(0, 0, 0, 0.1);
165161
box-shadow: 0px 10px 50px rgba(0, 0, 0, 0.1);
166162
display: none;
167-
168163
max-width: 343px;
169164
width: 100%;
170165
height: 157px;
@@ -176,261 +171,8 @@ section#hero div.content .buttons {
176171

177172
.code-preview span {
178173
font-family: var(--font-mono);
179-
/*opacity: 0;
180-
-webkit-animation: appear 500ms linear forwards;
181-
animation: appear 500ms linear forwards;*/
182-
}
183-
184-
/*.code-preview span:nth-child(1) {
185-
-webkit-animation-delay: 300ms;
186-
animation-delay: 300ms;
187-
}
188-
189-
.code-preview span:nth-child(2) {
190-
-webkit-animation-delay: 600ms;
191-
animation-delay: 600ms;
192-
}
193-
194-
.code-preview span:nth-child(3) {
195-
-webkit-animation-delay: 900ms;
196-
animation-delay: 900ms;
197-
}
198-
199-
.code-preview span:nth-child(4) {
200-
-webkit-animation-delay: 1200ms;
201-
animation-delay: 1200ms;
202-
}
203-
204-
.code-preview span:nth-child(5) {
205-
-webkit-animation-delay: 1500ms;
206-
animation-delay: 1500ms;
207-
}
208-
209-
.code-preview span:nth-child(6) {
210-
-webkit-animation-delay: 1800ms;
211-
animation-delay: 1800ms;
212-
}
213-
214-
.code-preview span:nth-child(7) {
215-
-webkit-animation-delay: 2100ms;
216-
animation-delay: 2100ms;
217-
}
218-
219-
.code-preview span:nth-child(8) {
220-
-webkit-animation-delay: 2400ms;
221-
animation-delay: 2400ms;
222-
}
223-
224-
.code-preview span:nth-child(9) {
225-
-webkit-animation-delay: 2700ms;
226-
animation-delay: 2700ms;
227-
}
228-
229-
.code-preview span:nth-child(10) {
230-
-webkit-animation-delay: 3000ms;
231-
animation-delay: 3000ms;
232-
}
233-
234-
.code-preview span:nth-child(11) {
235-
-webkit-animation-delay: 3300ms;
236-
animation-delay: 3300ms;
237-
}
238-
239-
.code-preview span:nth-child(12) {
240-
-webkit-animation-delay: 3600ms;
241-
animation-delay: 3600ms;
242-
}
243-
244-
.code-preview span:nth-child(13) {
245-
-webkit-animation-delay: 3900ms;
246-
animation-delay: 3900ms;
247-
}
248-
249-
.code-preview span:nth-child(14) {
250-
-webkit-animation-delay: 4200ms;
251-
animation-delay: 4200ms;
252-
}
253-
254-
.code-preview span:nth-child(15) {
255-
-webkit-animation-delay: 4500ms;
256-
animation-delay: 4500ms;
257-
}
258-
259-
.code-preview span:nth-child(16) {
260-
-webkit-animation-delay: 4800ms;
261-
animation-delay: 4800ms;
262-
}
263-
264-
.code-preview span:nth-child(17) {
265-
-webkit-animation-delay: 5100ms;
266-
animation-delay: 5100ms;
267-
}
268-
269-
.code-preview span:nth-child(18) {
270-
-webkit-animation-delay: 5400ms;
271-
animation-delay: 5400ms;
272-
}
273-
274-
.code-preview span:nth-child(19) {
275-
-webkit-animation-delay: 5700ms;
276-
animation-delay: 5700ms;
277-
}
278-
279-
.code-preview span:nth-child(20) {
280-
-webkit-animation-delay: 6000ms;
281-
animation-delay: 6000ms;
282-
}
283-
284-
.code-preview span:nth-child(21) {
285-
-webkit-animation-delay: 6300ms;
286-
animation-delay: 6300ms;
287-
}
288-
289-
.code-preview span:nth-child(22) {
290-
-webkit-animation-delay: 6600ms;
291-
animation-delay: 6600ms;
292-
}
293-
294-
.code-preview span:nth-child(23) {
295-
-webkit-animation-delay: 6900ms;
296-
animation-delay: 6900ms;
297174
}
298175

299-
.code-preview span:nth-child(24) {
300-
-webkit-animation-delay: 7200ms;
301-
animation-delay: 7200ms;
302-
}
303-
304-
.code-preview span:nth-child(25) {
305-
-webkit-animation-delay: 7500ms;
306-
animation-delay: 7500ms;
307-
}
308-
309-
.code-preview span:nth-child(26) {
310-
-webkit-animation-delay: 7800ms;
311-
animation-delay: 7800ms;
312-
}
313-
314-
.code-preview span:nth-child(27) {
315-
-webkit-animation-delay: 8100ms;
316-
animation-delay: 8100ms;
317-
}
318-
319-
.code-preview span:nth-child(28) {
320-
-webkit-animation-delay: 8400ms;
321-
animation-delay: 8400ms;
322-
}
323-
324-
.code-preview span:nth-child(29) {
325-
-webkit-animation-delay: 8700ms;
326-
animation-delay: 8700ms;
327-
}
328-
329-
.code-preview span:nth-child(30) {
330-
-webkit-animation-delay: 9000ms;
331-
animation-delay: 9000ms;
332-
}
333-
334-
.code-preview span:nth-child(31) {
335-
-webkit-animation-delay: 9300ms;
336-
animation-delay: 9300ms;
337-
}
338-
339-
.code-preview span:nth-child(32) {
340-
-webkit-animation-delay: 9600ms;
341-
animation-delay: 9600ms;
342-
}
343-
344-
.code-preview span:nth-child(33) {
345-
-webkit-animation-delay: 9900ms;
346-
animation-delay: 9900ms;
347-
}
348-
349-
.code-preview span:nth-child(34) {
350-
-webkit-animation-delay: 10200ms;
351-
animation-delay: 10200ms;
352-
}
353-
354-
.code-preview span:nth-child(35) {
355-
-webkit-animation-delay: 10500ms;
356-
animation-delay: 10500ms;
357-
}
358-
359-
.code-preview span:nth-child(36) {
360-
-webkit-animation-delay: 10800ms;
361-
animation-delay: 10800ms;
362-
}
363-
364-
.code-preview span:nth-child(37) {
365-
-webkit-animation-delay: 11100ms;
366-
animation-delay: 11100ms;
367-
}
368-
369-
.code-preview span:nth-child(38) {
370-
-webkit-animation-delay: 11400ms;
371-
animation-delay: 11400ms;
372-
}
373-
374-
.code-preview span:nth-child(39) {
375-
-webkit-animation-delay: 11700ms;
376-
animation-delay: 11700ms;
377-
}
378-
379-
.code-preview span:nth-child(40) {
380-
-webkit-animation-delay: 12000ms;
381-
animation-delay: 12000ms;
382-
}
383-
384-
.code-preview span:nth-child(41) {
385-
-webkit-animation-delay: 12300ms;
386-
animation-delay: 12300ms;
387-
}
388-
389-
.code-preview span:nth-child(42) {
390-
-webkit-animation-delay: 12600ms;
391-
animation-delay: 12600ms;
392-
}
393-
394-
.code-preview span:nth-child(43) {
395-
-webkit-animation-delay: 12900ms;
396-
animation-delay: 12900ms;
397-
}
398-
399-
.code-preview span:nth-child(44) {
400-
-webkit-animation-delay: 13200ms;
401-
animation-delay: 13200ms;
402-
}
403-
404-
.code-preview span:nth-child(45) {
405-
-webkit-animation-delay: 13500ms;
406-
animation-delay: 13500ms;
407-
}
408-
409-
.code-preview span:nth-child(46) {
410-
-webkit-animation-delay: 13800ms;
411-
animation-delay: 13800ms;
412-
}
413-
414-
.code-preview span:nth-child(47) {
415-
-webkit-animation-delay: 14100ms;
416-
animation-delay: 14100ms;
417-
}
418-
419-
.code-preview span:nth-child(48) {
420-
-webkit-animation-delay: 14400ms;
421-
animation-delay: 14400ms;
422-
}
423-
424-
.code-preview span:nth-child(49) {
425-
-webkit-animation-delay: 14700ms;
426-
animation-delay: 14700ms;
427-
}
428-
429-
.code-preview span:nth-child(50) {
430-
-webkit-animation-delay: 15000ms;
431-
animation-delay: 15000ms;
432-
}*/
433-
434176
.code-preview span.p {
435177
font-weight: var(--fw-bold);
436178
color: var(--primary-color);
@@ -474,25 +216,26 @@ footer .row {
474216
-webkit-box-pack: justify;
475217
-ms-flex-pack: justify;
476218
justify-content: space-between;
219+
-ms-flex-wrap: wrap;
477220
flex-wrap: wrap;
478221
gap: 1rem;
479222
margin-bottom: 1.5rem;
480223
}
481224

482-
/*@-webkit-keyframes appear {
483-
0% {
484-
opacity: 0;
485-
}
486-
100% {
487-
opacity: 1;
488-
}
225+
html[dir="rtl"] main {
226+
margin-right: calc(var(--margin) / 2);
227+
margin-left: unset;
489228
}
490229

491-
@keyframes appear {
492-
0% {
493-
opacity: 0;
494-
}
495-
100% {
496-
opacity: 1;
497-
}
498-
}*/
230+
html[dir="rtl"] .code-preview {
231+
direction: ltr;
232+
}
233+
234+
html[dir="rtl"] header a.button {
235+
margin-left: 0 !important;
236+
}
237+
238+
html[dir="rtl"] footer table td,
239+
html[dir="rtl"] footer table th {
240+
text-align: unset;
241+
}

‎assets/style/index.scss

+45-7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
body {
44
margin: 0;
5+
overflow-x: hidden;
56
}
67

78
* {
@@ -99,10 +100,18 @@ section#hero {
99100
box-shadow: 0px 10px 50px rgba(0, 0, 0, 0.1);
100101
display: none;
101102

103+
max-width: 343px;
104+
width: 100%;
105+
height: 157px;
106+
107+
pre {
108+
display: inline;
109+
}
110+
102111
span {
103112
font-family: var(--font-mono);
104-
opacity: 0;
105-
animation: appear 500ms linear forwards;
113+
// opacity: 0;
114+
// animation: appear 500ms linear forwards;
106115

107116
//@for $i from 1 through 50 {
108117
// &:nth-child(#{$i}) {
@@ -148,15 +157,44 @@ footer {
148157
display: flex;
149158
align-items: center;
150159
justify-content: space-between;
160+
flex-wrap: wrap;
161+
gap: 1rem;
162+
margin-bottom: 1.5rem;
151163
}
152164
}
153165

154-
@keyframes appear {
155-
0% {
156-
opacity: 0;
166+
// @keyframes appear {
167+
// 0% {
168+
// opacity: 0;
169+
// }
170+
171+
// 100% {
172+
// opacity: 1;
173+
// }
174+
// }
175+
176+
html[dir="rtl"] {
177+
main {
178+
margin-right: calc(var(--margin) / 2);
179+
margin-left: unset;
157180
}
158181

159-
100% {
160-
opacity: 1;
182+
.code-preview {
183+
direction: ltr;
184+
}
185+
186+
header {
187+
a.button {
188+
margin-left: 0 !important;
189+
}
190+
}
191+
192+
footer {
193+
table {
194+
td,
195+
th {
196+
text-align: unset;
197+
}
198+
}
161199
}
162200
}

‎en.lang.js

+4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ module.exports = {
2828
"Create an Issue": undefined,
2929
"Next": undefined,
3030
"Previous": undefined,
31+
"Website Copy Right Footer": undefined,
32+
"View On Github": undefined,
33+
"Axios Project Copy Right Footer": undefined,
34+
"License Label Footer": undefined
3135
},
3236
sidebar: [
3337
{

‎ku.lang.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ module.exports = {
99
lang: "ckb-ku",
1010
// `p` stands for `paragraph`. This will contain translations of full text blocks
1111
p: {
12-
headline: "ڕاژەخوازێکی HTTPـیە لەسەر بنجینەی Promise بۆ وێبگەڕ و نۆد",
13-
subhead: `Axios is a simple promise based HTTP client for the browser and node.js.
14-
ئەکسیۆس ڕاژەخوازێکی HTTPـیە لەسەر Promise بنچینەکراوە بۆ نۆد و وێبگەڕ. ئەکسیۆس ژێدەرگەیەکی ئاسان بۆ بەکارهێنان لە گورزەیەکی بچووک بە ناوبەستێکی شیاو بۆ پەرەسەندن دابین دەکات.`,
12+
headline: "ڕاژەخوازێکی HTTPـیە لەسەر بنچینەی Promise بۆ وێبگەڕ و نۆد",
13+
subhead: `ئەکسیۆس ڕاژەخوازێکی HTTPـیە لەسەر Promise بنچینەکراوە بۆ نۆد و وێبگەڕ. ئەکسیۆس ژێدەرگەیەکی ئاسان بۆ بەکارهێنان لە گورزەیەکی بچووک بە ناوبەستێکی شیاو بۆ پەرەسەندن دابین دەکات.`,
1514
},
1615
// `t` stands fot `translation`. This will contain translations of single words or phrases
1716
t: {
@@ -26,6 +25,10 @@ module.exports = {
2625
"Create an Issue": "کێشەیەک دروست بکە",
2726
"Next": "دواتر",
2827
"Previous": "پێشتر",
28+
"Website Copy Right Footer": 'ئەم ماڵپەڕە: مافی لەبەرگگرتنەوەی پارێزراوە @ 2020-ئێستا John Jakob "Jake" Sarjeant. بەکارهێنراوە پاش مۆڵەت وەرگرتن',
29+
"View On Github": 'بڕوانە ئەم ماڵپەڕە لەسەر گیتهەب',
30+
"Axios Project Copy Right Footer": 'پڕۆژەی ئەکسیۆس: مافی لەبەرگگرتنەوەی پارێزراوە @ 2014-ئێستا Matt Zabriskie.',
31+
"License Label Footer":'بڵاوکراوەتەوە لە ژێر مۆڵەتی'
2932
},
3033
sidebar: [
3134
{

‎scss/index.scss

+29-27
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,35 @@ main {
436436
}
437437
}
438438

439+
/* RTL styles */
440+
441+
html[dir="rtl"] {
442+
aside {
443+
right: 0;
444+
left: unset;
445+
446+
transform: translateX(100%);
447+
448+
details.dropdown-language {
449+
div.options {
450+
width: 100%;
451+
padding-left: unset;
452+
padding-right: 2.3rem;
453+
}
454+
}
455+
}
456+
457+
main {
458+
position: absolute;
459+
right: var(--sidebar-width);
460+
left: unset;
461+
462+
pre {
463+
direction: ltr;
464+
}
465+
}
466+
}
467+
439468
@media screen and (min-width: 800px) {
440469
body {
441470
--sidebar-width: 239px;
@@ -636,30 +665,3 @@ body {
636665
top: 0;
637666
}
638667
}
639-
640-
/* RTL styles */
641-
642-
html[dir="rtl"] {
643-
aside {
644-
right: 0;
645-
left: unset;
646-
647-
details.dropdown-language {
648-
div.options {
649-
width: 100%;
650-
padding-left: unset;
651-
padding-right: 2.3rem;
652-
}
653-
}
654-
}
655-
656-
main {
657-
position: absolute;
658-
right: var(--sidebar-width);
659-
left: unset;
660-
661-
pre {
662-
direction: ltr;
663-
}
664-
}
665-
}

‎templates/home.ejs

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!DOCTYPE html>
2-
<html lang="en">
2+
<html lang="<%= locale.lang %>" dir="<%= locale.dir %>">
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
@@ -106,23 +106,21 @@
106106
<% }) %>
107107
</table>
108108
<div class="row">
109-
<span class="copyright-notice"
110-
>This Website: Copyright © 2020-present John Jakob "Jake" Sarjeant.
111-
Used by permission.</span
112-
>
113-
<a href="https://github.com/axios/axios-docs"
114-
>View this site on GitHub</a
115-
>
109+
<span class="copyright-notice">
110+
<%= locale.t['Website Copy Right Footer'] || 'This Website: Copyright © 2020-present John Jakob "Jake" Sarjeant. Used by permission.' %>
111+
</span>
112+
<a href="https://github.com/axios/axios-docs">
113+
<%= locale.t['View On Github'] || 'View this site on GitHub' %>
114+
</a>
116115
</div>
117116
<div class="row">
118-
<span class="copyright-notice">The Axios Project: Copyright © 2014-present Matt Zabriskie.</span
119-
>
120-
<span
121-
>Licensed under the
122-
<b
123-
><a href="https://opensource.org/licenses/MIT">MIT License</a></b
124-
></span
125-
>
117+
<span class="copyright-notice">
118+
<%= locale.t['Axios Project Copy Right Footer'] || 'The Axios Project: Copyright © 2014-present Matt Zabriskie.' %>
119+
</span>
120+
<span>
121+
<%= locale.t['License Label Footer'] || 'Licensed under the' %>
122+
<b><a href="https://opensource.org/licenses/MIT">MIT License</a></b>
123+
</span>
126124
</div>
127125
</footer>
128126

0 commit comments

Comments
 (0)
Please sign in to comment.