├── LICENSE
├── index.html
├── index.css
├── README.md
└── index.js
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 GÖKMEN NİŞANCI
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
10 | Contributors
11 | Gökmen Nişancı
12 | License & copyright
13 | © Gökmen Nişancı , Web Software and Design
14 | Licensed under the MIT License,
15 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | todoList
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | margin-left: 16em;
3 | margin-top: 2em;
4 | }
5 |
6 | #tagAll {
7 | display: flex;
8 | }
9 |
10 |
11 | /*left style*/
12 |
13 | #left-fieldset fieldset {
14 | width: 21em;
15 | height: 52em;
16 | border-radius: 1em;
17 | }
18 |
19 | #left-fieldset h2 {
20 | background-color: #a8a8a8;
21 | width: 12em;
22 | text-align: center;
23 | border-radius: 1em;
24 | opacity: 0.8;
25 | border: 2px solid #000000;
26 | margin-bottom: 2em;
27 | }
28 |
29 | #left-fieldset hr {
30 | opacity: 0.8;
31 | }
32 |
33 | #left-fieldset .hr1 {
34 | margin-bottom: 6em;
35 | }
36 |
37 | #left-fieldset .clearTodoBtn {
38 | width: 12em;
39 | height: 3em;
40 | color: #f2f2f2;
41 | background-color: #000000;
42 | border-radius: 1.5em;
43 | opacity: 0.7;
44 | margin-top: 2em;
45 | margin-left: 4em;
46 | }
47 |
48 | #left-fieldset .clearTodoBtn:hover {
49 | background-color: #c5c5c5;
50 | color: #000000;
51 | }
52 |
53 | #left-fieldset .clearTodoBtn:focus {
54 | border: 2px solid #00ffff;
55 | }
56 |
57 |
58 | /*body fieldset style*/
59 |
60 | #body-fieldset fieldset {
61 | width: 76em;
62 | height: 52em;
63 | border-radius: 1em;
64 | margin-left: 2em;
65 | }
66 |
67 | #body-fieldset h2 {
68 | background-color: #a8a8a8;
69 | width: 12em;
70 | text-align: center;
71 | border-radius: 1em;
72 | opacity: 0.8;
73 | border: 2px solid #000000;
74 | margin-bottom: 2em;
75 | }
76 |
77 | #body-fieldset .todoList {
78 | width: 21em;
79 | height: 2.5em;
80 | }
81 |
82 | #body-fieldset .addTodoBtn {
83 | width: 12em;
84 | height: 3em;
85 | color: #f2f2f2;
86 | background-color: #000000;
87 | border-radius: 1.5em;
88 | opacity: 0.7;
89 | }
90 |
91 | #body-fieldset .addTodoBtn:hover {
92 | background-color: #f2f2f2;
93 | color: #000000;
94 | }
95 |
96 | #body-fieldset .addTodoBtn:focus {
97 | border: 2px solid #00ffff;
98 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Todo List Project
2 |
3 |
4 | 
5 |
6 |
7 |
8 |
USE OF
9 |
10 | How about taking notes?
11 | Write what you want to do and click the 'Add Todo' button.
12 | Good luck. don't forget anymore 😄
13 |
14 |
15 |
16 |
17 |
18 |
19 |
26 |
27 |
37 |
38 |
39 |
40 |
41 |
42 | © Gökmen Nişancı / Web Developer.
43 |
44 |
45 |
46 | [](https://git.io/typing-svg)
47 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | /*todo list button & input value */
2 |
3 | const addBtn = document.querySelector(".addTodoBtn");
4 | const addTodo = document.querySelector(".todoList");
5 | const addUl = document.querySelector(".list-group");
6 |
7 |
8 | const clearBtn = document.querySelector(".clearTodoBtn");
9 | const newTodo = document.querySelector(".comeTodo");
10 |
11 | /*all th event listeners */
12 | eventListeners();
13 |
14 | function eventListeners() {
15 |
16 | addBtn.addEventListener("click", addTodos);
17 | clearBtn.addEventListener("click", deleteTodo);
18 |
19 |
20 |
21 | }
22 |
23 | function deleteTodo(e) {
24 |
25 | if (confirm("Are you sure you want to delete all todos?")) {
26 |
27 | listItem.innerHTML = "";
28 |
29 |
30 |
31 | }
32 |
33 |
34 |
35 | }
36 |
37 |
38 | /*no space the trim :=) */
39 |
40 | function addTodos(e) {
41 | const newTodo = addTodo.value.trim();
42 |
43 | /*alert message */
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | /*UI ADD TODO */
53 | addTodoToUı(newTodo);
54 |
55 | e.preventDefault(e)
56 | }
57 |
58 |
59 |
60 | function addTodoToUı(newTodo) {
61 |
62 | /*add the listItem */
63 |
64 | /* */
65 |
66 | const listItem = document.createElement("li");
67 | listItem.style.fontSize = "21px";
68 | listItem.style.color = "black";
69 | listItem.style.marginBottom = "0.55em";
70 |
71 |
72 | /*add the link */
73 | const link = document.createElement("a");
74 | link.href = "#";
75 | link.className = "delete-item";
76 | link.innerHTML = " "
77 | listItem.className = "fa-remove";
78 |
79 |
80 | /*add the deleteIcon */
81 |
82 | /*
*/
83 |
84 | const deleteİcon = document.createElement("img");
85 | deleteİcon.src = ("https://img.icons8.com/material-outlined/28/000000/delete-sign.png");
86 | deleteİcon.style.float = "right";
87 | deleteİcon.className = "deleteIcon"
88 | deleteİcon.style.marginRight = "1em";
89 |
90 |
91 | /*add text node */
92 | listItem.appendChild(document.createTextNode(newTodo));
93 | listItem.appendChild(link);
94 | listItem.appendChild(deleteİcon);
95 |
96 | /*todo list in the listItem */
97 | addUl.appendChild(listItem);
98 |
99 | /*input clear before value... */
100 | addTodo.value = "";
101 |
102 | }
--------------------------------------------------------------------------------