Skip to content

Sheela aprameya js mini projects #2

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

Merged
Merged
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 changes: 1 addition & 1 deletion Review Project/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const reviews = [
{
id: 1,
name: 'susan smith',
job: '',
job: 'web developer',
img: 'https://www.course-api.com/images/people/person-1.jpeg',
text: "I'm baby meggings twee health goth +1. Bicycle rights tumeric chartreuse before they sold out chambray pop-up. Shaman humblebrag pickled coloring book salvia hoodie, cold-pressed four dollar toast everyday carry",
},
Expand Down
20 changes: 20 additions & 0 deletions Todo_list/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<!--Please do not remove this part-->
![Star Badge](https://img.shields.io/static/v1?label=%F0%9F%8C%9F&message=If%20Useful&style=style=flat&color=BC4E99)
![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)

# Todo List
<p align="center">
<img src="C:\Users\Sheela\Git open source projects\mini-javascprit-projects\mini-javascript-projects\Todo_list" width=40% height=40%>

## 🛠️ Description
<!--Remove the below lines and add yours -->
A todo list where you can add and remove items.

## ⚙️ Languages or Frameworks Used
- JavaScript
- HTML
- CSS

## 🤖 Author
<!--Remove the below lines and add yours -->
![Sheela Aprameya](https://github.com/saprameya)
Binary file added Todo_list/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 Todo_list/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 Todo_list/images/todolist.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 Todo_list/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.
27 changes: 27 additions & 0 deletions Todo_list/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>To Do List </title>
<link href = "styles.css" rel = "stylesheet">
</head>
<body>
<div class="container">
<div class="todo-app">
<h2>To-Do List <img src="images/todolist.png" ></h2>
<div class="row">
<input type="text" id="input box" placeholder="Add your text">
<button onclick="addTask()">Add</button>
</div>
<ul id ="list-container">


</ul>
</div>
</div>

<script src = "script.js"></script>

</body>
</html>
39 changes: 39 additions & 0 deletions Todo_list/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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 = '';
saveData();
}

listContainer.addEventListener("click", function(e){
if(e.target.tagName === "LI"){
e.target.classList.toggle("checked");
saveData();
}
else if(e.target.tagName === "SPAN"){
e.target.parentElement.remove();
saveData();
}
}, false);

function saveData(){
localStorage.setItem("data", listContainer.innerHTML);
}

function showTask(){
listContainer.innerHTML = localStorage.getItem("data");
}

showTask();
114 changes: 114 additions & 0 deletions Todo_list/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
*{
margin: 0;
padding: 0;
font-family:Arial, Helvetica, sans-serif ;
box-sizing: border-box;
}
.container{
width: 100%;
min-height: 100vh;
background: linear-gradient(135deg, #153677, #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-radius: 50%;
background-image: url(images/unchecked.png);
background-size: cover;
background-position: center;
top: 12px;
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;
border-radius: 50%;
}

ul li span:hover{
background: #edeef0;
}