Skip to content

Commit

Permalink
fix(basic-3.4): change tag selectors to class selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
LesiaUKR committed Jan 10, 2024
1 parent 7ff4249 commit b85c7b1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ var createNewTaskElement = function (taskString) {

deleteButton.className = "task_btn task_btn-delete";
deleteButtonImg.src = "./remove.svg";
deleteButtonImg.className = "task_delete-img";
deleteButton.appendChild(deleteButtonImg);

//and appending.
Expand Down
20 changes: 16 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ <h2 class="task_section-title">Todo</h2>
<input class="task_item-input" type="text" />
<button class="task_btn task_btn-edit">Edit</button>
<button class="task_btn task_btn-delete">
<img src="./remove.svg" alt="Delete button" />
<img
class="task_delete-img"
src="./remove.svg"
alt="Delete button"
/>
</button>
</li>
<li class="task_item edit-mode">
Expand All @@ -54,7 +58,11 @@ <h2 class="task_section-title">Todo</h2>
<input class="task_item-input" type="text" value="Go Shopping" />
<button class="task_btn task_btn-edit">Save</button>
<button class="task_btn task_btn-delete">
<img src="./remove.svg" alt="Delete button" />
<img
class="task_delete-img"
src="./remove.svg"
alt="Delete button"
/>
</button>
</li>
</ul>
Expand All @@ -65,10 +73,14 @@ <h2 class="task_section-title">Completed</h2>
<li class="task_item">
<input class="task_item-checkbox" type="checkbox" checked />
<label class="task_item-label">See the Doctor</label>
<input type="text" class="task" />
<input class="task_item-input" type="text" />
<button class="task_btn task_btn-edit">Edit</button>
<button class="task_btn task_btn-delete">
<img src="./remove.svg" alt="Delete button" />
<img
class="task_delete-img"
src="./remove.svg"
alt="Delete button"
/>
</button>
</li>
</ul>
Expand Down
10 changes: 5 additions & 5 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,13 @@ button {
width: 226px;
}

.task_btn-delete img {
.task_btn-delete .task_delete-img {
height: 2em;
transform: rotateZ(45deg);
transition: transform 200ms ease-in;
}

.task_btn-delete img:hover {
.task_btn-delete .task_delete-img:hover {
transform: rotateZ(0);
}

Expand All @@ -158,15 +158,15 @@ button {
}

/* Edit Task */
.task_item input[type="text"] {
.task_item .task_item-input {
display: none;
}

.edit-mode input[type="text"] {
.edit-mode .task_item-input {
display: inline-block;
width: 224px;
}

.edit-mode label {
.edit-mode .task_item-label {
display: none;
}

0 comments on commit b85c7b1

Please sign in to comment.