Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 43 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
<link rel="stylesheet" href="main.css">
<h3>todo!</h3>
<script src="main.js"></script>
<!DOCTYPE html>
<html>
<head>
<title>TO-DO LIST</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="test.css">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<script type="text/javascript" src="test.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container-fluid">

<div class="heading"><h2 id="H" class="text-center"><b>TO-DO!!</b></h2></div>

<form id="addForm">
<div class="row text-field">
<div class="col-xs-10">
<input class="form-control" id="taskEntered" type="text" placeholder="Add your task here" required></input>
</div>
<div class="col-xs-2">
<button title="Add Task to List" class="btn btn-default btn-block" id="Add"><b>ADD</b></button>
</div>
</div>
</form>

<div class="well" id="to-be-done">
<h3>To Be Done:</h3>
</div>

<div class="well" id="done">
<h3>Completed:</h3>
</div>

</div>


</body>
</html>
54 changes: 51 additions & 3 deletions main.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,51 @@
body {
padding: 20px;
}
h2 {
color : white;
font-family: nexa;
}

h3{
font-family: avenier;
}

body{
background-color: #3E3E3E;
font-family: ebrima;
}

.text-field{
margin-top: 50px;
margin-bottom: 50px;
}

.heading{
background-color: #F4722B;
}

.well{
background-color: #B3A78C;
}

.l_property{
background-color: #CCCCCC;
padding: 1px;
}

.col-xs-1{
text-align: center;
margin-top: 10px;
}

#Add{
background-color: #3F72AF;
color: white;
}

#removeBtn{
margin-top: 3px;

}

#done > div > div > h4 {
text-decoration: line-through;
}

41 changes: 40 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
console.log('test');
$(document).ready(function(){

//to add elements in to be done list
$("#Add").click(function(e){
if($("#taskEntered").val() === ""){//checking empty or not
alert("Error : No Task Entered");
return false;
}
else{
var taskAdded = $("#taskEntered").val();//taking input task from textbox
$("#to-be-done").append("<div class='row well l_property'>" + "<div class='col-xs-1'>" + "<input class='check_todo' type='checkbox' name='completed'>" + "</div>" + "<div class='col-xs-10'>" + "<h4>" + taskAdded + "</h4>" + "</div>" + "<div col-xs-1>" + "<button title='Remove from list ' class='btn btn-default btn-danger' id='removeBtn'><b>Remove</b></button>" + "</div>");
$("#addForm")[0].reset();//to reset textbox
e.preventDefault();//to prevent form reset
}
});

//Remove element from list
$(document).on('click', '#removeBtn',function(){
var taskDel = $(this).parent().parent();
$(taskDel).remove();
});

//moving checked task to 'done' list
$("#to-be-done").on('click', '.check_todo' ,function(){
if($(this).is(':checked')){
var parentEle =$(this).parent().parent();
$(parentEle).appendTo("#done");
}
} );

//moving uncheck task to 'to-be-done' list
$("#done").on('click', '.check_todo' ,function(){
if(!($(this).is(':checked'))){
var parentEle =$(this).parent().parent();
$(parentEle).appendTo("#to-be-done");
}
} );


});