أداة إزالة الصوت body { font-family: Arial, sans-serif; background-color: #f4f4f9; padding: 20px; } .container { max-width: 600px; margin: auto; background: white; padding: 20px; border-radius: 8px; box-shadow: 0px 4px 8px rgba(0,0,0,0.1); } h1 { text-align: center; color: #333; } input[type="file"] { display: block; margin: 20px auto; } button { display: block; margin: auto; padding: 10px 20px; background: #4CAF50; color: white; border: none; border-radius: 5px; cursor: pointer; } button:hover { background: #45a049; } #progress-container { display: none; margin-top: 20px; } #progress-bar { width: 100%; background: #ddd; border-radius: 5px; overflow: hidden; } #progress-bar-fill { height: 20px; background: #4CAF50; width: 0%; text-align: center; color: white; line-height: 20px; } .result { margin-top: 20px; } .file-result { margin-top: 10px; padding: 10px; background: #f9f9f9; border: 1px solid #ddd; border-radius: 5px; } .file-result a { display: block; margin-top: 5px; text-decoration: none; color: #007BFF; } .file-result a:hover { text-decoration: underline; } أداة إزالة الصوت فصل الصوت 0% async function processAudio() { const fileInput = document.getElementById("audioFile"); const resultDiv = document.getElementById("result"); const progressContainer = document.getElementById("progress-container"); const progressBarFill = document.getElementById("progress-bar-fill"); if (!fileInput.files.length) { alert("الرجاء اختيار ملف صوتي"); return; } const file = fileInput.files[0]; const formData = new FormData(); formData.append("file", file); resultDiv.innerHTML = ""; progressContainer.style.display = "block"; progressBarFill.style.width = "0%"; progressBarFill.innerText = "0%"; try { const uploadRequest = new XMLHttpRequest(); uploadRequest.open("POST", "https://api.vocalremover.org/api/v1/remove"); // رابط API تجريبي uploadRequest.upload.onprogress = function(e) { if (e.lengthComputable) { let percent = Math.round((e.loaded / e.total) * 100); progressBarFill.style.width = percent + "%"; progressBarFill.innerText = percent + "%"; } }; uploadRequest.onload = function() { progressBarFill.style.width = "100%"; progressBarFill.innerText = "100%"; let response = JSON.parse(uploadRequest.response); resultDiv.innerHTML = ` الغناء فقط تحميل MP3 الموسيقى فقط تحميل MP3 `; }; uploadRequest.onerror = function() { resultDiv.innerHTML = "حدث خطأ أثناء معالجة الملف."; }; uploadRequest.send(formData); } catch (error) { console.error(error); resultDiv.innerHTML = "حدث خطأ أثناء المعالجة."; } }