Skip to content

Commit 254ea52

Browse files
committed
Add Jira Clone
1 parent 2f28a35 commit 254ea52

File tree

4 files changed

+489
-0
lines changed

4 files changed

+489
-0
lines changed

Jira Clone/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<h1>Jira Clone</h1>
2+
3+
<p>Simple Notes App written in HTML, CSS, and JavaScript.</p>
4+
5+
### Use of the Project:
6+
7+
<p>ToDo App is a kind of app that generally used to maintain our day-to-day tasks or list everything that we have to do, with the most important tasks at the top of the list, and the least important tasks at the bottom. It is helpful in planning our daily schedules.</p>
8+
9+
<h3>Used Technologies</h3>
10+
<ul>
11+
<li>HTML5</li>
12+
<li>CSS3</li>
13+
<li>JavaScript</li>
14+
</ul>
15+
16+
#### Steps to Use:
17+
18+
---
19+
20+
- Download or clone the repository
21+
22+
```
23+
git clone https://github.com/Ayushparikh-code/Web-dev-mini-projects.git
24+
```
25+
26+
- Go to the 'Jira Clone' directory
27+
- Run the index.html file
28+
- ToDo App is ready to use!!
29+
30+
<h3> ScreenShots </h3>
31+
<img src="https://i.ibb.co/w60C6Tf/image.png">
32+
<br>
33+

Jira Clone/index.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>Jira Clone</title>
9+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"
10+
integrity="sha512-iBBXm8fW90+nuLcSKlbmrPcLa0OT92xO1BIsZ+ywDWZCvqsWgccV3gFoRBv0z+8dLJgyAHIhR35VZc2oM/gI1w=="
11+
crossorigin="anonymous" />
12+
<link rel="preconnect" href="https://fonts.gstatic.com">
13+
<link href="https://fonts.googleapis.com/css2?family=Raleway:wght@300;600&display=swap" rel="stylesheet">
14+
<link rel="stylesheet" href="style.css">
15+
</head>
16+
17+
<body>
18+
<div class="task-bar">
19+
<div class="color-bar">
20+
<div class="color-box c1">
21+
<div class="color pink"></div>
22+
</div>
23+
<div class="color-box c2">
24+
<div class="color blue"></div>
25+
</div>
26+
<div class="color-box c3">
27+
<div class="color green"></div>
28+
</div>
29+
<div class="color-box c4">
30+
<div class="color black"></div>
31+
</div>
32+
</div>
33+
<div class="button-bar">
34+
<div class="button-box b1">
35+
<i class="fas fa-plus"></i>
36+
</div>
37+
<div class="button-box b2">
38+
<i class="fas fa-times"></i>
39+
</div>
40+
</div>
41+
</div>
42+
<div class="main-content">
43+
<div class="notes-container"></div>
44+
<div class="modal-container">
45+
<div class="modal-content">
46+
<div class="text-content">
47+
<textarea class="modal-input" placeholder="Enter your text here"></textarea>
48+
</div>
49+
<div class="priority-content">
50+
<div class="priority one"></div>
51+
<div class="priority two"></div>
52+
<div class="priority three"></div>
53+
<div class="priority four"></div>
54+
</div>
55+
</div>
56+
</div>
57+
</div>
58+
<script src="script.js"></script>
59+
</body>
60+
61+
</html>

Jira Clone/script.js

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
let colors = document.querySelectorAll(".color-box");
2+
let notesList = document.querySelectorAll(".note-node");
3+
4+
let selectedArr = [false, false, false, false];
5+
let colorsArr = ["#d795ac", "#60cbdf", "#92e6c8", "#312f31"];
6+
7+
let deleteStatus = false;
8+
9+
for (let i = 0; i < colors.length; i++) {
10+
colors[i].addEventListener('click', function () {
11+
if (selectedArr[i]) {
12+
resetTaskbarColors();
13+
setBackgroundColor(document.body, "#f3f2f3");
14+
selectedArr[i] = false;
15+
filterTasksByColor(true);
16+
} else {
17+
setBackgroundColor(document.body, colorsArr[i]);
18+
resetTaskbarColors();
19+
setBackgroundColor(colors[i], "#3a383a");
20+
selectTask(i);
21+
filterTasksByColor(false, i);
22+
}
23+
});
24+
}
25+
26+
function filterTasksByColor(all, colorIdx) {
27+
if (all) {
28+
for (let i = 0; i < notesList.length; i++) {
29+
notesList[i].style.display = 'flex';
30+
}
31+
} else {
32+
for (let i = 0; i < notesList.length; i++) {
33+
let noteColor = notesList[i].querySelector(".note-color");
34+
let color = noteColor.getAttribute("color");
35+
if (color == getColorName(colorIdx))
36+
notesList[i].style.display = 'flex';
37+
else
38+
notesList[i].style.display = 'none';
39+
}
40+
}
41+
}
42+
43+
function selectTask(task) {
44+
for (let i = 0; i < selectedArr.length; i++) {
45+
if (task == i)
46+
selectedArr[i] = true;
47+
else
48+
selectedArr[i] = false;
49+
}
50+
}
51+
52+
function resetTaskbarColors() {
53+
for (let i = 0; i < colors.length; i++) {
54+
setBackgroundColor(colors[i], "#464446");
55+
}
56+
}
57+
58+
function setBackgroundColor(element, color) {
59+
element.style.backgroundColor = color;
60+
}
61+
62+
let add = document.querySelector(".b1");
63+
let del = document.querySelector(".b2");
64+
65+
let modal = document.querySelector(".modal-container");
66+
67+
let priorities = document.querySelectorAll(".priority");
68+
let priorityColorsNotSelected = ["#a57888", "#579da9", "#79ac9a", "#383638"];
69+
let chosenPriority = priorities.length - 1;
70+
71+
add.addEventListener('click', function () {
72+
modal.style.display = "block";
73+
resetPriorityColors();
74+
chosenPriority = priorities.length - 1;
75+
priorities[chosenPriority].style.border = "3px solid #000000";
76+
});
77+
78+
document.querySelector(".main-content").addEventListener('click', function () {
79+
80+
});
81+
82+
del.addEventListener('mouseenter', function () {
83+
setBackgroundColor(del, "#3a383a");
84+
});
85+
del.addEventListener('mouseleave', function () {
86+
if (!deleteStatus)
87+
setBackgroundColor(del, "#464446");
88+
});
89+
del.addEventListener('click', function () {
90+
if (deleteStatus) {
91+
setBackgroundColor(del, "#464446");
92+
} else {
93+
setBackgroundColor(del, "#3a383a");
94+
}
95+
deleteStatus = !deleteStatus;
96+
});
97+
98+
for (let i = 0; i < priorities.length; i++) {
99+
priorities[i].addEventListener('mouseenter', function () {
100+
setBackgroundColor(priorities[i], colorsArr[i]);
101+
});
102+
priorities[i].addEventListener('mouseleave', function () {
103+
if (chosenPriority != i)
104+
setBackgroundColor(priorities[i], priorityColorsNotSelected[i]);
105+
});
106+
priorities[i].addEventListener('click', function () {
107+
resetPriorityColors();
108+
setBackgroundColor(priorities[i], colorsArr[i]);
109+
priorities[i].style.border = "3px solid #000000";
110+
chosenPriority = i;
111+
});
112+
}
113+
114+
function resetPriorityColors() {
115+
for (let i = 0; i < priorities.length; i++) {
116+
setBackgroundColor(priorities[i], priorityColorsNotSelected[i]);
117+
priorities[i].style.border = "none";
118+
}
119+
}
120+
121+
let input = document.querySelector(".modal-input");
122+
input.addEventListener('keypress', function (e) {
123+
if (e.key == 'Enter' && input.value.trim() != '') {
124+
modal.style.display = "none";
125+
let data = input.value;
126+
input.value = '';
127+
createNotes(data);
128+
}
129+
});
130+
131+
let notes = document.querySelector(".notes-container");
132+
133+
function createNotes(data) {
134+
let node = document.createElement("div");
135+
node.setAttribute("class", "note-node");
136+
node.innerHTML = `
137+
<div class="note-color" color="` + getColorName(chosenPriority) + `"></div>
138+
<p class="note-uid">#` + randomId(6) + `</p>
139+
<p class="note-content">` + data + `</p>
140+
`;
141+
notes.appendChild(node);
142+
143+
let color = node.querySelector(".note-color");
144+
color.style.backgroundColor = colorsArr[chosenPriority];
145+
color.addEventListener('click', function (e) {
146+
let colorName = color.getAttribute('color');
147+
let colorIdx = getColorIdx(colorName);
148+
color.style.backgroundColor = colorsArr[(colorIdx + 1) % 4];
149+
color.setAttribute('color', getColorName((colorIdx + 1) % 4));
150+
});
151+
notesList = document.querySelectorAll(".note-node");
152+
// filterTasksByColor(false, color.getAttribute('color'));
153+
154+
let colorHead = node.querySelector(".note-uid");
155+
colorHead.addEventListener('click', function (e) {
156+
if (deleteStatus) {
157+
node.remove();
158+
}
159+
});
160+
}
161+
162+
function getColorName(idx) {
163+
switch (idx) {
164+
case 0: return 'pink';
165+
case 1: return 'blue';
166+
case 2: return 'green';
167+
case 3: return 'black';
168+
}
169+
}
170+
171+
function getColorIdx(name) {
172+
switch (name) {
173+
case 'pink': return 0;
174+
case 'blue': return 1;
175+
case 'green': return 2;
176+
case 'black': return 3;
177+
}
178+
}
179+
180+
function randomId(length) {
181+
let chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
182+
var result = '';
183+
for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
184+
return result;
185+
}

0 commit comments

Comments
 (0)