Skip to content

Commit 21080a7

Browse files
committed
docs: added comments and little bit refactoring
1 parent df715ef commit 21080a7

File tree

35 files changed

+113
-139
lines changed

35 files changed

+113
-139
lines changed

Accoridan/script.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@ const accordians = document.querySelectorAll(".accordian");
22

33
// iterate over each accoridan FAQ and look for "click" event
44
accordians.forEach((accordian) => {
5+
6+
// select each element
57
const icon = accordian.querySelector(".icon");
68
const answer = accordian.querySelector(".answer");
79

10+
// add event listener to each question
811
accordian.addEventListener("click", () => {
12+
913
// if contains active class, remove and change its height ... else add active class and adjust height
10-
if(icon.classList.contains("active")) {
14+
if(icon.classList.contains("active"))
15+
{
1116
icon.classList.remove("active");
1217
answer.style.maxHeight = null;
1318
}
14-
else {
19+
else
20+
{
1521
icon.classList.add("active");
1622
answer.style.maxHeight = answer.scrollHeight + "px";
1723
}

Accoridan/style.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@ body {
2424
overflow: hidden;
2525
color: #666;
2626
transition: max-height 0.2s;
27-
/* Animation wont work with display property */
28-
/* display: none; */
2927
}
30-
/* Animation wont work with display property */
31-
/* .answer.active{
32-
display: block;
33-
} */
3428
.icon {
3529
width: 20px;
3630
height: 20px;

Calculator/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<!-- External CSS -->
1010
<link rel="stylesheet" href="./style.css">
11+
<link rel="stylesheet" href="../main.css">
1112
<!-- MathJS CDN -->
1213
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/browser/math.min.js"></script>
1314
</head>

Calculator/style.css

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
* {
2-
margin: 0;
3-
padding: 0;
4-
box-sizing: border-box;
5-
}
61
body {
72
height: 100vh;
83
font-family: 'Trebuchet MS', Arial, sans-serif;
94
display: grid;
105
place-items: center;
116
background-color: #2AAFA2;
127
}
13-
148
.container {
159
width: 300px;
1610
height: 600px;
@@ -19,7 +13,6 @@ body {
1913
box-shadow: 0 0 0 1px #000807;
2014
background-color: #000807;
2115
}
22-
2316
/* result and operation text formatting */
2417
.result-container {
2518
height: 225px;
@@ -49,7 +42,6 @@ body {
4942
bottom: 24px;
5043
font-size: 24px;
5144
}
52-
5345
/* buttons */
5446
.btn-container {
5547
width: 100%;
@@ -77,7 +69,6 @@ body {
7769
.box:hover {
7870
background-color: rgba(9, 22, 26, .5);
7971
}
80-
8172
/* selecting all 4th column members */
8273
.box:nth-child(4n) {
8374
background-color: #28ADA0;
@@ -86,12 +77,10 @@ body {
8677
.box:nth-child(4n):hover, .box:last-child:hover {
8778
background-color: rgba(40, 173, 160, .8);
8879
}
89-
9080
/* left bottom box corner fix */
9181
.box:nth-last-child(3) {
9282
border-radius: 0 0 0 10px;
9383
}
94-
9584
/* formatting equals sign */
9685
.box:last-child {
9786
grid-row: 5;

Color Picker/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<!-- External CSS -->
1010
<link rel="stylesheet" href="./style.css">
11+
<link rel="stylesheet" href="../main.css">
1112
</head>
1213
<body>
1314

Color Picker/script.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ let colorCode;
99

1010
// look for the input changes in "range" buttons
1111
rangeBtns.forEach((rangeBtn) => {
12+
13+
// add event listener to each element
1214
rangeBtn.addEventListener("input", () => {
1315
updateColorDisplayed();
1416
});

Color Picker/style.css

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
1-
* {
2-
margin: 0;
3-
padding: 0;
4-
box-sizing: border-box;
5-
font-family: 'Trebuchet MS', sans-serif;
6-
/* border: 1px solid red; */
7-
}
81
body {
92
height: 100vh;
103
overflow: hidden;
114
display: flex;
125
justify-content: center;
136
align-items: center;
7+
font-family: 'Trebuchet MS', sans-serif;
148
background-color: lightgreen;
159
}
1610
.container {

Counter/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<!-- External CSS -->
1010
<link rel="stylesheet" href="./style.css">
11+
<link rel="stylesheet" href="../main.css">
1112
</head>
1213
<body>
1314

@@ -22,7 +23,6 @@ <h1 class="counter-heading">Counter App</h1>
2223
</div>
2324
</div>
2425
</div>
25-
2626
<!-- JavaScript -->
2727
<script src="./script.js" defer></script>
2828
</body>

Counter/style.css

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,13 @@
33
--background-color: #0A192F;
44
--sub-text: #DDDDDD;
55
}
6-
7-
* {
8-
padding: 0;
9-
margin: 0;
10-
box-sizing: border-box;
11-
font-family: 'Times New Roman', Times, serif;
12-
overflow: hidden;
13-
}
146
.container {
157
height: 100vh;
168
display: flex;
179
justify-content: center;
1810
align-items: center;
11+
overflow: hidden;
12+
font-family: 'Times New Roman', Times, serif;
1913
background-color: var(--background-color);
2014
}
2115
.counter-card {
@@ -66,8 +60,6 @@
6660
.btn-plus:hover, .btn-minus:hover, .btn-reset:hover {
6761
box-shadow: 2px 2px 4px var(--sub-text);
6862
}
69-
70-
/* Responsive */
7163
@media screen and (max-width: 420px) {
7264
.counter-card {
7365
padding: 16;

Dad Jokes/index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<link rel="stylesheet" href="./style.css" />
76
<title>Dad Jokes</title>
7+
8+
<!-- External CSS -->
9+
<link rel="stylesheet" href="./style.css">
10+
<link rel="stylesheet" href="../main.css">
811
</head>
912
<body>
1013

0 commit comments

Comments
 (0)