Skip to content

Commit 02d22a3

Browse files
authored
Documentation of file (#111)
Co-authored-by: Badshah <[email protected]>
1 parent 4ce3cfd commit 02d22a3

File tree

4 files changed

+66
-81
lines changed

4 files changed

+66
-81
lines changed

index.html

+3-43
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,8 @@
1818
<meta name="twitter:image" content="https://cdn.devdojo.com/posts/images/November2020/open-source-introduction-to-bash-scripting-ebook-guide.jpg?auto=format" />
1919
<link rel="icon" type="image/png" href="https://cdn.devdojo.com/devblog/favicons/3/2QLoxPNvDo4CGedlSIOUFqkXDpcrnLYBKhxHRMmr.png" />
2020

21-
<!-- Small CSS to Hide elements at 1520px size -->
22-
<style>
23-
html{
24-
scroll-behavior: smooth;
25-
}
21+
<link rel="stylesheet" href="style.css">
2622

27-
@media(max-width:1520px) {
28-
.left-svg {
29-
display: none;
30-
}
31-
}
32-
33-
/* small css for the mobile nav close */
34-
#nav-mobile-btn.close span:first-child {
35-
transform: rotate(45deg);
36-
top: 4px;
37-
position: relative;
38-
background: #a0aec0;
39-
}
40-
41-
#nav-mobile-btn.close span:nth-child(2) {
42-
transform: rotate(-45deg);
43-
margin-top: 0px;
44-
background: #a0aec0;
45-
}
46-
</style>
47-
</head>
4823
<body class="overflow-x-hidden antialiased">
4924
<!-- Header Section -->
5025
<header class="relative z-50 w-full h-24">
@@ -528,23 +503,8 @@ <h4 class="pb-0 mb-0 text-lg font-semibold mb-md-0">Enjoying the free eBook?</h4
528503
</p>
529504
</div>
530505
</footer>
531-
<!-- a little JS for the mobile nav button -->
532-
<script>
533-
var year=new Date().getFullYear();
534-
console.log(year);
535-
document.getElementById("year").innerHTML=year;
536506

537-
if (document.getElementById('nav-mobile-btn')) {
538-
document.getElementById('nav-mobile-btn').addEventListener('click', function () {
539-
if (this.classList.contains('close')) {
540-
document.getElementById('nav').classList.add('hidden');
541-
this.classList.remove('close');
542-
} else {
543-
document.getElementById('nav').classList.remove('hidden');
544-
this.classList.add('close');
545-
}
546-
});
547-
}
548-
</script>
507+
<script src="index.js"></script>
508+
549509
</body>
550510
</html>

index.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// a little JS for the mobile nav button
2+
3+
var year = new Date().getFullYear();
4+
console.log(year);
5+
document.getElementById("year").innerHTML = year;
6+
7+
if (document.getElementById('nav-mobile-btn')) {
8+
document.getElementById('nav-mobile-btn').addEventListener('click', function () {
9+
if (this.classList.contains('close')) {
10+
document.getElementById('nav').classList.add('hidden');
11+
this.classList.remove('close');
12+
} else {
13+
document.getElementById('nav').classList.remove('hidden');
14+
this.classList.add('close');
15+
}
16+
});
17+
}
18+
// ######################################
19+
20+
// a little JS for the mobile nav button
21+
22+
if (document.getElementById('nav-mobile-btn')) {
23+
document.getElementById('nav-mobile-btn').addEventListener('click', function () {
24+
if (this.classList.contains('close')) {
25+
document.getElementById('nav').classList.add('hidden');
26+
this.classList.remove('close');
27+
} else {
28+
document.getElementById('nav').classList.remove('hidden');
29+
this.classList.add('close');
30+
}
31+
});
32+
}

style.css

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* Small CSS to Hide elements at 1520px size */
2+
3+
html {
4+
scroll-behavior: smooth;
5+
}
6+
7+
@media(max-width:1520px) {
8+
.left-svg {
9+
display: none;
10+
}
11+
}
12+
13+
/* small css for the mobile nav close */
14+
#nav-mobile-btn.close span:first-child {
15+
transform: rotate(45deg);
16+
top: 4px;
17+
position: relative;
18+
background: #a0aec0;
19+
}
20+
21+
#nav-mobile-btn.close span:nth-child(2) {
22+
transform: rotate(-45deg);
23+
margin-top: 0px;
24+
background: #a0aec0;
25+
}
26+
27+
/* Css is same for both the html file index.html and training.html */

training.html

+4-38
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,9 @@
1818
<link rel="icon" type="image/png" href="https://cdn.devdojo.com/devblog/favicons/3/2QLoxPNvDo4CGedlSIOUFqkXDpcrnLYBKhxHRMmr.png" />
1919

2020
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.0.1/tailwind.min.css">
21-
<!-- Small CSS to Hide elements at 1520px size -->
22-
<style>
23-
html{
24-
scroll-behavior: smooth;
25-
}
26-
27-
@media(max-width:1520px) {
28-
.left-svg {
29-
display: none;
30-
}
31-
}
3221

33-
/* small css for the mobile nav close */
34-
#nav-mobile-btn.close span:first-child {
35-
transform: rotate(45deg);
36-
top: 4px;
37-
position: relative;
38-
background: #a0aec0;
39-
}
22+
<link rel="stylesheet" href="style.css">
4023

41-
#nav-mobile-btn.close span:nth-child(2) {
42-
transform: rotate(-45deg);
43-
margin-top: 0px;
44-
background: #a0aec0;
45-
}
46-
</style>
4724
<!-- End Header Section-->
4825
<script src="//katacoda.com/embed.js"></script>
4926
</head>
@@ -186,19 +163,8 @@ <h4 class="pb-0 mb-0 text-lg font-semibold mb-md-0">Download the eBook for free!
186163
</p>
187164
</div>
188165
</footer>
189-
<!-- a little JS for the mobile nav button -->
190-
<script>
191-
if (document.getElementById('nav-mobile-btn')) {
192-
document.getElementById('nav-mobile-btn').addEventListener('click', function () {
193-
if (this.classList.contains('close')) {
194-
document.getElementById('nav').classList.add('hidden');
195-
this.classList.remove('close');
196-
} else {
197-
document.getElementById('nav').classList.remove('hidden');
198-
this.classList.add('close');
199-
}
200-
});
201-
}
202-
</script>
166+
167+
<script src="index.js"></script>
168+
203169
</body>
204170
</html>

0 commit comments

Comments
 (0)