Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

todo list assignment added #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
2,337 changes: 2,337 additions & 0 deletions Shivangi Goel/Todolist/css/font-awesome.css

Large diffs are not rendered by default.

184 changes: 184 additions & 0 deletions Shivangi Goel/Todolist/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
body{
padding: 0;
margin: 0;
background-color: rgba(0,0,0,0.1);
font-family: 'Titillium Web', sans-serif;
}

/* ------------ container ------------ */
.container{
padding:10px;
width:380px;
margin:0 auto;
}

/* ------------ header ------------ */
.header{
width: 380px;
height:200px;
background-image: url('../img/bg2.jpg');
background-size: 100% 200%;
background-repeat: no-repeat;
border-radius: 15px 15px 0 0;
position: relative;
}
.clear{
width : 30px;
height: 30px;
position: absolute;
right:20px;
top: 20px;
}
.clear i{
font-size: 30px;
color: #FFF;
}
.clear i:hover{
cursor: pointer;
text-shadow: 1px 3px 5px #000;
transform: rotate(45deg);
}
#date{
position: absolute;
bottom: 10px;
left: 10px;
color: #FFF;
font-size: 25px;
font-family: 'Titillium Web', sans-serif;
}

/* ------------ content ------------ */
.content{
width:380px;
height: 350px;
max-height:350px;
background-color: #FFF;
overflow: auto;
}
.content::-webkit-scrollbar {
display: none;
}
.content ul{
padding:0;
margin:0;
}
.item{
width:380px;
height: 45px;
min-height: 45px;
position: relative;
border-bottom: 1px solid rgba(0,0,0,0.1);
list-style: none;
padding: 0;
margin: 0;
}
.item i.co{
position: absolute;
font-size: 25px;
padding-left:5px;
left:15px;
top:10px;
}
.item i.co:hover{
cursor: pointer;
}
.fa-check-circle{
color:#6eb200;
}
.item p.text{
position: absolute;
padding:0;
margin:0;
font-size: 20px;
left:50px;
top:5px;
background-color: #FFF;
max-width:285px;
}
.lineThrough{
text-decoration: line-through;
color : #ccc;
}
.item i.de{
position: absolute;
font-size: 25px;
right:15px;
top:10px;
}
.item i.de:hover{
color:#af0000;
cursor: pointer;
}
/* ------------ add item ------------ */
.add-to-do{
position: relative;
width: 360px;
height:40px;
background-color: #FFF;
padding: 10px;
border-top: 1px solid rgba(0,0,0,0.1);
}
.add-to-do i{
position: absolute;
font-size: 40px;
color: #4162f6;
}

.add-to-do input{
position: absolute;
left: 50px;
height: 35px;
width: 310px;
background-color: transparent;
border: none;
font-size: 20px;
padding-left:10px;
}
.add-to-do input::-webkit-input-placeholder { /* Chrome/Opera/Safari */
color: #4162f6;
font-family: 'Titillium Web', sans-serif;
font-size: 20px;
}
.add-to-do input::-moz-placeholder { /* Firefox 19+ */
color: #4162f6;
font-family: 'Titillium Web', sans-serif;
font-size: 20px;
}
.add-to-do input:-ms-input-placeholder { /* IE 10+ */
color: #4162f6;
font-family: 'Titillium Web', sans-serif;
font-size: 20px;
}
.add-to-do input:-moz-placeholder { /* Firefox 18- */
color: #4162f6;
font-family: 'Titillium Web', sans-serif;
font-size: 20px;
}




























Binary file added Shivangi Goel/Todolist/fonts/FontAwesome.otf
Binary file not shown.
Binary file not shown.
2,671 changes: 2,671 additions & 0 deletions Shivangi Goel/Todolist/fonts/fontawesome-webfont.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Shivangi Goel/Todolist/img/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 Shivangi Goel/Todolist/img/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 Shivangi Goel/Todolist/img/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 Shivangi Goel/Todolist/img/bg2.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 Shivangi Goel/Todolist/img/images.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions Shivangi Goel/Todolist/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>JavaScript - To Do List</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Titillium+Web">
<link rel="stylesheet" href="css/font-awesome.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div class="container">
<div class="header">
<div class="clear" onclick="clearall()">
<i class="fa fa-refresh" id="refresh"></i>
</div>
<div id="date">hgjh</div>
</div>
<div class="content">
<ul id="list">

</ul>
</div>
<div>
<i class="fa fa-plus-circle"></i>
<input type="text" id="input" placeholder="Add A todo">
</div>
</div>
</body>
<script src="js/app.js"></script>
</html>
61 changes: 61 additions & 0 deletions Shivangi Goel/Todolist/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
const clear = document.querySelector("clear");
const list = document.getElementById("list");
const input = document.getElementById("input");
const dateElement = document.getElementById("date");

const options ={weekday:"long", month :"short", day:"numeric"};

const today = new Date();

const CHECK = "fa-check-circle";
const UNCHECK = "fa-circle-thin";
const LINETHROUGH = "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);
}
}
});

function complete(element){
// element.classList.toggle(CHECK);
// element.classList.toggle(UNCHECK);
// element.parentNode.querySelector(".text").classList.toggle(LINETHROUGH);
element.classList.toggle(UNCHECK);
element.classList.toggle(CHECK);
element.parentNode.querySelector(".text").classList.toggle(LINETHROUGH);
}

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

list.addEventListener("click",function(event){
const element = event.target;
const elementjob = element.attributes.job.value;
if(elementjob == "complete"){
complete(element);
}
else if(elementjob == "delete"){
removeTodo(element);
}
});

function clearall(){

list.innerHTML = '';
}