Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
011c006
refactor: add two spaces for one indentation to rule 1.1 in html-and-…
bearBenjamin Oct 17, 2025
7d737b4
refactor: add two spaces for one indentation to rule 1.1 in html-and-…
bearBenjamin Oct 17, 2025
9275439
refactor: update values in lowercase to rule 1.2 in html-and-css.md i…
bearBenjamin Oct 17, 2025
355c272
refactor: update values in lowercase to rule 1.2 in html-and-css.md i…
bearBenjamin Oct 17, 2025
02e3086
refactor: update quotes to rule 1.3 in html-and-css.md in file index.…
bearBenjamin Oct 17, 2025
a1ca8be
refactor: update quotes to rule 1.3 in html-and-css.md in file style.css
bearBenjamin Oct 17, 2025
6a72c03
fix: add DOCTYPE to rule 2.2 in html-and-css.md in file index.html
bearBenjamin Oct 17, 2025
f999124
refactor: update named character to rule 2.3 in html-and-css.md in fi…
bearBenjamin Oct 17, 2025
5e31d03
refactor:update type attribute to rule 2.4 in html-and-css.md in file…
bearBenjamin Oct 17, 2025
e70d49f
fix: name writting single style to rule 3.1 in html-and-css.md in fil…
bearBenjamin Oct 17, 2025
e5277f5
fix: change name to rule 3.2 in html-and-css.md in files index.html, …
bearBenjamin Oct 17, 2025
f51483c
refactor: update name to rule 3.3 in html-and-css.md in files index.h…
bearBenjamin Oct 17, 2025
79da2a6
fix: updated names by tag selector to rule 3.4 in html-and-css.md in …
bearBenjamin Oct 17, 2025
cb018a8
refactor: add indents in blocks to rule 3.5 in html-and-css.md in fil…
bearBenjamin Oct 17, 2025
7f0a547
fix: add space after property name, add semicolon after properties to…
bearBenjamin Oct 17, 2025
32e8cc3
refactor: separated the selectors with a line break to rule 3.8 in ht…
bearBenjamin Oct 17, 2025
821ccee
refactor: separated the CSSrules with one space line in file style.css
bearBenjamin Oct 17, 2025
ce4682f
refactor: update name tag to rule 1.1 in html-and-css-extended.md
bearBenjamin Oct 17, 2025
3b3d677
refactor: add alt text and type button to rule 1.2 in html-and-css-ex…
bearBenjamin Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

var taskInput=document.getElementById("new-task");//Add a new task.
var addButton=document.getElementsByTagName("button")[0];//first button
var incompleteTaskHolder=document.getElementById("incompleteTasks");//ul of #incompleteTasks
var incompleteTaskHolder=document.getElementById("incomplete-tasks");//ul of #incomplete-tasks
var completedTasksHolder=document.getElementById("completed-tasks");//completed-tasks


Expand Down Expand Up @@ -85,11 +85,11 @@ var editTask=function(){
var editInput=listItem.querySelector('input[type=text]');
var label=listItem.querySelector("label");
var editBtn=listItem.querySelector(".edit");
var containsClass=listItem.classList.contains("editMode");
//If class of the parent is .editmode
var containsClass=listItem.classList.contains("edit-mode");
//If class of the parent is .edit-mode
if(containsClass){

//switch to .editmode
//switch to .edit-mode
//label becomes the inputs value.
label.innerText=editInput.value;
editBtn.innerText="Edit";
Expand All @@ -98,8 +98,8 @@ var editTask=function(){
editBtn.innerText="Save";
}

//toggle .editmode on the parent.
listItem.classList.toggle("editMode");
//toggle .edit-mode on the parent.
listItem.classList.toggle("edit-mode");
};


Expand Down Expand Up @@ -131,7 +131,7 @@ var taskIncomplete=function(){
console.log("Incomplete Task...");
//Mark task as incomplete.
//When the checkbox is unchecked
//Append the task list item to the #incompleteTasks.
//Append the task list item to the #incomplete-tasks.
var listItem=this.parentNode;
incompleteTaskHolder.appendChild(listItem);
bindTaskEvents(listItem,taskCompleted);
Expand Down Expand Up @@ -192,4 +192,4 @@ for (var i=0; i<completedTasksHolder.children.length;i++){

//prevent creation of empty tasks.

//Change edit to save when you are in edit mode.
//Change edit to save when you are in edit mode.
73 changes: 57 additions & 16 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,60 @@
<!DOCTYPE html>
<html>
<HEAD><title>Todo App</title>
<link href='https://fonts.googleapis.com/css?family=Lato:300,400,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="style.css" type="text/css" MEDIA="screen" charset="utf-8">
</HEAD>

<head>
<title>Todo App</title>
<link href="https://fonts.googleapis.com/css?family=Lato:300,400,700" rel="stylesheet">
<link rel="stylesheet" href="style.css" media="screen">
</head>

<body>
<div class="aaa"><img src="./eisenhower-matrix.jpg"><a class='more_inf' href="https://goal-life.com/page/method/matrix-eisenhower">Want more details&quest;</a></div>
<div class="centered-main-page-element"><p id='topSectionForAddingElementToList'><label for="new-task">Add Item</label><div class="task-row-wrapper"><input id='new-task'class="task" type="text"><button>Add</button></div>
</p><h3>Todo</h3>
<ul id='incompleteTasks'>
<li><input type='checkbox'><label class="task">Pay Bills</label><input type="text" class="task"><button class="edit">Edit</button><button class="delete"><img src="./remove.svg"></button></li>
<li class="editMode"><input type="checkbox"><label class="task">Go Shopping</label><input type="text" value="Go Shopping" class="task"><button class='edit'>Save</button><button class="delete"><img src="./remove.svg"></button></li>
</ul><h3>Completed</h3><ul id="completed-tasks"><li><input type="checkbox" checked><label class="task">See the Doctor</label><input type="text" class="task"><button class="edit">Edit</button><button class="delete"><img src="./remove.svg"></button>
</li>
</ul>
</div>
<script type="text/javascript" SRC="app.js"></script>
<header class="hero-content">
<img src="./eisenhower-matrix.jpg" alt="matrix TODO list">
<a class="more-information" href="https://goal-life.com/page/method/matrix-eisenhower">Want more details?</a>
</header>
<main class="centered-main-page-element">
<div id="top-section-for-adding-element-to-list">
<label for="new-task">Add Item</label>
<div class="task-row-wrapper">
<input id="new-task" class="task" type="text">
<button type="button">Add</button>
</div>
</div>
<h3>Todo</h3>
<ul id="incomplete-tasks">
<li>
<input type="checkbox">
<label class="task">Pay Bills</label>
<input type="text" class="task">
<button class="edit" type="button">Edit</button>
<button class="delete" type="button">
<img src="./remove.svg" alt="delete todo task">
</button>
</li>
<li class="edit-mode">
<input type="checkbox">
<label class="task">Go Shopping</label>
<input type="text" value="Go Shopping" class="task">
<button class="edit" type="button">Save</button>
<button class="delete" type="button">
<img src="./remove.svg" alt="delete todo task">
</button>
</li>
</ul>
<h3>Completed</h3>
<ul id="completed-tasks">
<li>
<input type="checkbox" checked>
<label class="task">See the Doctor</label>
<input type="text" class="task">
<button class="edit" type="button">Edit</button>
<button class="delete" type="button">
<img src="./remove.svg" alt="delete todo task">
</button>
</li>
</ul>
</main>
<script src="app.js"></script>
</body>
</html>

</html>
203 changes: 113 additions & 90 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,148 +1,171 @@
/* Basic Style */
body {
background-color: #f8f8f8;
color: #333;
font-family: Lato, sans-serif;
background-color: #f8f8f8;
color: #333;
font-family: "Lato", sans-serif;
}
.aaa {
width: 500px;
margin: 0 auto;
display: block;
text-align: right;

.hero-content {
width: 500px;
margin: 0 auto;
display: block;
text-align: right;
}
.aaa img {
width: 100%;

.hero-content img {
width: 100%;
}
.aaa .more_inf {
font-family: fantasy, cursive;

.hero-content .more-information {
font-family: "fantasy", cursive;
}

@media (max-width:768px) {
.aaa { text-align: center;
}
.hero-content {
text-align: center;
}
}

.centered-main-page-element {
display: block;
width: 500px;
margin: 0 auto 0;
display: block;
width: 500px;
margin: 0 auto 0;
}

.task {
width: 56%;
display: inline-block;
flex-grow: 1
width: 56%;
display: inline-block;
flex-grow: 1;
}

.task-row-wrapper {
display: flex;
display: flex;
}

ul {
margin:0;
padding: 0px;
margin: 0;
padding: 0px;
}
li, h3 {
list-style:none;

li,
h3 {
list-style: none;
}
input,button{
outline:none;

input,
button {
outline: none;
}

button {
background: none;
border: 0px;
color: #888;
font-size: 15px;
width: 60px;
font-family: Lato, sans-serif;
cursor: pointer;
background: none;
border: 0px;
color: #888;
font-size: 15px;
width: 60px;
font-family: "Lato", sans-serif;
cursor: pointer;
}

button:hover {
color: #3a3A3a;
color: #3a3a3a;
}

/* Heading */
h3,
label[for='new-task'] {
color: #333;
font-weight: 700;
font-size: 15px;
border-bottom: 2px solid #333;
padding: 30px 0 10px;
margin: 0;
text-transform: uppercase;
label[for="new-task"] {
color: #333;
font-weight: 700;
font-size: 15px;
border-bottom: 2px solid #333;
padding: 30px 0 10px;
margin: 0;
text-transform: uppercase;
}

input[type="text"] {
margin: 0;
font-size: 18px;
line-height: 18px;
height: 21px;
padding: 0 9px;
border: 1px solid #dDd;
background: #FFF;
border-radius: 6px;
font-family: Lato, sans-serif;
color: #888;
margin: 0;
font-size: 18px;
line-height: 18px;
height: 21px;
padding: 0 9px;
border: 1px solid #ddd;
background: #fff;
border-radius: 6px;
font-family: "Lato", sans-serif;
color: #888;
}

input[type="text"]:focus {
color: #333;
color: #333;
}

/* New Task */
label[for='new-task'] {
display: block;
margin: 0 0 20px;
label[for="new-task"] {
display: block;
margin: 0 0 20px;
}
input#new-task {
width: 318px;

#new-task {
width: 318px;
}

/* Task list */
li {
overflow: hidden;
padding: 20px 0;
border-bottom: 1px solid #eee;
overflow: hidden;
padding: 20px 0;
border-bottom: 1px solid #eee;

display: flex;
justify-content: space-between;
align-items: center;
display: flex;
justify-content: space-between;
align-items: center;
}

li > * {
vertical-align: middle;
vertical-align: middle;
}

li > input[type="checkbox"] {
margin: 0 10px;
margin: 0 10px;
}

li > label {
padding-left: 10px;
box-sizing: border-box;
font-size: 18px;
width: 226px;
padding-left: 10px;
box-sizing: border-box;
font-size: 18px;
width: 226px;
}
li > input[type="text"] {
width: 226px

li > input[type="text"] {
width: 226px;
}
button.delete img {
height: 2em;
transform: rotateZ(45deg);
transition: transform 200ms ease-in;

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

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

/* Completed */
ul#completed-tasks label {
text-decoration: line-through
color: #888;
#completed-tasks label {
text-decoration: line-through;
color: #888;
}

/* Edit Task */
ul li input[type=text] {
display:none
ul li input[type="text"] {
display: none;
}

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

ul li.editMode label {
display:none;
}
ul .edit-mode label {
display: none;
}