📄 File Converter

Convert images, compress photos, preview Markdown, transform CSV/JSON, and convert Word to PDF

📷 Image Format Converter

Convert between PNG, JPG, WEBP, GIF, BMP. Adjust quality.

📎
Drop images here or click to browse
Supports PNG, JPG, WEBP, GIF, BMP
90%

💾 Image Compressor

Reduce file size while maintaining quality.

📎
Drop images here or click to browse
Supports PNG, JPG, WEBP
70%

📖 Markdown Preview & Export

Write or paste Markdown, see live preview, export as HTML.

Editor
Preview

📋 CSV ↔ JSON Converter

Convert CSV to JSON and vice versa.

📄 Word to PDF Converter

Convert .doc/.docx to PDF. Processed via Cloudflare Workers.

📄
Drop Word file here or click to browse
Supports .doc and .docx, max 10MB

'; var a=document.createElement('a');a.href='data:text/html;charset=utf-8,'+encodeURIComponent(h);a.download='export.html';a.click(); }); // ═══ Tab 4: CSV ↔ JSON ═══ var csvDir='csv2json'; document.querySelectorAll('.dir-btn').forEach(function(b){b.addEventListener('click',function(){ document.querySelectorAll('.dir-btn').forEach(function(x){x.classList.remove('active');}); b.classList.add('active');csvDir=b.dataset.dir;updateCsvOutput(); });}); document.getElementById('csv-input').addEventListener('input',updateCsvOutput); function updateCsvOutput(){var i=document.getElementById('csv-input').value.trim(),o=document.getElementById('csv-output');if(!i){o.value='';return;}try{o.value=csvDir==='csv2json'?csvToJson(i):jsonToCsv(i);}catch(e){o.value='Error: '+e.message;}} function csvToJson(c){var l=c.split('\n').filter(function(x){return x.trim();});if(l.length<2)return'[]';var h=l[0].split(',').map(function(x){return x.trim().replace(/^"|"$/g,'');});var r=[];for(var i=1;i10*1024*1024){alert('File too large. Max 10MB.');return;} var btn=document.getElementById('wp-convert-btn'),pb=document.getElementById('wp-progress'),fill=document.getElementById('wp-fill'),st=document.getElementById('wp-status'),dl=document.getElementById('wp-download-link'); btn.disabled=true;pb.style.display='block';fill.style.width='10%';st.textContent='Uploading...'; var fd=new FormData();fd.append('file',wpFile); var url=(window.location.hostname==='localhost'||window.location.hostname==='127.0.0.1')?'http://localhost:8787/convert':'/convert-api'; var xhr=new XMLHttpRequest();xhr.open('POST',url,true); xhr.upload.onprogress=function(e){if(e.lengthComputable){var p=Math.round(20+(e.loaded/e.total)*60);fill.style.width=p+'%';st.textContent='Uploading... '+p+'%';}}; xhr.onload=function(){ if(xhr.status===200){fill.style.width='100%';st.textContent='Conversion complete!';dl.style.display='inline-block';dl.href=URL.createObjectURL(xhr.response);dl.download=wpFile.name.replace(/\.[^.]+$/,'')+'.pdf';btn.disabled=false;setTimeout(function(){pb.style.display='none';},1500);} else{st.textContent='Conversion failed. Try again later.';btn.disabled=false;} }; xhr.onerror=function(){st.textContent='Network error. Try again.';btn.disabled=false;}; xhr.responseType='blob';xhr.send(fd); }); // ═══ Init ═══ renderMd(); document.addEventListener('DOMContentLoaded',function(){ I18n.bindToggle('lang-toggle','lang-menu'); var nt=document.getElementById('nav-toggle');if(nt)nt.addEventListener('click',function(){document.querySelector('.nav-menu').classList.toggle('open');}); document.querySelectorAll('.nav-menu a').forEach(function(l){l.addEventListener('click',function(){document.querySelector('.nav-menu').classList.remove('open');});}); });