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

many changes commited #6

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
13 changes: 13 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ for (i = 0; i < myNodelist.length; i++) {
myNodelist[i].appendChild(span);
}


function setFocus(){
document.getElementById("myInput").focus();
}
// Click on a close button to hide the current list item
var close = document.getElementsByClassName("close");
var i;
Expand All @@ -19,13 +23,22 @@ for (i = 0; i < close.length; i++) {
}
}



// Add a "checked" symbol when clicking on a list item
var list = document.querySelector('ul');
list.addEventListener('click', function(ev) {
if (ev.target.tagName === 'LI') {
ev.target.classList.toggle('checked');
}
}, false);
list.addEventListener('keypress', function(ev) {
if(ev.key==='enter'){
if (ev.target.tagName === 'LI') {
ev.target.classList.toggle('checked');
}
}
}, false);

// Create a new list item when clicking on the "Add" button
function newElement() {
Expand Down
16 changes: 15 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
<html>
<head>
<title>To Do List</title>
<link rel="stylesheet" href="./styles.css" type="text/css" />
</head>
<body>
<div id="myDIV" class="header" onchange="newElement()">
<h2>My To Do List</h2>
<div class="button">
<input type="text" id="myInput" placeholder="Title..." />
<span class="addBtn">Add</span>
</div>
</div>

<!DOCTYPE html>
<html lang="en">
<head>
Expand All @@ -7,7 +21,7 @@

<title>To Do List</title>
<!-- cdn link for fontawesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.0/css/all.min.css">
<link rel="stylesh

<!-- link for css file -->
<link rel="stylesheet" href="./styles.css" type="text/css" />
Expand Down
53 changes: 28 additions & 25 deletions styles.css
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400&family=Outfit:wght@100;200;300;400;500;600;700;800;900&family=Poppins:wght@100;200;300;400;500;700;800;900&family=Raleway:wght@100;200;300;400;500;600;700;800;900&display=swap');
/* Include the padding and border in an element's total width and height */
* {
box-sizing: border-box;
padding: 0;
margin: 0;
font-family: 'Poppins',sans-serif;

}
body{
background-color: #D2DAFF;
}


.title{
text-align: center;
}


#myDIV{
width: 50%;
margin: 0 auto;
border-radius: 30px 30px 0px 0px




}
#divunder{
padding-top: 10px;
Expand All @@ -34,14 +19,17 @@ border-radius: 30px 30px 0px 0px

/* Remove margins and padding from the list */
ul {
margin: 0;
margin: auto;
max-width: 1000px;
list-style-type: none;
padding: 0;
}

/* Style the list items */
ul li {
cursor: pointer;
position: relative;

padding: 12px 8px 12px 40px;
background: #eee;
font-size: 18px;
Expand Down Expand Up @@ -100,10 +88,21 @@ ul li.checked::before {

/* Style the header */
.header {
background-color:#FFE3E1;
padding: 30px 40px;
background: linear-gradient(90deg, rgba(149,61,203,1) 19%, rgba(203,61,95,1) 41%, rgba(255,179,0,1) 77%);;
padding: 50px 0px;

color: white;
text-align: center;
padding-bottom:70px ;
}

.header h2{
padding: 20px 0;
}

div .button{
margin:auto;
max-width: 1000px;
}

/* Clear floats after the header */
Expand All @@ -114,16 +113,20 @@ ul li.checked::before {
}

/* Style the input */
#myInput {
margin-left: 150px ;
input {

border: none;
border-radius: 0;
width: 45%;
padding: 10px;
float: left;
font-size: 16px;
autofocus:true;
}
input:focus{
outline: none;

}

/* Style the "Add" button */
.addBtn {
padding: 10px;
Expand Down