-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
1 lines (1 loc) · 3.71 KB
/
main.js
1
const _0x2385f0=_0xce8d;function _0x37c5(){const _0xef329c=['value','parse','add','3406FhzJra','append','input','stringify','7vWbGSn','818576RQkiYc','.main\x20>\x20button','classList','25thQPWG','getItem','30tJakqU','onclick','658980SRoQTa','16BzuWHd','querySelector','filter','div','.main','error\x20please\x20try\x20again','setAttribute','setItem','length','querySelectorAll','111FWHwXv','createElement','768303VxEhZH','88rBOODZ','31302lshdae','Delete','tasks','localStorage','1565600dAJcAd','forEach','getAttribute','button'];_0x37c5=function(){return _0xef329c;};return _0x37c5();}(function(_0x1566dd,_0x40ad97){const _0x2c0b5f=_0xce8d,_0x216f8c=_0x1566dd();while(!![]){try{const _0x1b52dc=parseInt(_0x2c0b5f(0x129))/0x1*(parseInt(_0x2c0b5f(0x142))/0x2)+-parseInt(_0x2c0b5f(0x133))/0x3*(-parseInt(_0x2c0b5f(0x136))/0x4)+-parseInt(_0x2c0b5f(0x14a))/0x5*(-parseInt(_0x2c0b5f(0x137))/0x6)+-parseInt(_0x2c0b5f(0x146))/0x7*(parseInt(_0x2c0b5f(0x13b))/0x8)+parseInt(_0x2c0b5f(0x135))/0x9*(parseInt(_0x2c0b5f(0x14c))/0xa)+parseInt(_0x2c0b5f(0x147))/0xb+-parseInt(_0x2c0b5f(0x14e))/0xc;if(_0x1b52dc===_0x40ad97)break;else _0x216f8c['push'](_0x216f8c['shift']());}catch(_0xa6062f){_0x216f8c['push'](_0x216f8c['shift']());}}}(_0x37c5,0x20ba1),window[_0x2385f0(0x13a)][_0x2385f0(0x130)](_0x2385f0(0x139),window[_0x2385f0(0x13a)][_0x2385f0(0x14b)]('tasks')||JSON['stringify']([])));const input=document['querySelector'](_0x2385f0(0x144)),AddTaskBtn=document[_0x2385f0(0x12a)](_0x2385f0(0x148)),mainDiv=document[_0x2385f0(0x12a)](_0x2385f0(0x12d));let id=0x0;function _0xce8d(_0x3bfe15,_0x2d470e){const _0x37c567=_0x37c5();return _0xce8d=function(_0xce8d30,_0x2b7db1){_0xce8d30=_0xce8d30-0x129;let _0x451008=_0x37c567[_0xce8d30];return _0x451008;},_0xce8d(_0x3bfe15,_0x2d470e);}placeData(),AddTaskBtn['onclick']=()=>{const _0x4397a4=_0x2385f0;if(!input[_0x4397a4(0x13f)]){alert(_0x4397a4(0x12e));return;}const _0x1f468b=document[_0x4397a4(0x134)]('div');_0x1f468b[_0x4397a4(0x143)](input['value']),_0x1f468b['classList'][_0x4397a4(0x141)]('task'),_0x1f468b[_0x4397a4(0x12f)]('id',id),id++,window[_0x4397a4(0x13a)][_0x4397a4(0x130)](_0x4397a4(0x139),JSON['stringify']([...JSON[_0x4397a4(0x140)](window[_0x4397a4(0x13a)][_0x4397a4(0x14b)](_0x4397a4(0x139))),input[_0x4397a4(0x13f)]]));const _0x54dd37=document[_0x4397a4(0x134)](_0x4397a4(0x13e));_0x54dd37[_0x4397a4(0x143)](_0x4397a4(0x138)),_0x54dd37[_0x4397a4(0x14d)]=()=>{const _0x7fd327=_0x4397a4;localStorage[_0x7fd327(0x130)]('tasks',JSON[_0x7fd327(0x145)](JSON['parse'](window[_0x7fd327(0x13a)][_0x7fd327(0x14b)]('tasks'))[_0x7fd327(0x12b)]((_0x577087,_0x5ec301)=>_0x5ec301!==Number(_0x1f468b[_0x7fd327(0x13d)]('id'))))),id=0x0,placeData();},_0x1f468b['append'](_0x54dd37),mainDiv[_0x4397a4(0x143)](_0x1f468b),input[_0x4397a4(0x13f)]='';};function placeData(){const _0xe7816d=_0x2385f0;document[_0xe7816d(0x132)]('.task')[_0xe7816d(0x13c)](_0x115a95=>_0x115a95['remove']());const _0x42f02c=JSON['parse'](window[_0xe7816d(0x13a)]['getItem']('tasks'));for(let _0x5d9754=0x0;_0x5d9754<_0x42f02c?.[_0xe7816d(0x131)];_0x5d9754++,id++){const _0x197c22=document[_0xe7816d(0x134)](_0xe7816d(0x12c));_0x197c22[_0xe7816d(0x149)][_0xe7816d(0x141)]('task'),_0x197c22[_0xe7816d(0x143)](_0x42f02c[_0x5d9754]);const _0x506d26=document[_0xe7816d(0x134)](_0xe7816d(0x13e));_0x506d26[_0xe7816d(0x143)](_0xe7816d(0x138)),_0x197c22[_0xe7816d(0x12f)]('id',id),_0x506d26[_0xe7816d(0x14d)]=()=>{const _0x41138d=_0xe7816d;window[_0x41138d(0x13a)][_0x41138d(0x130)](_0x41138d(0x139),JSON[_0x41138d(0x145)](_0x42f02c[_0x41138d(0x12b)]((_0x5a60e5,_0x277d9f)=>_0x277d9f!==Number(_0x197c22['getAttribute']('id'))))),id=0x0,placeData();},_0x197c22[_0xe7816d(0x143)](_0x506d26),mainDiv[_0xe7816d(0x143)](_0x197c22);}}document.querySelector('form').onsubmit=(e)=>e.preventDefault();