Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
inventionpro authored Jun 20, 2024
1 parent 791716f commit e2dea0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ function download(filename, text) {
/* Show cards */
function reload() {
let data = JSON.parse(localStorage.getItem('todo')) || [];
document.getElementById('preview').innerHTML = '<p>'+data.length+' tasks left</p>'+data.map(r => `<div class="card" id="c-${r.id}"${document.getElementById('c-'+r.id) ? '' : ' style="animation-name: appear;animation-duration: 1s;animation-iteration-count: 1;"'}>
document.getElementById('preview').innerHTML = '<p>'+data.length+' tasks left</p>'+data.map(r => `<div class="card" id="c-${r.id}"${document.getElementById('c-'+r.id) ? '' : ' style="animation-name:appear;animation-duration:1s;animation-iteration-count:1;"'}>
<label class="container">
<input type="checkbox" onchange="del(${r.id})">
<span class="checkmark"></span>
</label>
<div style="flex:1"><b>${r.title}</b><br>${r.desc.replace('\n','<br>')}</div>
<svg onclick="edit(${r.id})" style="height:15px;margin-bottom:auto;margin-top:auto;margin-right:10px;fill:#fff;" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"/></svg>
<svg onclick="edit(${r.id})" style="height:15px;margin-bottom:auto;margin-top:auto;margin-right:10px;fill:var(--text);" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M362.7 19.3L314.3 67.7 444.3 197.7l48.4-48.4c25-25 25-65.5 0-90.5L453.3 19.3c-25-25-65.5-25-90.5 0zm-71 71L58.6 323.5c-10.4 10.4-18 23.3-22.2 37.4L1 481.2C-1.5 489.7 .8 498.8 7 505s15.3 8.5 23.7 6.1l120.3-35.4c14.1-4.2 27-11.8 37.4-22.2L421.7 220.3 291.7 90.3z"/></svg>
</div>`).join('')
}
/* Add card*/
Expand Down

0 comments on commit e2dea0a

Please sign in to comment.