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

submission to the challenge-44 #49

Open
wants to merge 2 commits into
base: main
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Now, once you've forked this repo and got a local version up on your computer, f
- [Satoshi's Converter](/submissions/Almopt.html) - By: [Almopt](https://github.com/Almopt)
- [Tic tac toe](./submissions/sherawat-Lokesh.html) -By: [sherawat-Lokesh](https://github.com/sherawat-Lokesh)
- [House Garbage Management website](/submissions/Fly0w.html) - By: [Fly0w](https://github.com/Fly0w)
- [To Do List](/submissions/bshohug.html) - By: [bshohug](https://github.com/bshohug)


## One Last Thing!
Expand Down
137 changes: 137 additions & 0 deletions submissions/bshohug.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
<!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>

<style>
* {
margin: 0;
padding: 0;
font-family: 'montserrat', sans-serif;
box-sizing: border-box;
}

body {
background-image: linear-gradient(120deg, #91eea8, #31ccfb);
min-height: 100vh;
}

.container {
max-width: 800px;
margin: auto;
padding: 10px;
}

.taskList {
width: 100%;
border: none;
border-bottom: 2px solid rgb(0, 0, 0);
background: none;
padding: 10px;
outline: none;
font-size: 18px;
}

h1 {
padding: 50px;
text-align: center;
}

h3 {
margin: 10px 0;
padding: 10px;
background-color: rgb(245, 181, 138);
border-radius: 10px;
box-shadow: 2px 2px 1px rgb(241, 241, 241);
}

.completedTask h3 {
background-color: rgb(138, 245, 195);
}

.task {
width: 100%;
background: rgba(255, 255, 255, 0.5);
padding: 18px;
margin: 6px 0;
overflow: hidden;
border-radius: 10px;
}

.task i {
float: right;
margin-left: 20px;
cursor: pointer;
}

.completedTask .task {
background: rgba(0, 0, 0, 0.5);
color: #fff;
}

.pendingTask {
float: left;
width: 49.5%;
}

.completedTask {
float: right;
width: 49.5%;
}
</style>

<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.1/css/all.min.css"
/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>

<body>
<div class="container">
<h1>TO DO LIST</h1>
<input
type="text"
class="taskList"
placeholder="Enter a task"
name=""
id=""
/>
<div class="pendingTask">
<h3>Pending</h3>
</div>
<div class="completedTask">
<h3>Completed</h3>
</div>
</div>

<script>
$('.taskList').on('keyup', function (enterTask) {
if (enterTask.keyCode == 13 && $('.taskList').val() != '') {
const task = $("<div class='task'></div>").text($('.taskList').val());
const del = $("<i class='fas fa-trash-alt'></i>").click(function () {
let p = $(this).parent();
p.fadeOut(function () {
p.remove();
});
});

const check = $("<i class='fas fa-check'></i>").click(function () {
let p = $(this).parent();
p.fadeOut(function () {
$('.completedTask').append(p);
p.fadeIn();
});
$(this).remove();
});

task.append(del, check);
$('.pendingTask').append(task);
$('.taskList').val('');
}
});
</script>
</body>
</html>