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
Binary file added FontAwesome.otf
Binary file not shown.
71 changes: 71 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
const clear = document.querySelector(".clear");
const dateElement = document.getElementById("date");
const list = document.getElementById("list");
const input = document.getElementById("input");

const options = {weekday : "long" ,month: "short" , day: "numeric"}
const today = new Date();
console.log(today);
const CHECK = "fa-check-circle";
const UNCHECK = "fa-circle-thin";
const LINE_THROUGH = "lineThrough";
dateElement.innerHTML = today.toLocaleDateString("en-IN",options);


function addToDo(todo)
{
const item = ` <li class ="item">
<i class ="fa fa-circle-thin co" job="complete"></i>
<p class="text">${todo}</p>
<i class="fa fa-trash-o de" job="delete"></i>
</li>`
const position ="beforeend"
list.insertAdjacentHTML(position,item);

}


document.addEventListener("keyup", function(event){
if(event.key == "Enter"){
const todo = input.value;

if(todo){
addToDo(todo);
}
}
});

list.addEventListener("click",function(event){
const element = event.target;
const elementJob = element.attributes.job.value;

if(elementJob == "complete"){
completeToDo(element);
}
else if(elementJob == "delete"){
removeToDo(element);
}

})


function completeToDo(element){
element.classList.toggle(UNCHECK);
element.classList.toggle(CHECK);
element.parentNode.querySelector(".text").classList.toggle(LINE_THROUGH);

}



function removeToDo(element){
element.parentNode.parentNode.removeChild(element.parentNode);
}



function clearall(){
const myNode = document.getElementById("list");
myNode.innerHTML = '';

}
Binary file added bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bg1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added bg2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1016/202001.364:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3)
Loading