├── .DS_Store ├── src ├── .DS_Store ├── icons │ ├── .DS_Store │ ├── dots.png │ ├── delete.png │ ├── reload.png │ └── return.png ├── index.js ├── update.js ├── index.html ├── style.css └── dinamically.js ├── ssProject.png ├── ssMilestone2.png ├── ssMilestone3.png ├── .gitignore ├── dist ├── 296c49136a80d7923e2e.png ├── bcf920790d95e97938ee.png ├── cbd18fb31b4c999b7aa4.png ├── fdc02c6d9ab8ae3c9db4.png ├── main.js.LICENSE.txt ├── index.html └── main.js ├── .stylelintrc.json ├── .hintrc ├── .eslintrc.json ├── webpack.config.js ├── LICENSE ├── package.json ├── README.md └── .github └── workflows └── linters.yml /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/.DS_Store -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/src/.DS_Store -------------------------------------------------------------------------------- /ssProject.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/ssProject.png -------------------------------------------------------------------------------- /ssMilestone2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/ssMilestone2.png -------------------------------------------------------------------------------- /ssMilestone3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/ssMilestone3.png -------------------------------------------------------------------------------- /src/icons/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/src/icons/.DS_Store -------------------------------------------------------------------------------- /src/icons/dots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/src/icons/dots.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.dmb 2 | *.rsc 3 | *.int 4 | *.lk 5 | *.zip 6 | # .gitignore 7 | node_modules/ 8 | -------------------------------------------------------------------------------- /src/icons/delete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/src/icons/delete.png -------------------------------------------------------------------------------- /src/icons/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/src/icons/reload.png -------------------------------------------------------------------------------- /src/icons/return.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/src/icons/return.png -------------------------------------------------------------------------------- /dist/296c49136a80d7923e2e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/dist/296c49136a80d7923e2e.png -------------------------------------------------------------------------------- /dist/bcf920790d95e97938ee.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/dist/bcf920790d95e97938ee.png -------------------------------------------------------------------------------- /dist/cbd18fb31b4c999b7aa4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/dist/cbd18fb31b4c999b7aa4.png -------------------------------------------------------------------------------- /dist/fdc02c6d9ab8ae3c9db4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AlexRS90/to-do-list/HEAD/dist/fdc02c6d9ab8ae3c9db4.png -------------------------------------------------------------------------------- /dist/main.js.LICENSE.txt: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Lodash 4 | * Copyright OpenJS Foundation and other contributors 5 | * Released under MIT license 6 | * Based on Underscore.js 1.8.3 7 | * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 8 | */ 9 | -------------------------------------------------------------------------------- /.stylelintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["stylelint-config-standard"], 3 | "plugins": ["stylelint-scss", "stylelint-csstree-validator"], 4 | "rules": { 5 | "at-rule-no-unknown": null, 6 | "scss/at-rule-no-unknown": true, 7 | "csstree/validator": true 8 | }, 9 | "ignoreFiles": ["build/**", "dist/**", "**/reset*.css", "**/bootstrap*.css", "**/*.js", "**/*.jsx"] 10 | } 11 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | import './style.css'; 2 | import Load from './icons/reload.png'; 3 | import Back from './icons/return.png'; 4 | import { getTask } from './dinamically.js'; 5 | import addTask from './update.js'; 6 | 7 | document.querySelector('#loadImg').src = Load; 8 | document.querySelector('#returnImg').src = Back; 9 | getTask(); 10 | document.querySelector('#returnImg').addEventListener('click', addTask); -------------------------------------------------------------------------------- /.hintrc: -------------------------------------------------------------------------------- 1 | { 2 | "connector": { 3 | "name": "local", 4 | "options": { 5 | "pattern": ["**", "!.git/**", "!node_modules/**"] 6 | } 7 | }, 8 | "extends": ["development"], 9 | "formatters": ["stylish"], 10 | "hints": [ 11 | "button-type", 12 | "disown-opener", 13 | "html-checker", 14 | "meta-charset-utf-8", 15 | "meta-viewport", 16 | "no-inline-styles:error" 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es6": true, 5 | "jest": true 6 | }, 7 | "parser": "babel-eslint", 8 | "parserOptions": { 9 | "ecmaVersion": 2018, 10 | "sourceType": "module" 11 | }, 12 | "extends": ["airbnb-base"], 13 | "rules": { 14 | "no-shadow": "off", 15 | "no-param-reassign": "off", 16 | "eol-last": "off", 17 | "import/extensions": [ 1, { 18 | "js": "always", "json": "always" 19 | }] 20 | }, 21 | "ignorePatterns": [ 22 | "dist/", 23 | "build/" 24 | ] 25 | } 26 | -------------------------------------------------------------------------------- /src/update.js: -------------------------------------------------------------------------------- 1 | import * as dinamic from './dinamically.js'; 2 | 3 | function addTask() { 4 | const newTask = document.querySelector('.input-text').value; 5 | if (newTask === '') { 6 | document.getElementById('val-entry').classList.add('validationEntry'); 7 | } else { 8 | const obj = { 9 | description: newTask, 10 | completed: false, 11 | index: dinamic.listToDo.length + 1, 12 | }; 13 | dinamic.listToDo.push(obj); 14 | dinamic.loadTask(); 15 | dinamic.getTask(); 16 | document.querySelector('.input-text').value = ''; 17 | } 18 | } 19 | 20 | export default addTask; -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const HtmlWebpackPlugin = require('html-webpack-plugin'); 3 | 4 | module.exports = { 5 | mode: 'development', 6 | entry: './src/index.js', 7 | devServer: { 8 | static: './dist', 9 | }, 10 | plugins: [ 11 | new HtmlWebpackPlugin({ 12 | template: './src/index.html', 13 | }), 14 | ], 15 | output: { 16 | filename: 'main.js', 17 | path: path.resolve(__dirname, 'dist'), 18 | }, 19 | module: { 20 | rules: [ 21 | { 22 | test: /\.css$/i, 23 | use: ['style-loader', 'css-loader'], 24 | }, 25 | { 26 | test: /\.(png|svg|jpg|jpeg|gif)$/i, 27 | type: 'asset/resource', 28 | }, 29 | ], 30 | }, 31 | }; 32 | -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | To-do List 7 | 8 | 9 | 10 |
11 |
12 |
13 |

Today's to do

14 | reload list 15 |
16 |
17 | 18 |

Write a task

19 | return 20 |
21 |
22 |

Clear all completed

23 |
24 |
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | To-do List 7 | 8 | 9 | 10 |
11 |
12 |
13 |

Today's to do

14 | reload list 15 |
16 |
17 | 18 |

Write a task

19 | return 20 |
21 |
22 |

Clear all completed

23 |
24 |
25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Alejandro Ramos 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "to-do-list", 3 | "version": "1.0.0", 4 | "description": "", 5 | "private": true, 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "watch": "webpack --watch", 9 | "start": "webpack serve --open", 10 | "build": "webpack" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/AlexRS90/to-do-list.git" 15 | }, 16 | "keywords": [], 17 | "author": "", 18 | "license": "ISC", 19 | "bugs": { 20 | "url": "https://github.com/AlexRS90/to-do-list/issues" 21 | }, 22 | "homepage": "https://github.com/AlexRS90/to-do-list#readme", 23 | "devDependencies": { 24 | "babel-eslint": "^10.1.0", 25 | "css-loader": "^6.5.0", 26 | "eslint": "^7.32.0", 27 | "eslint-config-airbnb-base": "^14.2.1", 28 | "eslint-plugin-import": "^2.25.2", 29 | "hint": "^6.1.6", 30 | "html-webpack-plugin": "^5.5.0", 31 | "style-loader": "^3.3.1", 32 | "stylelint": "^13.13.1", 33 | "stylelint-config-standard": "^21.0.0", 34 | "stylelint-csstree-validator": "^1.9.0", 35 | "stylelint-scss": "^3.21.0", 36 | "webpack": "^5.60.0", 37 | "webpack-cli": "^4.9.1", 38 | "webpack-dev-server": "^4.3.1" 39 | }, 40 | "dependencies": { 41 | "lodash": "^4.17.21" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: 'Poppins', sans-serif; 3 | font-size: 20px; 4 | } 5 | 6 | .d-flex { 7 | display: flex; 8 | } 9 | 10 | .center { 11 | justify-content: center; 12 | } 13 | 14 | .container { 15 | flex-direction: column; 16 | border: 2px solid #000; 17 | width: 40%; 18 | } 19 | 20 | .container > * { 21 | border-bottom: 1px solid #000; 22 | padding: 10px 20px; 23 | } 24 | 25 | .d-between { 26 | justify-content: space-between; 27 | align-items: center; 28 | } 29 | 30 | .top-color { 31 | background-color: #d3d3d3; 32 | } 33 | 34 | .new-task { 35 | width: 100%; 36 | border-bottom: 1px solid #000; 37 | } 38 | 39 | .bg-color { 40 | flex-direction: column; 41 | padding: 0; 42 | } 43 | 44 | .new-task:nth-child(odd) { 45 | background-color: #e8d8c8; 46 | } 47 | 48 | .new-task:nth-child(even) { 49 | background-color: #e1d4bc; 50 | } 51 | 52 | .input-text { 53 | border: none; 54 | font-style: italic; 55 | padding: 10px; 56 | font-size: 20px; 57 | } 58 | 59 | .white-color { 60 | color: #fff; 61 | } 62 | 63 | .validationEntry { 64 | color: red; 65 | font-style: italic; 66 | visibility: visible; 67 | } 68 | 69 | .check-task { 70 | align-items: center; 71 | gap: 10px; 72 | } 73 | 74 | .clear { 75 | text-decoration: none; 76 | color: #000; 77 | background-color: #d3d3d3; 78 | } 79 | 80 | .clear p { 81 | text-align: center; 82 | } 83 | 84 | .overText { 85 | text-decoration: line-through; 86 | color: gray; 87 | } 88 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](https://img.shields.io/badge/Microverse-blueviolet) 2 | 3 | ## To do list 4 | 5 | > Webpack Implementation. 6 | 7 | ![screenshot](ssMilestone3.png) 8 | 9 | - Milestone 1: 10 | - Setup webpack 11 | - Created a to do list skeleton 12 | - Display dinamically 3 task from an static array of objects 13 | - Milestone 2: Interactive list: 14 | - Created diferents modules to import and export functions 15 | - Made checkboxes interactive 16 | - Saved all task completed or not at local storage 17 | - Added styles when a task is completed 18 | - Milestone 3: add and remove 19 | - Now the list is 100% interactive, you can: 20 | - Write a new task. 21 | - Edit any uncompleted task. 22 | - Delete a single task. 23 | - Delete all completed tasks. 24 | 25 | ## Built With 26 | 27 | - HTML, CSS & JS 28 | - Visual Studio Code 29 | - Webpack 30 | - Linters 31 | 32 | ## Live Demo :computer: 33 | 34 | https://alexrs90.github.io/to-do-list/dist/ 35 | 36 | ## Set up locally 37 | 38 | - Open your terminal and run the following command: git clone https://github.com/AlexRS90/to-do-list.git 39 | - Run the command "npm install" 40 | - Run the command "npm run build" 41 | - Run the command "npm run start" 42 | 43 | Once you completed this steps you should see the app running at: http://localhost:8080/ in your browser. 44 | 45 | ## Author 👤 46 | 47 | 👤 **Alejandro Ramos** 48 | 49 | - GitHub: [@githubhandle](https://github.com/AlexRS90) 50 | - Twitter: [@twitterhandle](https://twitter.com/AlejandroRBenji) 51 | - LinkedIn: [LinkedIn](https://www.linkedin.com/in/alejandro-ramos-santos-9b0b52135/) 52 | 53 | ## 🤝 Contributing 54 | 55 | Contributions, issues, and feature requests are welcome! 56 | 57 | Feel free to check the [issues page](https://github.com/AlexRS90/to-do-list/issues) 58 | 59 | ## Show your support 60 | 61 | Give a ⭐️ if you like this project! 62 | 63 | ## Acknowledgments 64 | 65 | - Hat tip to anyone whose code was used 66 | - Inspiration 67 | - etc 68 | 69 | ## 📝 License 70 | 71 | This project is [MIT](./MIT.md) licensed. -------------------------------------------------------------------------------- /.github/workflows/linters.yml: -------------------------------------------------------------------------------- 1 | name: Linters 2 | 3 | on: pull_request 4 | 5 | env: 6 | FORCE_COLOR: 1 7 | 8 | jobs: 9 | lighthouse: 10 | name: Lighthouse 11 | runs-on: ubuntu-18.04 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: actions/setup-node@v1 15 | with: 16 | node-version: "12.x" 17 | - name: Setup Lighthouse 18 | run: npm install -g @lhci/cli@0.7.x 19 | - name: Lighthouse Report 20 | run: lhci autorun --upload.target=temporary-public-storage --collect.staticDistDir=. 21 | webhint: 22 | name: Webhint 23 | runs-on: ubuntu-18.04 24 | steps: 25 | - uses: actions/checkout@v2 26 | - uses: actions/setup-node@v1 27 | with: 28 | node-version: "12.x" 29 | - name: Setup Webhint 30 | run: | 31 | npm install --save-dev hint@6.x 32 | [ -f .hintrc ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css-js/.hintrc 33 | - name: Webhint Report 34 | run: npx hint 35 | stylelint: 36 | name: Stylelint 37 | runs-on: ubuntu-18.04 38 | steps: 39 | - uses: actions/checkout@v2 40 | - uses: actions/setup-node@v1 41 | with: 42 | node-version: "12.x" 43 | - name: Setup Stylelint 44 | run: | 45 | npm install --save-dev stylelint@13.x stylelint-scss@3.x stylelint-config-standard@21.x stylelint-csstree-validator@1.x 46 | [ -f .stylelintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css-js/.stylelintrc.json 47 | - name: Stylelint Report 48 | run: npx stylelint "**/*.{css,scss}" 49 | eslint: 50 | name: ESLint 51 | runs-on: ubuntu-18.04 52 | steps: 53 | - uses: actions/checkout@v2 54 | - uses: actions/setup-node@v1 55 | with: 56 | node-version: "12.x" 57 | - name: Setup ESLint 58 | run: | 59 | npm install --save-dev eslint@7.x eslint-config-airbnb-base@14.x eslint-plugin-import@2.x babel-eslint@10.x 60 | [ -f .eslintrc.json ] || wget https://raw.githubusercontent.com/microverseinc/linters-config/master/html-css-js/.eslintrc.json 61 | - name: ESLint Report 62 | run: npx eslint . 63 | -------------------------------------------------------------------------------- /src/dinamically.js: -------------------------------------------------------------------------------- 1 | import Dots from './icons/dots.png'; 2 | import Trash from './icons/delete.png'; 3 | 4 | let listToDo = [];//eslint-disable-line 5 | 6 | function loadTask() { 7 | localStorage.setItem('lista', JSON.stringify(listToDo)); 8 | } 9 | 10 | function getTask() { 11 | if (localStorage.getItem('lista')) { 12 | const hola = JSON.parse(localStorage.getItem('lista')); 13 | listToDo = hola; 14 | } 15 | 16 | let newTask = ''; 17 | listToDo.forEach((task) => { 18 | newTask += `
19 |
20 | 21 |

${task.description}

22 |
23 | move order 24 |
`; 25 | }); 26 | 27 | document.querySelector('.bg-color').innerHTML = newTask; 28 | const arr = document.querySelectorAll('.check'); 29 | const arrDelete = document.querySelectorAll('.c-img'); 30 | const arrMTask = document.querySelectorAll('.m-task'); 31 | listToDo.forEach((item, index) => { 32 | arr[index].checked = item.completed; 33 | if (item.completed) { 34 | arr[index].parentElement.classList.add('overText'); 35 | arrDelete[index].src = Trash; 36 | arrMTask[index].setAttribute('contenteditable', 'false'); 37 | arrDelete[index].addEventListener('click', () => { 38 | listToDo.splice(index, 1); 39 | listToDo.forEach((newIndex, i) => { 40 | newIndex.index = i + 1; 41 | }); 42 | loadTask(); 43 | getTask(); 44 | }); 45 | } else { 46 | arr[index].parentElement.classList.remove('overText'); 47 | arrMTask[index].contenteditable = 'true'; 48 | } 49 | }); 50 | 51 | function checkStatus(box) { 52 | listToDo.forEach((el) => { 53 | if (box.innerText === el.description) { 54 | el.completed = !el.completed; 55 | } 56 | }); 57 | loadTask(); 58 | getTask(); 59 | } 60 | 61 | function loadThings() { 62 | document.querySelectorAll('.check').forEach((item) => { 63 | item.addEventListener('click', () => { 64 | checkStatus(item.parentElement); 65 | }); 66 | }); 67 | } 68 | 69 | loadThings(); 70 | 71 | function updateTask(i) { 72 | document.querySelectorAll('.m-task')[i - 1].addEventListener('focusout', () => { 73 | listToDo[i - 1].description = document.querySelectorAll('.m-task')[i - 1].innerText; 74 | loadTask(); 75 | }); 76 | document.querySelectorAll('.m-task')[i - 1].removeEventListener('focusout', () => {}); 77 | } 78 | 79 | function getPosition(index) { 80 | listToDo.forEach((currPos) => { 81 | if (currPos.description === index.innerText) { 82 | updateTask(currPos.index); 83 | } 84 | }); 85 | } 86 | 87 | function editTask() { 88 | document.querySelectorAll('.m-task').forEach((item) => { 89 | item.addEventListener('focus', () => { 90 | getPosition(item); 91 | }); 92 | }); 93 | } 94 | editTask(); 95 | } 96 | 97 | document.querySelector('.input-text').addEventListener('focus', () => { 98 | document.getElementById('val-entry').classList.remove('validationEntry'); 99 | }); 100 | 101 | document.querySelector('#delete-all').addEventListener('click', () => { 102 | listToDo = listToDo.filter((listToDo) => listToDo.completed === false); 103 | listToDo.forEach((newIndex, i) => { 104 | newIndex.index = i + 1; 105 | }); 106 | loadTask(); 107 | getTask(); 108 | }); 109 | 110 | export { getTask, loadTask, listToDo }; -------------------------------------------------------------------------------- /dist/main.js: -------------------------------------------------------------------------------- 1 | /* 2 | * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development"). 3 | * This devtool is neither made for production nor for readable output files. 4 | * It uses "eval()" calls to create a separate source file in the browser devtools. 5 | * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/) 6 | * or disable the default devtool with "devtool: false". 7 | * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/). 8 | */ 9 | /******/ (() => { // webpackBootstrap 10 | /******/ "use strict"; 11 | /******/ var __webpack_modules__ = ({ 12 | 13 | /***/ "./node_modules/css-loader/dist/cjs.js!./src/style.css": 14 | /*!*************************************************************!*\ 15 | !*** ./node_modules/css-loader/dist/cjs.js!./src/style.css ***! 16 | \*************************************************************/ 17 | /***/ ((module, __webpack_exports__, __webpack_require__) => { 18 | 19 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"body {\\n font-family: 'Poppins', sans-serif;\\n font-size: 20px;\\n}\\n\\n.d-flex {\\n display: flex;\\n}\\n\\n.center {\\n justify-content: center;\\n}\\n\\n.container {\\n flex-direction: column;\\n border: 2px solid #000;\\n width: 40%;\\n}\\n\\n.container > * {\\n border-bottom: 1px solid #000;\\n padding: 10px 20px;\\n}\\n\\n.d-between {\\n justify-content: space-between;\\n align-items: center;\\n}\\n\\n.top-color {\\n background-color: #d3d3d3;\\n}\\n\\n.new-task {\\n width: 100%;\\n border-bottom: 1px solid #000;\\n}\\n\\n.bg-color {\\n flex-direction: column;\\n padding: 0;\\n}\\n\\n.new-task:nth-child(odd) {\\n background-color: #e8d8c8;\\n}\\n\\n.new-task:nth-child(even) {\\n background-color: #e1d4bc;\\n}\\n\\n.input-text {\\n border: none;\\n font-style: italic;\\n padding: 10px;\\n font-size: 20px;\\n}\\n\\n.white-color {\\n color: #fff;\\n}\\n\\n.validationEntry {\\n color: red;\\n font-style: italic;\\n visibility: visible;\\n}\\n\\n.check-task {\\n align-items: center;\\n gap: 10px;\\n}\\n\\n.clear {\\n text-decoration: none;\\n color: #000;\\n background-color: #d3d3d3;\\n}\\n\\n.clear p {\\n text-align: center;\\n}\\n\\n.overText {\\n text-decoration: line-through;\\n color: gray;\\n}\\n\", \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://to-do-list/./src/style.css?./node_modules/css-loader/dist/cjs.js"); 20 | 21 | /***/ }), 22 | 23 | /***/ "./node_modules/css-loader/dist/runtime/api.js": 24 | /*!*****************************************************!*\ 25 | !*** ./node_modules/css-loader/dist/runtime/api.js ***! 26 | \*****************************************************/ 27 | /***/ ((module) => { 28 | 29 | eval("\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n\n content += cssWithMappingToString(item);\n\n if (needLayer) {\n content += \"}\";\n }\n\n if (item[2]) {\n content += \"}\";\n }\n\n if (item[4]) {\n content += \"}\";\n }\n\n return content;\n }).join(\"\");\n }; // import a list of modules into the list\n\n\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n\n var alreadyImportedModules = {};\n\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n\n list.push(item);\n }\n };\n\n return list;\n};\n\n//# sourceURL=webpack://to-do-list/./node_modules/css-loader/dist/runtime/api.js?"); 30 | 31 | /***/ }), 32 | 33 | /***/ "./node_modules/css-loader/dist/runtime/noSourceMaps.js": 34 | /*!**************************************************************!*\ 35 | !*** ./node_modules/css-loader/dist/runtime/noSourceMaps.js ***! 36 | \**************************************************************/ 37 | /***/ ((module) => { 38 | 39 | eval("\n\nmodule.exports = function (i) {\n return i[1];\n};\n\n//# sourceURL=webpack://to-do-list/./node_modules/css-loader/dist/runtime/noSourceMaps.js?"); 40 | 41 | /***/ }), 42 | 43 | /***/ "./src/style.css": 44 | /*!***********************!*\ 45 | !*** ./src/style.css ***! 46 | \***********************/ 47 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 48 | 49 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js */ \"./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleDomAPI.js */ \"./node_modules/style-loader/dist/runtime/styleDomAPI.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertBySelector.js */ \"./node_modules/style-loader/dist/runtime/insertBySelector.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js */ \"./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/insertStyleElement.js */ \"./node_modules/style-loader/dist/runtime/insertStyleElement.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! !../node_modules/style-loader/dist/runtime/styleTagTransform.js */ \"./node_modules/style-loader/dist/runtime/styleTagTransform.js\");\n/* harmony import */ var _node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _node_modules_css_loader_dist_cjs_js_style_css__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! !!../node_modules/css-loader/dist/cjs.js!./style.css */ \"./node_modules/css-loader/dist/cjs.js!./src/style.css\");\n\n \n \n \n \n \n \n \n \n \n\nvar options = {};\n\noptions.styleTagTransform = (_node_modules_style_loader_dist_runtime_styleTagTransform_js__WEBPACK_IMPORTED_MODULE_5___default());\noptions.setAttributes = (_node_modules_style_loader_dist_runtime_setAttributesWithoutAttributes_js__WEBPACK_IMPORTED_MODULE_3___default());\n\n options.insert = _node_modules_style_loader_dist_runtime_insertBySelector_js__WEBPACK_IMPORTED_MODULE_2___default().bind(null, \"head\");\n \noptions.domAPI = (_node_modules_style_loader_dist_runtime_styleDomAPI_js__WEBPACK_IMPORTED_MODULE_1___default());\noptions.insertStyleElement = (_node_modules_style_loader_dist_runtime_insertStyleElement_js__WEBPACK_IMPORTED_MODULE_4___default());\n\nvar update = _node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_css_loader_dist_cjs_js_style_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"], options);\n\n\n\n\n /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_modules_css_loader_dist_cjs_js_style_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"] && _node_modules_css_loader_dist_cjs_js_style_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals ? _node_modules_css_loader_dist_cjs_js_style_css__WEBPACK_IMPORTED_MODULE_6__[\"default\"].locals : undefined);\n\n\n//# sourceURL=webpack://to-do-list/./src/style.css?"); 50 | 51 | /***/ }), 52 | 53 | /***/ "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js": 54 | /*!****************************************************************************!*\ 55 | !*** ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js ***! 56 | \****************************************************************************/ 57 | /***/ ((module) => { 58 | 59 | eval("\n\nvar stylesInDOM = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDOM.length; i++) {\n if (stylesInDOM[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var indexByIdentifier = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3],\n supports: item[4],\n layer: item[5]\n };\n\n if (indexByIdentifier !== -1) {\n stylesInDOM[indexByIdentifier].references++;\n stylesInDOM[indexByIdentifier].updater(obj);\n } else {\n var updater = addElementStyle(obj, options);\n options.byIndex = i;\n stylesInDOM.splice(i, 0, {\n identifier: identifier,\n updater: updater,\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction addElementStyle(obj, options) {\n var api = options.domAPI(options);\n api.update(obj);\n\n var updater = function updater(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap && newObj.supports === obj.supports && newObj.layer === obj.layer) {\n return;\n }\n\n api.update(obj = newObj);\n } else {\n api.remove();\n }\n };\n\n return updater;\n}\n\nmodule.exports = function (list, options) {\n options = options || {};\n list = list || [];\n var lastIdentifiers = modulesToDom(list, options);\n return function update(newList) {\n newList = newList || [];\n\n for (var i = 0; i < lastIdentifiers.length; i++) {\n var identifier = lastIdentifiers[i];\n var index = getIndexByIdentifier(identifier);\n stylesInDOM[index].references--;\n }\n\n var newLastIdentifiers = modulesToDom(newList, options);\n\n for (var _i = 0; _i < lastIdentifiers.length; _i++) {\n var _identifier = lastIdentifiers[_i];\n\n var _index = getIndexByIdentifier(_identifier);\n\n if (stylesInDOM[_index].references === 0) {\n stylesInDOM[_index].updater();\n\n stylesInDOM.splice(_index, 1);\n }\n }\n\n lastIdentifiers = newLastIdentifiers;\n };\n};\n\n//# sourceURL=webpack://to-do-list/./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js?"); 60 | 61 | /***/ }), 62 | 63 | /***/ "./node_modules/style-loader/dist/runtime/insertBySelector.js": 64 | /*!********************************************************************!*\ 65 | !*** ./node_modules/style-loader/dist/runtime/insertBySelector.js ***! 66 | \********************************************************************/ 67 | /***/ ((module) => { 68 | 69 | eval("\n\nvar memo = {};\n/* istanbul ignore next */\n\nfunction getTarget(target) {\n if (typeof memo[target] === \"undefined\") {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n}\n/* istanbul ignore next */\n\n\nfunction insertBySelector(insert, style) {\n var target = getTarget(insert);\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n}\n\nmodule.exports = insertBySelector;\n\n//# sourceURL=webpack://to-do-list/./node_modules/style-loader/dist/runtime/insertBySelector.js?"); 70 | 71 | /***/ }), 72 | 73 | /***/ "./node_modules/style-loader/dist/runtime/insertStyleElement.js": 74 | /*!**********************************************************************!*\ 75 | !*** ./node_modules/style-loader/dist/runtime/insertStyleElement.js ***! 76 | \**********************************************************************/ 77 | /***/ ((module) => { 78 | 79 | eval("\n\n/* istanbul ignore next */\nfunction insertStyleElement(options) {\n var element = document.createElement(\"style\");\n options.setAttributes(element, options.attributes);\n options.insert(element, options.options);\n return element;\n}\n\nmodule.exports = insertStyleElement;\n\n//# sourceURL=webpack://to-do-list/./node_modules/style-loader/dist/runtime/insertStyleElement.js?"); 80 | 81 | /***/ }), 82 | 83 | /***/ "./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js": 84 | /*!**********************************************************************************!*\ 85 | !*** ./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js ***! 86 | \**********************************************************************************/ 87 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 88 | 89 | eval("\n\n/* istanbul ignore next */\nfunction setAttributesWithoutAttributes(styleElement) {\n var nonce = true ? __webpack_require__.nc : 0;\n\n if (nonce) {\n styleElement.setAttribute(\"nonce\", nonce);\n }\n}\n\nmodule.exports = setAttributesWithoutAttributes;\n\n//# sourceURL=webpack://to-do-list/./node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js?"); 90 | 91 | /***/ }), 92 | 93 | /***/ "./node_modules/style-loader/dist/runtime/styleDomAPI.js": 94 | /*!***************************************************************!*\ 95 | !*** ./node_modules/style-loader/dist/runtime/styleDomAPI.js ***! 96 | \***************************************************************/ 97 | /***/ ((module) => { 98 | 99 | eval("\n\n/* istanbul ignore next */\nfunction apply(styleElement, options, obj) {\n var css = \"\";\n\n if (obj.supports) {\n css += \"@supports (\".concat(obj.supports, \") {\");\n }\n\n if (obj.media) {\n css += \"@media \".concat(obj.media, \" {\");\n }\n\n var needLayer = typeof obj.layer !== \"undefined\";\n\n if (needLayer) {\n css += \"@layer\".concat(obj.layer.length > 0 ? \" \".concat(obj.layer) : \"\", \" {\");\n }\n\n css += obj.css;\n\n if (needLayer) {\n css += \"}\";\n }\n\n if (obj.media) {\n css += \"}\";\n }\n\n if (obj.supports) {\n css += \"}\";\n }\n\n var sourceMap = obj.sourceMap;\n\n if (sourceMap && typeof btoa !== \"undefined\") {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n options.styleTagTransform(css, styleElement, options.options);\n}\n\nfunction removeStyleElement(styleElement) {\n // istanbul ignore if\n if (styleElement.parentNode === null) {\n return false;\n }\n\n styleElement.parentNode.removeChild(styleElement);\n}\n/* istanbul ignore next */\n\n\nfunction domAPI(options) {\n var styleElement = options.insertStyleElement(options);\n return {\n update: function update(obj) {\n apply(styleElement, options, obj);\n },\n remove: function remove() {\n removeStyleElement(styleElement);\n }\n };\n}\n\nmodule.exports = domAPI;\n\n//# sourceURL=webpack://to-do-list/./node_modules/style-loader/dist/runtime/styleDomAPI.js?"); 100 | 101 | /***/ }), 102 | 103 | /***/ "./node_modules/style-loader/dist/runtime/styleTagTransform.js": 104 | /*!*********************************************************************!*\ 105 | !*** ./node_modules/style-loader/dist/runtime/styleTagTransform.js ***! 106 | \*********************************************************************/ 107 | /***/ ((module) => { 108 | 109 | eval("\n\n/* istanbul ignore next */\nfunction styleTagTransform(css, styleElement) {\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText = css;\n } else {\n while (styleElement.firstChild) {\n styleElement.removeChild(styleElement.firstChild);\n }\n\n styleElement.appendChild(document.createTextNode(css));\n }\n}\n\nmodule.exports = styleTagTransform;\n\n//# sourceURL=webpack://to-do-list/./node_modules/style-loader/dist/runtime/styleTagTransform.js?"); 110 | 111 | /***/ }), 112 | 113 | /***/ "./src/dinamically.js": 114 | /*!****************************!*\ 115 | !*** ./src/dinamically.js ***! 116 | \****************************/ 117 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 118 | 119 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"getTask\": () => (/* binding */ getTask),\n/* harmony export */ \"loadTask\": () => (/* binding */ loadTask),\n/* harmony export */ \"listToDo\": () => (/* binding */ listToDo)\n/* harmony export */ });\n/* harmony import */ var _icons_dots_png__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./icons/dots.png */ \"./src/icons/dots.png\");\n/* harmony import */ var _icons_delete_png__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./icons/delete.png */ \"./src/icons/delete.png\");\n\n\n\nlet listToDo = [];//eslint-disable-line\n\nfunction loadTask() {\n localStorage.setItem('lista', JSON.stringify(listToDo));\n}\n\nfunction getTask() {\n if (localStorage.getItem('lista')) {\n const hola = JSON.parse(localStorage.getItem('lista'));\n listToDo = hola;\n }\n\n let newTask = '';\n listToDo.forEach((task) => {\n newTask += `
\n
\n \n

${task.description}

\n
\n \"move\n
`;\n });\n\n document.querySelector('.bg-color').innerHTML = newTask;\n const arr = document.querySelectorAll('.check');\n const arrDelete = document.querySelectorAll('.c-img');\n const arrMTask = document.querySelectorAll('.m-task');\n listToDo.forEach((item, index) => {\n arr[index].checked = item.completed;\n if (item.completed) {\n arr[index].parentElement.classList.add('overText');\n arrDelete[index].src = _icons_delete_png__WEBPACK_IMPORTED_MODULE_1__;\n arrMTask[index].setAttribute('contenteditable', 'false');\n arrDelete[index].addEventListener('click', () => {\n listToDo.splice(index, 1);\n listToDo.forEach((newIndex, i) => {\n newIndex.index = i + 1;\n });\n loadTask();\n getTask();\n });\n } else {\n arr[index].parentElement.classList.remove('overText');\n arrMTask[index].contenteditable = 'true';\n }\n });\n\n function checkStatus(box) {\n listToDo.forEach((el) => {\n if (box.innerText === el.description) {\n el.completed = !el.completed;\n }\n });\n loadTask();\n getTask();\n }\n\n function loadThings() {\n document.querySelectorAll('.check').forEach((item) => {\n item.addEventListener('click', () => {\n checkStatus(item.parentElement);\n });\n });\n }\n\n loadThings();\n\n function updateTask(i) {\n document.querySelectorAll('.m-task')[i - 1].addEventListener('focusout', () => {\n listToDo[i - 1].description = document.querySelectorAll('.m-task')[i - 1].innerText;\n loadTask();\n });\n document.querySelectorAll('.m-task')[i - 1].removeEventListener('focusout', () => {});\n }\n\n function getPosition(index) {\n listToDo.forEach((currPos) => {\n if (currPos.description === index.innerText) {\n updateTask(currPos.index);\n }\n });\n }\n\n function editTask() {\n document.querySelectorAll('.m-task').forEach((item) => {\n item.addEventListener('focus', () => {\n getPosition(item);\n });\n });\n }\n editTask();\n}\n\ndocument.querySelector('.input-text').addEventListener('focus', () => {\n document.getElementById('val-entry').classList.remove('validationEntry');\n});\n\ndocument.querySelector('#delete-all').addEventListener('click', () => {\n listToDo = listToDo.filter((listToDo) => listToDo.completed === false);\n listToDo.forEach((newIndex, i) => {\n newIndex.index = i + 1;\n });\n loadTask();\n getTask();\n});\n\n\n\n//# sourceURL=webpack://to-do-list/./src/dinamically.js?"); 120 | 121 | /***/ }), 122 | 123 | /***/ "./src/index.js": 124 | /*!**********************!*\ 125 | !*** ./src/index.js ***! 126 | \**********************/ 127 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 128 | 129 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _style_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./style.css */ \"./src/style.css\");\n/* harmony import */ var _icons_reload_png__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./icons/reload.png */ \"./src/icons/reload.png\");\n/* harmony import */ var _icons_return_png__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./icons/return.png */ \"./src/icons/return.png\");\n/* harmony import */ var _dinamically_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dinamically.js */ \"./src/dinamically.js\");\n/* harmony import */ var _update_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./update.js */ \"./src/update.js\");\n\n\n\n\n\n\ndocument.querySelector('#loadImg').src = _icons_reload_png__WEBPACK_IMPORTED_MODULE_1__;\ndocument.querySelector('#returnImg').src = _icons_return_png__WEBPACK_IMPORTED_MODULE_2__;\n(0,_dinamically_js__WEBPACK_IMPORTED_MODULE_3__.getTask)();\ndocument.querySelector('#returnImg').addEventListener('click', _update_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n\n//# sourceURL=webpack://to-do-list/./src/index.js?"); 130 | 131 | /***/ }), 132 | 133 | /***/ "./src/update.js": 134 | /*!***********************!*\ 135 | !*** ./src/update.js ***! 136 | \***********************/ 137 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { 138 | 139 | eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _dinamically_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dinamically.js */ \"./src/dinamically.js\");\n\n\nfunction addTask() {\n const newTask = document.querySelector('.input-text').value;\n if (newTask === '') {\n document.getElementById('val-entry').classList.add('validationEntry');\n } else {\n const obj = {\n description: newTask,\n completed: false,\n index: _dinamically_js__WEBPACK_IMPORTED_MODULE_0__.listToDo.length + 1,\n };\n _dinamically_js__WEBPACK_IMPORTED_MODULE_0__.listToDo.push(obj);\n _dinamically_js__WEBPACK_IMPORTED_MODULE_0__.loadTask();\n _dinamically_js__WEBPACK_IMPORTED_MODULE_0__.getTask();\n document.querySelector('.input-text').value = '';\n }\n}\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (addTask);\n\n//# sourceURL=webpack://to-do-list/./src/update.js?"); 140 | 141 | /***/ }), 142 | 143 | /***/ "./src/icons/delete.png": 144 | /*!******************************!*\ 145 | !*** ./src/icons/delete.png ***! 146 | \******************************/ 147 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 148 | 149 | eval("module.exports = __webpack_require__.p + \"296c49136a80d7923e2e.png\";\n\n//# sourceURL=webpack://to-do-list/./src/icons/delete.png?"); 150 | 151 | /***/ }), 152 | 153 | /***/ "./src/icons/dots.png": 154 | /*!****************************!*\ 155 | !*** ./src/icons/dots.png ***! 156 | \****************************/ 157 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 158 | 159 | eval("module.exports = __webpack_require__.p + \"cbd18fb31b4c999b7aa4.png\";\n\n//# sourceURL=webpack://to-do-list/./src/icons/dots.png?"); 160 | 161 | /***/ }), 162 | 163 | /***/ "./src/icons/reload.png": 164 | /*!******************************!*\ 165 | !*** ./src/icons/reload.png ***! 166 | \******************************/ 167 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 168 | 169 | eval("module.exports = __webpack_require__.p + \"fdc02c6d9ab8ae3c9db4.png\";\n\n//# sourceURL=webpack://to-do-list/./src/icons/reload.png?"); 170 | 171 | /***/ }), 172 | 173 | /***/ "./src/icons/return.png": 174 | /*!******************************!*\ 175 | !*** ./src/icons/return.png ***! 176 | \******************************/ 177 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { 178 | 179 | eval("module.exports = __webpack_require__.p + \"bcf920790d95e97938ee.png\";\n\n//# sourceURL=webpack://to-do-list/./src/icons/return.png?"); 180 | 181 | /***/ }) 182 | 183 | /******/ }); 184 | /************************************************************************/ 185 | /******/ // The module cache 186 | /******/ var __webpack_module_cache__ = {}; 187 | /******/ 188 | /******/ // The require function 189 | /******/ function __webpack_require__(moduleId) { 190 | /******/ // Check if module is in cache 191 | /******/ var cachedModule = __webpack_module_cache__[moduleId]; 192 | /******/ if (cachedModule !== undefined) { 193 | /******/ return cachedModule.exports; 194 | /******/ } 195 | /******/ // Create a new module (and put it into the cache) 196 | /******/ var module = __webpack_module_cache__[moduleId] = { 197 | /******/ id: moduleId, 198 | /******/ // no module.loaded needed 199 | /******/ exports: {} 200 | /******/ }; 201 | /******/ 202 | /******/ // Execute the module function 203 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 204 | /******/ 205 | /******/ // Return the exports of the module 206 | /******/ return module.exports; 207 | /******/ } 208 | /******/ 209 | /************************************************************************/ 210 | /******/ /* webpack/runtime/compat get default export */ 211 | /******/ (() => { 212 | /******/ // getDefaultExport function for compatibility with non-harmony modules 213 | /******/ __webpack_require__.n = (module) => { 214 | /******/ var getter = module && module.__esModule ? 215 | /******/ () => (module['default']) : 216 | /******/ () => (module); 217 | /******/ __webpack_require__.d(getter, { a: getter }); 218 | /******/ return getter; 219 | /******/ }; 220 | /******/ })(); 221 | /******/ 222 | /******/ /* webpack/runtime/define property getters */ 223 | /******/ (() => { 224 | /******/ // define getter functions for harmony exports 225 | /******/ __webpack_require__.d = (exports, definition) => { 226 | /******/ for(var key in definition) { 227 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 228 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 229 | /******/ } 230 | /******/ } 231 | /******/ }; 232 | /******/ })(); 233 | /******/ 234 | /******/ /* webpack/runtime/global */ 235 | /******/ (() => { 236 | /******/ __webpack_require__.g = (function() { 237 | /******/ if (typeof globalThis === 'object') return globalThis; 238 | /******/ try { 239 | /******/ return this || new Function('return this')(); 240 | /******/ } catch (e) { 241 | /******/ if (typeof window === 'object') return window; 242 | /******/ } 243 | /******/ })(); 244 | /******/ })(); 245 | /******/ 246 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ 247 | /******/ (() => { 248 | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 249 | /******/ })(); 250 | /******/ 251 | /******/ /* webpack/runtime/make namespace object */ 252 | /******/ (() => { 253 | /******/ // define __esModule on exports 254 | /******/ __webpack_require__.r = (exports) => { 255 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 256 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 257 | /******/ } 258 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); 259 | /******/ }; 260 | /******/ })(); 261 | /******/ 262 | /******/ /* webpack/runtime/publicPath */ 263 | /******/ (() => { 264 | /******/ var scriptUrl; 265 | /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; 266 | /******/ var document = __webpack_require__.g.document; 267 | /******/ if (!scriptUrl && document) { 268 | /******/ if (document.currentScript) 269 | /******/ scriptUrl = document.currentScript.src 270 | /******/ if (!scriptUrl) { 271 | /******/ var scripts = document.getElementsByTagName("script"); 272 | /******/ if(scripts.length) scriptUrl = scripts[scripts.length - 1].src 273 | /******/ } 274 | /******/ } 275 | /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration 276 | /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic. 277 | /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); 278 | /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); 279 | /******/ __webpack_require__.p = scriptUrl; 280 | /******/ })(); 281 | /******/ 282 | /************************************************************************/ 283 | /******/ 284 | /******/ // startup 285 | /******/ // Load entry module and return exports 286 | /******/ // This entry module can't be inlined because the eval devtool is used. 287 | /******/ var __webpack_exports__ = __webpack_require__("./src/index.js"); 288 | /******/ 289 | /******/ })() 290 | ; --------------------------------------------------------------------------------