download_certificate_result.../index.html

176 lines
6.3 KiB
HTML
Raw Permalink Normal View History

2024-08-12 13:53:03 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>المديرية العامة للامتحانات</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background: linear-gradient(to bottom right, #124f43, #8eb9b0);
color: white;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.container {
text-align: center;
max-width: 500px;
padding: 20px;
background-color: rgb(48, 96, 87);
border-radius: 15px;
}
h1 {
font-size: 2.5em;
margin-bottom: 20px;
}
p {
font-size: 1.2em;
margin-bottom: 30px;
}
.download-button {
display: inline-block;
padding: 15px 25px;
background-color: #fff;
color: #124f43;
font-weight: bold;
border-radius: 10px;
text-decoration: none;
transition: background-color 0.3s;
cursor: pointer;
}
.download-button:hover {
background-color: rgb(28, 126, 106);
color: #fff;
}
.progress-bar {
width: 100%;
background-color: #ddd;
margin-top: 20px;
border-radius: 10px;
overflow: hidden;
display: none;
}
.progress-bar-inner {
height: 20px;
width: 0;
background-color: #38953a;
transition: width 0.4s ease;
}
.progress-text {
margin-top: 10px;
font-size: 1em;
}
.speed-text,
.remaining-time-text {
margin-top: 5px;
font-size: 1em;
}
</style>
</head>
<body>
<div class="container">
<h1>المديرية العامة للامتحانات</h1>
<p>تطبيق المديرية العامة للامتحانات لإصدار نتائج امتحان الشهادات والتعميمات الخاصة بها</p>
<button id="download-button" class="download-button">تحميل لنظام الأندرويد</button>
<div class="progress-bar" id="progress-bar">
<div class="progress-bar-inner" id="progress-bar-inner"></div>
</div>
<div class="progress-text" id="progress-text"></div>
<div class="speed-text" id="speed-text"></div>
<div class="remaining-time-text" id="remaining-time-text"></div>
</div>
<script>
document.getElementById('download-button').addEventListener('click', function () {
const progressBar = document.getElementById('progress-bar');
const progressBarInner = document.getElementById('progress-bar-inner');
const progressText = document.getElementById('progress-text');
const speedText = document.getElementById('speed-text');
const remainingTimeText = document.getElementById('remaining-time-text');
progressBar.style.display = 'block';
const xhr = new XMLHttpRequest();
xhr.open('GET', 'https://certificateresult.education-syria.com/certificate_result_1_0_4.apk', true);
xhr.responseType = 'blob';
let startTime = null;
let previousLoaded = 0;
let totalBytes = 0; // Total size of the file
let remainingBytes = 0;
xhr.onprogress = function (event) {
if (event.lengthComputable) {
if (!startTime) {
startTime = new Date().getTime();
totalBytes = event.total;
}
const currentTime = new Date().getTime();
const elapsedTime = (currentTime - startTime) / 1000; // seconds
const loaded = event.loaded;
remainingBytes = totalBytes - loaded;
const percentComplete = (loaded / totalBytes) * 100;
progressBarInner.style.width = percentComplete + '%';
progressText.innerText = '' + Math.round(percentComplete) + '%';
const speed = (loaded - previousLoaded) / elapsedTime; // bytes per second
previousLoaded = loaded;
startTime = currentTime;
const speedKbps = (speed * 8 / 1024).toFixed(2); // kbps
speedText.innerText = 'السرعة: ' + speedKbps + ' kbps';
const remainingTime = (remainingBytes / speed).toFixed(0); // seconds
const minutes = Math.floor(remainingTime / 60);
const seconds = remainingTime % 60;
remainingTimeText.innerText = 'الوقت المتبقي: ' + minutes + ' دقيقة و ' + seconds + ' ثانية';
}
};
xhr.onload = function () {
if (xhr.status === 200) {
const url = window.URL.createObjectURL(xhr.response);
const a = document.createElement('a');
a.href = url;
a.download = 'certificate_result_1_0_4.apk';
document.body.appendChild(a);
a.click();
a.remove();
progressText.innerText = 'اكتمل تحميل التطبيق. قم بفتح الملف من مجلد التنزيلات';
} else {
progressText.innerText = 'حدث خطأ أثناء تحميل التطبيق. الرجاء المحاولة مرة أخرى.';
}
};
xhr.onerror = function () {
progressText.innerText = 'حدث خطأ أثناء تحميل التطبيق. الرجاء المحاولة مرة أخرى.';
};
xhr.send();
});
</script>
<!-- Cloudflare Web Analytics -->
<script defer src='https://static.cloudflareinsights.com/beacon.min.js'
data-cf-beacon='{"token": "82542d9a43454e7ba6f4946b1e2e21e9"}'></script><!-- End Cloudflare Web Analytics -->
</body>
</html>