/*
 * @intranet-file instalacion/assets/install.js
 * @intranet-file-version 2026.03.13.1
 * @intranet-file-date 2026-03-13
 * @intranet-file-owner CSIF Intranet
 */

function previewPng(inputId, imgId){
  const inp=document.getElementById(inputId);
  const img=document.getElementById(imgId);
  if(!inp||!img) return;
  inp.addEventListener('change', ()=>{
    const f=inp.files && inp.files[0];
    if(!f){ img.src=''; img.style.display='none'; return; }
    if(f.type!=='image/png'){ alert('Debe ser un PNG'); inp.value=''; return; }
    const url=URL.createObjectURL(f);
    img.src=url; img.style.display='block';
  });
}
document.addEventListener('DOMContentLoaded', ()=>{
  previewPng('logo_color','prev_color');
  previewPng('logo_white','prev_white');
});
