{
    "id": "bhaskar/particle-dissolve-delete",
    "kind": "component",
    "title": "Particle Dissolve Delete",
    "summary": "Delete a row and it dissolves into a drifting cloud of dust before the list closes the gap.",
    "author": "Admin",
    "stars": 0,
    "url": "https://ownlyplans.com/bhaskar/particle-dissolve-delete/",
    "stack": [
        "CSS",
        "HTML",
        "JavaScript"
    ],
    "tools": [
        "claude-code",
        "cursor",
        "lovable"
    ],
    "difficulty": "beginner",
    "license": "mit",
    "version": "1.0",
    "overview": "A resource list where deleting feels physical. Hover a row (or focus it) and a trash button appears. Press it and the card is wiped away left to right behind a soft blurred edge while hundreds of tiny specks peel off exactly where the edge passes, drifting on a gentle curl-noise wind before fading out. The list then springs closed, the count rolls down, and focus moves to the next row. A Restore button brings everything back, and an empty state appears when nothing is left. It works by touch, by keyboard and with reduced motion, where rows simply fade.",
    "steps": [],
    "files": [],
    "install": "",
    "how_to_use": "Use the component code (html, css, js, or react) directly, or run the install command.",
    "component": {
        "category": "Motion and entrances",
        "html": "<!--\n  MIT License\n  Copyright (c) 2026 Suraj Maurya\n  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n  documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n  the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and\n  to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n  The above copyright notice and this permission notice shall be included in all copies or substantial portions\n  of the Software.\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO\n  THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n  CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n  DEALINGS IN THE SOFTWARE.\n-->\n<div class=\"pd-stage\">\n  <div class=\"pd\" role=\"region\" aria-label=\"Resources\">\n    <div class=\"pd-card\"><div class=\"pd-in\">\n      <div class=\"pd-hd\"><div class=\"pd-tl\"><h2>Resources</h2><span class=\"pd-ct\"><b>3</b></span></div><button type=\"button\" class=\"pd-rs\" hidden></button></div>\n      <ul class=\"pd-list\"></ul>\n      <div class=\"pd-empty\" hidden><span></span><p>Nothing left. All dissolved.</p><button type=\"button\">Restore resources</button></div>\n    </div></div>\n    <p class=\"pd-sr\" role=\"status\" aria-live=\"polite\"></p>\n  </div>\n</div>",
        "css": ".pd-stage{width:100%;min-height:calc(100vh - 40px);display:grid;grid-template-columns:minmax(0,1fr);place-items:center;padding:16px 12px;border-radius:16px;background:#111113;font-family:Inter,system-ui,-apple-system,\"Segoe UI\",sans-serif}\n.pd{width:min(512px,100%)}\n.pd [hidden]{display:none!important}\n.pd-card{overflow:hidden;border-radius:16px;background:#0b0b0c;color:#f5f5f5;box-shadow:0 0 0 1px rgba(255,255,255,.07),inset 0 1px 0 rgba(255,255,255,.05),0 1px 2px rgba(0,0,0,.4),0 28px 56px -28px rgba(0,0,0,.85);transition:height .45s cubic-bezier(.25,1,.4,1)}\n.pd-in{padding:8px}\n.pd-hd{display:flex;align-items:center;justify-content:space-between;height:36px;padding:0 10px}\n.pd-tl{display:flex;align-items:baseline;gap:8px}\n.pd-tl h2{margin:0;color:#d4d4d4;font-size:12px;font-weight:500;letter-spacing:.01em}\n.pd-ct{position:relative;display:inline-flex;height:16px;min-width:1ch;overflow:hidden;color:#525252;font-size:11px;font-variant-numeric:tabular-nums}\n.pd-ct b{font-weight:400;transition:transform .2s cubic-bezier(.23,1,.32,1),opacity .2s}\n.pd-rs{display:inline-flex;align-items:center;gap:6px;height:28px;margin-right:-4px;padding:0 8px;border:0;border-radius:8px;background:none;color:#737373;font:inherit;font-size:11.5px;cursor:pointer;animation:pd-fx .18s ease-out;transition:color .15s}\n@keyframes pd-fx{from{opacity:0;transform:translateX(6px)}}\n.pd-rs svg{width:12px;height:12px}\n.pd-list{display:flex;flex-direction:column;margin:4px 0 0;padding:0;list-style:none}\n.pd-li{overflow:hidden;padding-bottom:6px;transition:height .45s cubic-bezier(.25,1,.4,1),padding .45s cubic-bezier(.25,1,.4,1)}\n.pd-li:last-child{padding-bottom:0}\n.pd-li.new{animation:pd-up .25s ease-out both}\n@keyframes pd-up{from{opacity:0;transform:translateY(8px)}}\n.pd-row{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.025);box-shadow:inset 0 0 0 1px rgba(255,255,255,.06);transition:background .2s,box-shadow .2s}\n.pd-row:focus-within{background:rgba(255,255,255,.045)}\n.pd-row.busy{pointer-events:none}\n.pd-ic{display:grid;place-items:center;flex:none;width:32px;height:32px;border-radius:8px;background:rgba(255,255,255,.04);color:#a3a3a3;box-shadow:inset 0 0 0 1px rgba(255,255,255,.06)}\n.pd-ic svg,.pd-del svg{width:15px;height:15px}\n.pd-tx{flex:1;min-width:0}\n.pd-tx b,.pd-tx small{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;line-height:1.25}\n.pd-tx b{color:#f5f5f5;font-size:13px;font-weight:500;letter-spacing:-.01em}\n.pd-tx small{margin-top:2px;color:#737373;font-size:12px}\n.pd-tg{display:flex;align-items:center;gap:6px;flex:none;color:#737373;font-size:11px}\n.pd-tg i{width:6px;height:6px;border-radius:50%;background:#34d399;box-shadow:0 0 8px rgba(52,211,153,.55)}\n.pd-del{display:grid;place-items:center;flex:none;width:36px;height:36px;margin-right:-4px;padding:0;border:0;border-radius:8px;background:none;color:#525252;cursor:pointer;-webkit-tap-highlight-color:transparent;transition:color .15s,background .15s,opacity .15s,transform .15s}\n.pd-del:active{transform:scale(.92)}\n.pd-rs:focus-visible,.pd-del:focus-visible,.pd-empty button:focus-visible{outline:2px solid rgba(255,255,255,.4);outline-offset:2px}\n@media (hover:hover){.pd-rs:hover{color:#e5e5e5}.pd-row:hover{background:rgba(255,255,255,.045);box-shadow:inset 0 0 0 1px rgba(255,255,255,.1)}.pd-del{opacity:0}.pd-row:hover .pd-del,.pd-del:focus-visible{opacity:1}.pd-del:hover{background:rgba(244,63,94,.1);color:#fb7185}}\n@media (max-width:480px){.pd-tg span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}\n.pd-empty{display:flex;flex-direction:column;align-items:center;gap:12px;padding:40px 0;animation:pd-up .3s ease-out}\n.pd-empty span{width:24px;height:24px;border:1px dashed rgba(255,255,255,.15);border-radius:50%}\n.pd-empty p{margin:0;color:#737373;font-size:12.5px}\n.pd-empty button{padding:6px 10px;border:0;border-radius:8px;background:none;color:#d4d4d4;font:inherit;font-size:12px;text-decoration:underline;text-decoration-color:rgba(255,255,255,.2);text-underline-offset:4px;cursor:pointer}\n.pd-sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}\n@media (prefers-reduced-motion:reduce){.pd-card,.pd-li{transition:none}.pd-li.new,.pd-empty,.pd-rs{animation:none}}",
        "js": "(function(){\n  var P={shield:'M12 3 4.5 6v5.5c0 4.4 3.2 8.2 7.5 9.5 4.3-1.3 7.5-5.1 7.5-9.5V6Z',database:'M4 6c0-1.7 3.6-3 8-3s8 1.3 8 3-3.6 3-8 3-8-1.3-8-3ZM4 6v6c0 1.7 3.6 3 8 3s8-1.3 8-3V6M4 12v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6',cpu:'M7 7h10v10H7ZM10 10h4v4h-4ZM10 3v4M14 3v4M10 17v4M14 17v4M3 10h4M3 14h4M17 10h4M17 14h4',trash:'M4 7h16M10 11v6M14 11v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V4h6v3',restore:'M3 12a9 9 0 1 0 3-6.7L3 8M3 3v5h5'};\n  function ic(n){return '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"'+P[n]+'\"/></svg>';}\n  var ITEMS=[['Edge Cluster','12 workers · 42 ms latency','cpu','Healthy','Infra · iad-1 · Primary route'],['Session Vault','RSA-4096 · Rotation active','shield','Active','Security · Vault #01'],['L2 Memory Cache','1.2 GB · 99.8% hit ratio','database','Optimal','Database · Redis v7']];\n  var COLS=['#8a8a8e','#71717a','#9ca3af','#6b7280','#78716c'],reduce=matchMedia('(prefers-reduced-motion: reduce)').matches;\n  function dissolve(el){\n    if(reduce)return el.animate([{opacity:1},{opacity:0}],{duration:160,fill:'forwards'}).finished;\n    var r=el.getBoundingClientRect();if(!r.width)return Promise.resolve();\n    var coarse=matchMedia('(pointer: coarse)').matches,dur=1100,pad=Math.round(Math.min(140,Math.max(60,Math.max(r.width,r.height)*.35))),dpr=Math.min(devicePixelRatio||1,2),cw=r.width+pad*2,ch=r.height+pad*2,cv=document.createElement('canvas');\n    cv.width=Math.round(cw*dpr);cv.height=Math.round(ch*dpr);cv.style.cssText='position:absolute;left:'+(r.left+scrollX-pad)+'px;top:'+(r.top+scrollY-pad)+'px;width:'+cw+'px;height:'+ch+'px;pointer-events:none;z-index:2147483000';cv.setAttribute('aria-hidden','true');\n    var ctx=cv.getContext('2d');ctx.scale(dpr,dpr);ctx.translate(pad,pad);document.body.appendChild(cv);\n    var L=r.width,C=r.height,SOFT=14,count=Math.round(Math.min(coarse?700:1400,Math.max(80,r.width*r.height*14/1000))),q=[];\n    for(var i=0;i<count;i++){var u=Math.random(),f=(u*100+SOFT)/(100+SOFT),big=Math.random()<.06;q.push({t0:Math.acos(1-2*f)/Math.PI*dur,x:u*L+(Math.random()-.5)*3,y:Math.random()*C,vx:24+Math.pow(Math.random(),2)*210,vy:-(10+Math.random()*80)+(Math.random()-.5)*40,life:520+Math.random()*620,age:0,size:big?2.4+Math.random()*1.2:.7+Math.random()*1.5,ph:Math.random()*6.283,a0:.55+Math.random()*.45,ci:Math.floor(Math.random()*COLS.length)});}\n    q.sort(function(a,b){return a.t0-b.t0;});\n    var act=COLS.map(function(){return[];}),nx=0,live=0;el.style.willChange='mask-image,filter';\n    return new Promise(function(res){var st=performance.now(),last=st,done=false;\n      function fin(){if(done)return;done=true;cv.remove();el.style.willChange='';res();}\n      function fr(now){if(done)return;var t=now-st,dt=Math.min(.033,(now-last)/1000);last=now;var sec=t/1000,p=Math.min(1,t/dur),f=.5*(1-Math.cos(Math.PI*p)),pos=f*(100+SOFT),m='linear-gradient(90deg,transparent '+(pos-SOFT).toFixed(2)+'%,#000 '+pos.toFixed(2)+'%)';\n        el.style.maskImage=m;el.style.webkitMaskImage=m;el.style.filter='blur('+(f*1.4).toFixed(2)+'px)';\n        while(nx<q.length&&q[nx].t0<=t){var a=q[nx++];act[a.ci].push(a);live++;}\n        ctx.clearRect(-pad,-pad,cw,ch);\n        for(var c=0;c<act.length;c++){var bk=act[c];if(!bk.length)continue;ctx.fillStyle=COLS[c];for(var j=bk.length-1;j>=0;j--){var o=bk[j];o.age+=dt*1000;if(o.age>=o.life){bk[j]=bk[bk.length-1];bk.pop();live--;continue;}\n          o.vx+=Math.sin(o.y*.021+sec*3.1+o.ph)*70*dt;o.vy+=(Math.cos(o.x*.019+sec*2.4+o.ph)*70-20)*dt;var dm=1-.6*dt;o.vx*=dm;o.vy*=dm;o.x+=o.vx*dt;o.y+=o.vy*dt;var k=o.age/o.life,s=o.size*(1-.5*k);ctx.globalAlpha=o.a0*Math.pow(1-k,1.6);ctx.fillRect(o.x-s/2,o.y-s/2,s,s);}ctx.globalAlpha=1;}\n        if(p>=1&&nx>=q.length&&live<=0){el.style.maskImage=el.style.webkitMaskImage='linear-gradient(0deg,transparent,transparent)';fin();return;}requestAnimationFrame(fr);}\n      requestAnimationFrame(fr);setTimeout(fin,dur+2600);});}\n  document.querySelectorAll('.pd').forEach(function(root){\n    var card=root.querySelector('.pd-card'),inner=root.querySelector('.pd-in'),list=root.querySelector('.pd-list'),rs=root.querySelector('.pd-rs'),empty=root.querySelector('.pd-empty'),ct=root.querySelector('.pd-ct'),sr=root.querySelector('.pd-sr'),removed=[];\n    function sync(){card.style.height=inner.offsetHeight+'px';}\n    function count(n){var old=ct.querySelector('b');if(+old.textContent===n)return;var b=document.createElement('b');b.textContent=n;b.style.position='absolute';if(!reduce){b.style.transform='translateY(8px)';b.style.opacity=0;}ct.appendChild(b);old.style.transform='translateY(-8px)';old.style.opacity=0;requestAnimationFrame(function(){requestAnimationFrame(function(){b.style.transform='';b.style.opacity=1;});});setTimeout(function(){old.remove();b.style.position='';},220);}\n    function render(anim){list.innerHTML='';ITEMS.forEach(function(it,i){if(removed.indexOf(i)>=0)return;var li=document.createElement('li');li.className='pd-li'+(anim?' new':'');li.dataset.i=i;li.innerHTML='<div class=\"pd-row\" title=\"'+it[4]+'\"><span class=\"pd-ic\">'+ic(it[2])+'</span><span class=\"pd-tx\"><b>'+it[0]+'</b><small>'+it[1]+'</small></span><span class=\"pd-tg\"><i aria-hidden=\"true\"></i><span>'+it[3]+'</span></span><button type=\"button\" class=\"pd-del\" aria-label=\"Delete '+it[0]+'\">'+ic('trash')+'</button></div>';list.appendChild(li);});\n      var n=ITEMS.length-removed.length;count(n);empty.hidden=n>0;list.hidden=n===0;rs.hidden=!removed.length;rs.innerHTML=ic('restore')+'Restore'+(removed.length>1?' '+removed.length:'');sync();}\n    list.addEventListener('click',function(e){var b=e.target.closest('.pd-del');if(!b)return;var li=b.closest('.pd-li'),row=li.firstChild;if(row.classList.contains('busy'))return;row.classList.add('busy');b.disabled=true;\n      var lis=[].slice.call(list.children),k=lis.indexOf(li),nb=lis[k+1]||lis[k-1];\n      dissolve(row).then(function(){var i=+li.dataset.i,it=ITEMS[i];removed.push(i);sr.textContent=it[0]+' deleted';\n        if(list.children.length===1){render(false);var eb=empty.querySelector('button');eb.focus({preventScroll:true});return;}\n        li.style.height=li.offsetHeight+'px';li.getBoundingClientRect();li.style.height='0px';li.style.paddingBottom='0px';var prev=li.previousElementSibling;if(!li.nextElementSibling&&prev)prev.style.paddingBottom='0px';\n        count(ITEMS.length-removed.length);rs.hidden=false;rs.innerHTML=ic('restore')+'Restore'+(removed.length>1?' '+removed.length:'');\n        if(nb)nb.querySelector('.pd-del').focus({preventScroll:true});\n        requestAnimationFrame(sync);setTimeout(function(){li.remove();if(prev)prev.style.paddingBottom='';sync();},reduce?0:460);});});\n    function restore(){removed=[];render(true);sr.textContent='All resources restored';var f=list.querySelector('.pd-del');if(f&&document.activeElement&&root.contains(document.activeElement))f.focus({preventScroll:true});}\n    rs.addEventListener('click',restore);empty.querySelector('button').addEventListener('click',restore);\n    render(false);card.style.height='auto';if(window.ResizeObserver)new ResizeObserver(sync).observe(inner);\n  });\n})();",
        "react": "",
        "dependencies": [],
        "install": "",
        "licence_notice": ""
    }
}