Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b729810
refactor: adjust HTML/CSS/JS-formatting according to rule 1.2 in html…
titosik Mar 26, 2021
64d2e59
refactor: adjust HTML/CSS/JS-formatting according to rule 1.3 in html…
titosik Mar 26, 2021
3fe9b85
refactor: adjust HTML/CSS/-formatting according to rule 1.1 in html-a…
titosik Mar 26, 2021
50eac2c
refactor: adjust HTML/CSS/-formatting according to rule 2.1 in html-a…
titosik Mar 26, 2021
b6efe24
refactor: adjust HTML/CSS/-formatting according to rule 2.2 in html-a…
titosik Mar 26, 2021
e855621
refactor: adjust HTML-formatting according to rule 2.3 in html-and-cs…
titosik Mar 26, 2021
6969a64
refactor: adjust HTML-formatting according to rule 2.4 in html-and-cs…
titosik Mar 26, 2021
88d65c8
refactor: adjust HTML-formatting according to rule 2.5 in htnl-and-cs…
titosik Mar 26, 2021
a141c0e
refactor: adjust HTML/CSS-formatting according to rule 3.1 in htnl-an…
titosik Mar 26, 2021
11e5a8f
refactor: adjust HTML/CSS-formatting according to rule 3.2 in htnl-an…
titosik Mar 26, 2021
db278c7
refactor: adjust HTML/CSS-formatting according to rule 3.3 in htnl-an…
titosik Mar 26, 2021
422d786
refactor: adjust CSS-formatting according to rule 3.4 in html-and-css.md
titosik Mar 26, 2021
5b2be2b
refactor: adjust CSS-formatting according to rule 3.5 in html-and-css.md
titosik Mar 26, 2021
c0c45f7
refactor: adjust CSS-formatting according to rule 3.6 in html-and-css.md
titosik Mar 26, 2021
a35ad0d
refactor: adjust CSS-formatting according to rule 3.7 in html-and-css.md
titosik Mar 26, 2021
234c006
refactor: adjust CSS-formatting according to rule 3.8 in html-and-css.md
titosik Mar 26, 2021
0cc4df3
refactor: adjust HTML/CSS/JS-formatting according to rule 1.2 in html…
titosik Mar 26, 2021
d5a35a1
refactor: adjust HTML/CSS/JS-formatting according to rule 1.3 in html…
titosik Mar 26, 2021
399b9a0
refactor: adjust HTML/CSS/-formatting according to rule 1.1 in html-a…
titosik Mar 26, 2021
2d8d28c
refactor: adjust HTML/CSS/-formatting according to rule 2.1 in html-a…
titosik Mar 26, 2021
e833964
refactor: adjust HTML/CSS/-formatting according to rule 2.2 in html-a…
titosik Mar 26, 2021
d55cfef
refactor: adjust HTML-formatting according to rule 2.3 in html-and-cs…
titosik Mar 26, 2021
ca5c9c9
refactor: adjust HTML-formatting according to rule 2.4 in html-and-cs…
titosik Mar 26, 2021
2da7803
refactor: adjust HTML-formatting according to rule 2.5 in htnl-and-cs…
titosik Mar 26, 2021
f218910
refactor: adjust HTML/CSS-formatting according to rule 3.1 in htnl-an…
titosik Mar 26, 2021
d2d4319
refactor: adjust HTML/CSS-formatting according to rule 3.2 in htnl-an…
titosik Mar 26, 2021
9ffc055
refactor: adjust HTML/CSS-formatting according to rule 3.3 in htnl-an…
titosik Mar 26, 2021
9698651
refactor: adjust CSS-formatting according to rule 3.4 in html-and-css.md
titosik Mar 26, 2021
d27ae17
refactor: adjust CSS-formatting according to rule 3.5 in html-and-css.md
titosik Mar 26, 2021
77743ff
refactor: adjust CSS-formatting according to rule 3.6 in html-and-css.md
titosik Mar 26, 2021
be5efe3
refactor: adjust CSS-formatting according to rule 3.7 in html-and-css.md
titosik Mar 26, 2021
9a1fc68
refactor: adjust CSS-formatting according to rule 3.8 in html-and-css.md
titosik Mar 26, 2021
2538234
refactor: adjust HTML/CSS/JS-formatting according to rule 1.1 in html…
titosik Apr 6, 2021
89ca1cd
refactor: adjust HTML/CSS/JS-formatting according to rule 1.2 in html…
titosik Apr 6, 2021
b097faf
Merge branch 'master' into clean-code-s1e1
titosik Apr 6, 2021
cb40d17
fix:
titosik Apr 6, 2021
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
6 changes: 3 additions & 3 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("incompletetasks");//ul of #incompletetasks
var completedTasksHolder=document.getElementById("completed-tasks");//completed-tasks


Expand Down Expand Up @@ -85,7 +85,7 @@ 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");
var containsClass=listItem.classList.contains("editmode");
//If class of the parent is .editmode
if(containsClass){

Expand All @@ -99,7 +99,7 @@ var editTask=function(){
}

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


Expand Down
80 changes: 61 additions & 19 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,61 @@
<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>
<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"><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>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<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" media="screen" charset="utf-8">
</head>
<body>
<header class="hero-box">
<img src="./eisenhower-matrix.jpg" alt="The eisenhower matrix">
<a class="more-inf" href="https://goal-life.com/page/method/matrix-eisenhower">
Want more details?
</a>
</header>
<main class="">
<section id="top-add-element">
<h3 for="new-task">Add Item</h3>
<div class="task-row-wrapper">
<input id="new-task" class="task" type="text">
<button>Add</button>
</div>
</section>
<section class="">
<h3>Todo</h3>
<ul id="incompletetasks">
<li>
<input type="checkbox"><label class="task">Pay Bills</label>
<input type="text">
<button class="edit">Edit</button>
<button class="delete"><img src="./remove.svg" alt="icon delete"></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" alt="icon delete"></button>
</li>
</ul>
</section>
<section class="">
<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" alt="icon delete"></button>
</li>
</ul>
</section>
</main>
<script src="app.js"></script>
</body>
</html>


189 changes: 98 additions & 91 deletions style.css
Original file line number Diff line number Diff line change
@@ -1,154 +1,161 @@
/* 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-box {
width: 500px;
margin: 0 auto;
display: block;
text-align: right;
}
.aaa img {
width: 100%;
.hero-box img {
width: 100%;
}
.aaa .more_inf {
font-family: fantasy, cursive;
.hero-box
.more-inf {
font-family: fantasy, cursive;
}

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

.hero-box { text-align: center;
}

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

main {
.main-box {
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;
}
input[type="text"]:focus {
color: #333;
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;
}

/* 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;
}
p > button:hover {
color: #0FC57C;
p > button: hover {
color: #0FC57C;
}

/* 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
width: 226px;
}
li > button.delete:hover {
color: #CF2323;
li > button.delete: hover {
color: #CF2323;
}
button.delete img {
height: 2em;
transform: rotateZ(45deg);
transition: transform 200ms ease-in;
height: 2em;
transform: rotateZ(45deg);
transition: transform 200ms ease-in;
}
button.delete img:hover {
transform: rotateZ(0);
transform: rotateZ(0);
}

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

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

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

ul li.editMode label {
display:none;
ul li.editmode label {
display: none;
}