Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
praveen-9921 authored May 8, 2023
1 parent b05c0fb commit 29ccb56
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 0 deletions.
99 changes: 99 additions & 0 deletions Assets/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
*{
margin: 0;
padding: 0;
font-family: 'poppins',sans-serif;
box-sizing: border-box;
}
.container{
width: 100%;
min-height: 100vh;
background: linear-gradient(135deg,#153667,#4e085f);
padding: 10px;
}
.todo-app{
width: 100%;
max-width: 540px;
background: #fff;
margin: 100px auto 20px;
padding: 40px 30px 70px;
border-radius: 10px;
}
.todo-app h2{
color: #002765;
display: flex;
align-items: center;
margin-bottom: 20px;
}
.todo-app h2 img{
width: 30px;
margin-left: 10px;
}
.row{
display: flex;
align-items: center;
justify-content: space-between;
background: #edeef0;
border-radius: 30px;
padding-left: 20px;
margin-bottom: 25px;
}
input{
flex: 1;
border: none;
outline: none;
background: transparent;
padding: 10px;
}
button{
border: none;
outline: none;
padding: 16px 50px;
background: #ff5945;
color: #fff;
font-size: 16px;
cursor: pointer;
border-radius: 40px;
}
ul li{
list-style: none;
font-size: 17px;
padding: 12px 8px 12px 50px;
user-select: none;
cursor: pointer;
position: relative;
}
ul li::before{
content: '';
position: absolute;
height: 28px;
width: 28px;
border: 50%;
background-image: url(../images/unchecked.png);
background-size: cover;
background-position: center;
top: 9px;
left: 8px;
}
ul li.checked{
color: #555;
text-decoration: line-through;
}
ul li.checked::before{
background-image: url(../images/checked.png);
}

ul li span{
position: absolute;
right: 0;
top: 5px;
width: 40px;
height: 40px;
font-size: 22px;
color: #555;
line-height: 40px;
text-align: center;
}
ul li span:hover{
background: #edeef0;
border-radius: 50%;
}
Binary file added Assets/images/checked.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 Assets/images/icon.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 Assets/images/unchecked.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions Assets/script/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
const inputBox = document.getElementById("input-box");
const listContainer = document.getElementById("list-container");


function addTask(){
if(inputBox.value === ''){
alert("You must write something");
}
else{
let li = document.createElement("li");
li.innerHTML = inputBox.value;
listContainer.appendChild(li);
let span = document.createElement("span");
span.innerHTML = "\u00d7";
li.appendChild(span);
}
inputBox.value = "";
}


listContainer.addEventListener("click",function(e){
if(e.target.tagName === "LI"){
e.target.classList.toggle("checked");
}
else if(e.target.tagName === "SPAN"){
e.target.parentElement.remove();
}
},false);
13 changes: 13 additions & 0 deletions Assets/script/script1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const hide = document.getElementById("hide");
const show = document.getElementById("reveal");
const img = document.getElementById("img");


console.log(hide);

hide.addEventListener("mouseover",()=>{
img.style.display = "none";
})
reveal.addEventListener("mouseover",()=>{
img.style.display = "";
})
36 changes: 36 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="Assets/css/style.css">
<script defer src="Assets/script/script.js"></script>
<!-- <script defer src="Assets/script/script1.js"></script> -->
</head>
<body>
<div class="container">
<div class="todo-app">
<h2>To-Do List <img src="Assets/images/icon.png" alt="Try"></h2>
<div class="row">
<input type="text" id="input-box" placeholder="Add your text">
<button onclick="addTask()">Add</button>
</div>
<ul id="list-container">
<!-- <li class="checked">Task 1</li>
<li>Task 2</li>
<li>Task 3</li> -->
</ul>
</div>
</div>



<!-- <div class="img">
<img id="img" src="Assets/images/checked.png" alt="" srcset="">
</div>
<button id="hide">Hide</button>
<button id="reveal">Reveal</button> -->
</body>
</html>

0 comments on commit 29ccb56

Please sign in to comment.