950 lines
37 KiB
PHP
950 lines
37 KiB
PHP
<?php
|
|
|
|
namespace App\Views;
|
|
|
|
class StudentPortal
|
|
{
|
|
public static function render(): string
|
|
{
|
|
return <<<'HTML'
|
|
<!DOCTYPE html>
|
|
<html lang="ar" dir="rtl">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>بوابة الطالب — منصة صَقِل التعليمية</title>
|
|
<!-- Google Fonts: Cairo -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap" rel="stylesheet">
|
|
|
|
<!-- Pure Self-Contained Luxury CSS (Zero External CDN Failure Risk) -->
|
|
<style>
|
|
:root {
|
|
--bg-dark: #0B132B;
|
|
--bg-card: #16203D;
|
|
--bg-card-hover: #1E2C52;
|
|
--bg-input: #090E20;
|
|
--border: #2A3B66;
|
|
--border-focus: #00F5D4;
|
|
--text-primary: #FFFFFF;
|
|
--text-secondary: #CBD5E1;
|
|
--text-muted: #8E9FB8;
|
|
--accent-cyan: #00F5D4;
|
|
--accent-cyan-dark: #00BAA1;
|
|
--accent-gold: #FFD166;
|
|
--accent-red: #EF4444;
|
|
--accent-green: #10B981;
|
|
}
|
|
|
|
* {
|
|
box-sizing: border-box;
|
|
margin: 0;
|
|
padding: 0;
|
|
font-family: 'Cairo', system-ui, -apple-system, sans-serif;
|
|
}
|
|
|
|
body {
|
|
background-color: var(--bg-dark);
|
|
color: var(--text-primary);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
justify-content: space-between;
|
|
background-image:
|
|
radial-gradient(circle at 15% 15%, rgba(0, 245, 212, 0.05) 0%, transparent 40%),
|
|
radial-gradient(circle at 85% 85%, rgba(255, 209, 102, 0.04) 0%, transparent 40%),
|
|
linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
|
|
linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
|
|
background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
|
|
}
|
|
|
|
.container {
|
|
max-width: 1140px;
|
|
margin: 0 auto;
|
|
padding: 0 20px;
|
|
width: 100%;
|
|
}
|
|
|
|
/* Header */
|
|
header {
|
|
border-bottom: 1px solid var(--border);
|
|
background-color: rgba(11, 19, 43, 0.95);
|
|
backdrop-filter: blur(12px);
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 50;
|
|
}
|
|
|
|
.header-content {
|
|
height: 68px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.logo-area {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.logo-badge {
|
|
width: 42px;
|
|
height: 42px;
|
|
border-radius: 12px;
|
|
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-cyan-dark));
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--bg-dark);
|
|
font-size: 20px;
|
|
font-weight: 900;
|
|
box-shadow: 0 0 20px rgba(0, 245, 212, 0.3);
|
|
}
|
|
|
|
.brand-title {
|
|
font-size: 20px;
|
|
font-weight: 900;
|
|
color: #FFFFFF;
|
|
letter-spacing: 0.5px;
|
|
}
|
|
|
|
.portal-pill {
|
|
font-size: 11px;
|
|
font-weight: 700;
|
|
padding: 2px 10px;
|
|
border-radius: 999px;
|
|
background: rgba(0, 245, 212, 0.12);
|
|
color: var(--accent-cyan);
|
|
border: 1px solid rgba(0, 245, 212, 0.35);
|
|
margin-right: 8px;
|
|
}
|
|
|
|
.nav-link {
|
|
font-size: 13px;
|
|
color: var(--text-secondary);
|
|
text-decoration: none;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
transition: 0.2s;
|
|
}
|
|
|
|
.nav-link:hover {
|
|
color: var(--accent-gold);
|
|
}
|
|
|
|
.nav-link-highlight {
|
|
color: var(--accent-gold);
|
|
font-weight: 800;
|
|
text-decoration: underline;
|
|
}
|
|
|
|
/* Main Content */
|
|
main {
|
|
flex: 1;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 40px 0;
|
|
}
|
|
|
|
/* Auth Card */
|
|
.auth-card-wrapper {
|
|
width: 100%;
|
|
max-width: 460px;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.auth-header {
|
|
text-align: center;
|
|
margin-bottom: 24px;
|
|
}
|
|
|
|
.icon-box {
|
|
width: 64px;
|
|
height: 64px;
|
|
border-radius: 18px;
|
|
background: var(--bg-card);
|
|
border: 1px solid rgba(0, 245, 212, 0.4);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
color: var(--accent-cyan);
|
|
margin-bottom: 16px;
|
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
|
|
}
|
|
|
|
.auth-title {
|
|
font-size: 24px;
|
|
font-weight: 900;
|
|
color: #FFFFFF;
|
|
margin-bottom: 6px;
|
|
}
|
|
|
|
.auth-subtitle {
|
|
font-size: 13px;
|
|
color: var(--text-muted);
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.auth-box {
|
|
background: var(--bg-card);
|
|
border: 1px solid var(--border);
|
|
border-radius: 20px;
|
|
padding: 32px;
|
|
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
|
|
position: relative;
|
|
}
|
|
|
|
/* Forms & Inputs */
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-label {
|
|
display: block;
|
|
font-size: 12px;
|
|
font-weight: 700;
|
|
color: var(--text-secondary);
|
|
margin-bottom: 8px;
|
|
}
|
|
|
|
.input-text {
|
|
width: 100%;
|
|
background: var(--bg-input);
|
|
border: 1px solid var(--border);
|
|
border-radius: 12px;
|
|
padding: 12px 16px;
|
|
font-size: 14px;
|
|
color: #FFFFFF;
|
|
outline: none;
|
|
transition: border-color 0.2s, box-shadow 0.2s;
|
|
}
|
|
|
|
.input-text:focus {
|
|
border-color: var(--accent-cyan);
|
|
box-shadow: 0 0 0 3px rgba(0, 245, 212, 0.15);
|
|
}
|
|
|
|
.input-text::placeholder {
|
|
color: #52607D;
|
|
}
|
|
|
|
.phone-input-group {
|
|
display: flex;
|
|
align-items: center;
|
|
direction: ltr;
|
|
position: relative;
|
|
}
|
|
|
|
.country-badge {
|
|
position: absolute;
|
|
left: 10px;
|
|
background: #121A33;
|
|
border: 1px solid var(--border);
|
|
border-radius: 8px;
|
|
padding: 6px 10px;
|
|
font-size: 12px;
|
|
font-weight: 700;
|
|
color: var(--accent-cyan);
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
user-select: none;
|
|
}
|
|
|
|
.input-phone {
|
|
padding-left: 96px !important;
|
|
font-family: monospace;
|
|
font-size: 15px;
|
|
letter-spacing: 1px;
|
|
}
|
|
|
|
.form-hint {
|
|
font-size: 11px;
|
|
color: var(--text-muted);
|
|
margin-top: 6px;
|
|
display: block;
|
|
}
|
|
|
|
/* Buttons */
|
|
.btn-primary {
|
|
width: 100%;
|
|
padding: 14px;
|
|
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-cyan-dark));
|
|
color: var(--bg-dark);
|
|
border: none;
|
|
border-radius: 12px;
|
|
font-size: 15px;
|
|
font-weight: 800;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 8px;
|
|
box-shadow: 0 8px 20px rgba(0, 245, 212, 0.25);
|
|
transition: transform 0.15s, opacity 0.15s;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
opacity: 0.95;
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.btn-primary:active {
|
|
transform: translateY(0);
|
|
}
|
|
|
|
.btn-primary:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
transform: none;
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: none;
|
|
border: none;
|
|
color: var(--text-muted);
|
|
font-size: 12px;
|
|
cursor: pointer;
|
|
padding: 6px 0;
|
|
transition: color 0.2s;
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
color: #FFFFFF;
|
|
}
|
|
|
|
.btn-link-cyan {
|
|
color: var(--accent-cyan);
|
|
font-weight: 700;
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.otp-input {
|
|
text-align: center;
|
|
font-size: 26px;
|
|
font-family: monospace;
|
|
letter-spacing: 10px;
|
|
font-weight: 900;
|
|
color: var(--accent-cyan);
|
|
border-color: rgba(0, 245, 212, 0.5);
|
|
padding: 14px;
|
|
}
|
|
|
|
/* Alerts */
|
|
.alert {
|
|
padding: 12px 16px;
|
|
border-radius: 12px;
|
|
font-size: 12.5px;
|
|
margin-bottom: 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
line-height: 1.5;
|
|
}
|
|
|
|
.alert-error {
|
|
background: rgba(239, 68, 68, 0.12);
|
|
border: 1px solid rgba(239, 68, 68, 0.35);
|
|
color: #FCA5A5;
|
|
}
|
|
|
|
.alert-success {
|
|
background: rgba(0, 245, 212, 0.12);
|
|
border: 1px solid rgba(0, 245, 212, 0.35);
|
|
color: var(--accent-cyan);
|
|
}
|
|
|
|
.auth-footer {
|
|
margin-top: 24px;
|
|
padding-top: 16px;
|
|
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
|
text-align: center;
|
|
font-size: 11.5px;
|
|
color: var(--text-muted);
|
|
}
|
|
|
|
/* Student Dashboard */
|
|
.dashboard-hero {
|
|
background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
|
|
border: 1px solid var(--border);
|
|
border-radius: 24px;
|
|
padding: 32px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 24px;
|
|
flex-wrap: wrap;
|
|
margin-bottom: 28px;
|
|
}
|
|
|
|
.readiness-box {
|
|
background: rgba(11, 19, 43, 0.85);
|
|
border: 1px solid var(--border);
|
|
border-radius: 16px;
|
|
padding: 16px 20px;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 16px;
|
|
min-width: 240px;
|
|
}
|
|
|
|
.gauge-circle {
|
|
width: 56px;
|
|
height: 56px;
|
|
border-radius: 50%;
|
|
border: 4px solid var(--accent-cyan);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 18px;
|
|
font-weight: 900;
|
|
color: var(--accent-cyan);
|
|
box-shadow: 0 0 20px rgba(0, 245, 212, 0.3);
|
|
}
|
|
|
|
.cards-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
gap: 20px;
|
|
margin-bottom: 28px;
|
|
}
|
|
|
|
.feature-card {
|
|
background: var(--bg-card);
|
|
border: 1px solid var(--border);
|
|
border-radius: 20px;
|
|
padding: 24px;
|
|
transition: border-color 0.2s, transform 0.2s;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.feature-card:hover {
|
|
border-color: var(--accent-cyan);
|
|
transform: translateY(-2px);
|
|
}
|
|
|
|
.quiz-demo-box {
|
|
background: var(--bg-card);
|
|
border: 1px solid rgba(0, 245, 212, 0.4);
|
|
border-radius: 24px;
|
|
padding: 32px;
|
|
margin-bottom: 28px;
|
|
}
|
|
|
|
.interactive-quiz-container {
|
|
background: rgba(11, 19, 43, 0.9);
|
|
border: 1px solid var(--border);
|
|
border-radius: 16px;
|
|
padding: 24px;
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.quiz-option {
|
|
width: 100%;
|
|
text-align: right;
|
|
padding: 12px 16px;
|
|
border-radius: 12px;
|
|
border: 1px solid var(--border);
|
|
background: var(--bg-card);
|
|
color: var(--text-secondary);
|
|
font-size: 13px;
|
|
font-weight: 700;
|
|
margin-bottom: 10px;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
transition: border-color 0.2s;
|
|
}
|
|
|
|
.quiz-option:hover {
|
|
border-color: var(--accent-cyan);
|
|
}
|
|
|
|
.quiz-option.correct {
|
|
background: rgba(16, 185, 129, 0.15);
|
|
border-color: #10B981;
|
|
color: #6EE7B7;
|
|
}
|
|
|
|
.quiz-option.incorrect {
|
|
background: rgba(239, 68, 68, 0.15);
|
|
border-color: #EF4444;
|
|
color: #FCA5A5;
|
|
}
|
|
|
|
/* Watermark */
|
|
@keyframes bounce-watermark {
|
|
0%, 100% { transform: translate(10px, 10px); }
|
|
50% { transform: translate(120px, 60px); }
|
|
}
|
|
.watermark-anim {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
left: 20px;
|
|
z-index: 99;
|
|
pointer-events: none;
|
|
opacity: 0.35;
|
|
animation: bounce-watermark 12s infinite ease-in-out;
|
|
background: rgba(0, 0, 0, 0.7);
|
|
border: 1px solid rgba(255, 255, 255, 0.2);
|
|
padding: 4px 10px;
|
|
border-radius: 6px;
|
|
font-family: monospace;
|
|
font-size: 11px;
|
|
color: var(--accent-cyan);
|
|
}
|
|
|
|
/* Footer */
|
|
footer {
|
|
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
|
padding: 24px 0;
|
|
background: var(--bg-dark);
|
|
color: var(--text-muted);
|
|
font-size: 12px;
|
|
}
|
|
|
|
.footer-content {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
flex-wrap: wrap;
|
|
gap: 12px;
|
|
}
|
|
|
|
.spinner {
|
|
width: 18px;
|
|
height: 18px;
|
|
border: 3px solid rgba(11, 19, 43, 0.3);
|
|
border-top-color: var(--bg-dark);
|
|
border-radius: 50%;
|
|
animation: spin 0.8s linear infinite;
|
|
}
|
|
|
|
@keyframes spin {
|
|
to { transform: rotate(360deg); }
|
|
}
|
|
</style>
|
|
|
|
<!-- Alpine Component in Head -->
|
|
<script>
|
|
function studentAuth() {
|
|
return {
|
|
isLoggedIn: false,
|
|
authStep: 'phone', // 'phone' | 'otp'
|
|
phone: '',
|
|
fullName: '',
|
|
otpCode: '',
|
|
phoneDisplay: '',
|
|
loading: false,
|
|
errorMessage: '',
|
|
successMessage: '',
|
|
timer: 0,
|
|
timerInterval: null,
|
|
deviceFingerprint: '',
|
|
studentData: {},
|
|
|
|
async initApp() {
|
|
try {
|
|
this.deviceFingerprint = await this.generateDeviceFingerprint();
|
|
const token = localStorage.getItem('saqel_student_jwt');
|
|
if (token) {
|
|
await this.fetchProfile(token);
|
|
}
|
|
} catch (e) {
|
|
console.error('Student App init error:', e);
|
|
}
|
|
},
|
|
|
|
async generateDeviceFingerprint() {
|
|
try {
|
|
const raw = [
|
|
navigator.userAgent,
|
|
navigator.language,
|
|
screen.width + 'x' + screen.height,
|
|
Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
].join('###');
|
|
const msgUint8 = new TextEncoder().encode(raw);
|
|
const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8);
|
|
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
|
} catch (e) {
|
|
return 'student_web_' + Math.random().toString(36).substring(2);
|
|
}
|
|
},
|
|
|
|
async sendOtp() {
|
|
if (!this.phone) {
|
|
this.errorMessage = 'يرجى إدخال رقم الهاتف';
|
|
return;
|
|
}
|
|
this.loading = true;
|
|
this.errorMessage = '';
|
|
this.successMessage = '';
|
|
|
|
try {
|
|
const res = await fetch('/api/auth/otp/request', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
phone_number: this.phone,
|
|
role: 'student',
|
|
full_name: this.fullName
|
|
})
|
|
});
|
|
|
|
const data = await res.json();
|
|
if (res.ok) {
|
|
this.authStep = 'otp';
|
|
this.phoneDisplay = data.data?.phone_masked || this.phone;
|
|
this.successMessage = data.message;
|
|
if (data.debug_otp) {
|
|
this.otpCode = data.debug_otp;
|
|
}
|
|
this.startTimer(60);
|
|
} else {
|
|
this.errorMessage = data.message || 'فشل إرسال رمز التحقق. يرجى مراجعة إعدادات NABEH في السيرفر.';
|
|
}
|
|
} catch (e) {
|
|
this.errorMessage = 'حدث خطأ في الاتصال بالخادم. يرجى فحص /api/test/nabeh';
|
|
} finally {
|
|
this.loading = false;
|
|
}
|
|
},
|
|
|
|
async verifyOtp() {
|
|
if (!this.otpCode || this.otpCode.length < 6) {
|
|
this.errorMessage = 'يرجى إدخال رمز التحقق المكون من 6 أرقام';
|
|
return;
|
|
}
|
|
this.loading = true;
|
|
this.errorMessage = '';
|
|
|
|
try {
|
|
const res = await fetch('/api/auth/otp/verify', {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify({
|
|
phone_number: this.phone,
|
|
otp: this.otpCode,
|
|
role: 'student',
|
|
full_name: this.fullName,
|
|
device_fingerprint: this.deviceFingerprint
|
|
})
|
|
});
|
|
|
|
const data = await res.json();
|
|
if (res.ok && data.data?.token) {
|
|
localStorage.setItem('saqel_student_jwt', data.data.token);
|
|
this.studentData = data.data.user;
|
|
this.isLoggedIn = true;
|
|
this.successMessage = 'تم تسجيل الدخول بنجاح!';
|
|
} else {
|
|
this.errorMessage = data.message || 'رمز التحقق غير صحيح';
|
|
}
|
|
} catch (e) {
|
|
this.errorMessage = 'حدث خطأ أثناء التحقق من الرمز';
|
|
} finally {
|
|
this.loading = false;
|
|
}
|
|
},
|
|
|
|
async fetchProfile(token) {
|
|
try {
|
|
const res = await fetch('/api/auth/me', {
|
|
headers: { 'Authorization': 'Bearer ' + token }
|
|
});
|
|
const data = await res.json();
|
|
if (res.ok && data.data) {
|
|
this.studentData = {
|
|
name: data.data.full_name,
|
|
phone: data.data.phone_number,
|
|
role: data.data.role
|
|
};
|
|
this.isLoggedIn = true;
|
|
} else {
|
|
localStorage.removeItem('saqel_student_jwt');
|
|
this.isLoggedIn = false;
|
|
}
|
|
} catch (e) {
|
|
this.isLoggedIn = false;
|
|
}
|
|
},
|
|
|
|
logout() {
|
|
const token = localStorage.getItem('saqel_student_jwt');
|
|
if (token) {
|
|
fetch('/api/auth/logout', {
|
|
method: 'POST',
|
|
headers: { 'Authorization': 'Bearer ' + token }
|
|
}).catch(() => {});
|
|
}
|
|
localStorage.removeItem('saqel_student_jwt');
|
|
this.isLoggedIn = false;
|
|
this.authStep = 'phone';
|
|
this.otpCode = '';
|
|
this.errorMessage = '';
|
|
this.successMessage = '';
|
|
},
|
|
|
|
startTimer(seconds) {
|
|
this.timer = seconds;
|
|
clearInterval(this.timerInterval);
|
|
this.timerInterval = setInterval(() => {
|
|
if (this.timer > 0) {
|
|
this.timer--;
|
|
} else {
|
|
clearInterval(this.timerInterval);
|
|
}
|
|
}, 1000);
|
|
}
|
|
};
|
|
}
|
|
</script>
|
|
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
|
</head>
|
|
<body x-data="studentAuth()" x-init="initApp()">
|
|
|
|
<!-- Header -->
|
|
<header>
|
|
<div class="container">
|
|
<div class="header-content">
|
|
<a href="/student" class="logo-area">
|
|
<div class="logo-badge">صـ</div>
|
|
<div>
|
|
<span class="brand-title">صَقِل</span>
|
|
<span class="portal-pill">بوابة الطالب</span>
|
|
</div>
|
|
</a>
|
|
|
|
<div>
|
|
<template x-if="isLoggedIn">
|
|
<div style="display: flex; align-items: center; gap: 12px;">
|
|
<span style="font-size: 13px; color: var(--text-secondary);" x-text="'مرحباً، ' + (studentData.name || 'طالب صَقِل')"></span>
|
|
<button @click="logout()" style="background: none; border: 1px solid rgba(239,68,68,0.4); color: #F87171; border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer;">
|
|
تسجيل الخروج
|
|
</button>
|
|
</div>
|
|
</template>
|
|
<template x-if="!isLoggedIn">
|
|
<a href="/teacher" class="nav-link">
|
|
<span>أنت معلم؟</span>
|
|
<span class="nav-link-highlight">بوابة المعلمين ←</span>
|
|
</a>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<!-- Main Content -->
|
|
<main>
|
|
<div class="container">
|
|
|
|
<!-- ========================================== -->
|
|
<!-- 1. AUTHENTICATION BOX (LOGIN / OTP) -->
|
|
<!-- ========================================== -->
|
|
<div x-show="!isLoggedIn" class="auth-card-wrapper">
|
|
|
|
<div class="auth-header">
|
|
<div class="icon-box">
|
|
<svg width="28" height="28" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"></path>
|
|
</svg>
|
|
</div>
|
|
<h1 class="auth-title">ادخل لعالم التمكين والفهم</h1>
|
|
<p class="auth-subtitle">تسجيل دخول آمن وسريع عبر رمز الواتساب المعتمد</p>
|
|
</div>
|
|
|
|
<div class="auth-box">
|
|
|
|
<!-- Alerts -->
|
|
<template x-if="errorMessage">
|
|
<div class="alert alert-error">
|
|
<span>⚠️</span>
|
|
<span x-text="errorMessage"></span>
|
|
</div>
|
|
</template>
|
|
|
|
<template x-if="successMessage">
|
|
<div class="alert alert-success">
|
|
<span>✓</span>
|
|
<span x-text="successMessage"></span>
|
|
</div>
|
|
</template>
|
|
|
|
<!-- STEP 1: Phone Number -->
|
|
<div x-show="authStep === 'phone'">
|
|
<form @submit.prevent="sendOtp()">
|
|
<div class="form-group">
|
|
<label class="form-label">الاسم الكامل للطالب (اختياري للشهادات)</label>
|
|
<input type="text" x-model="fullName" placeholder="مثال: أحمد محمد خالد" class="input-text">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">رقم الهاتف (الواتساب) <span style="color: #EF4444;">*</span></label>
|
|
<div class="phone-input-group">
|
|
<div class="country-badge">🇯🇴 +962</div>
|
|
<input type="tel" x-model="phone" required placeholder="790000000" class="input-text input-phone">
|
|
</div>
|
|
<span class="form-hint">يصلك رمز التحقق مباشرة على الواتساب المعتمد.</span>
|
|
</div>
|
|
|
|
<button type="submit" :disabled="loading" class="btn-primary">
|
|
<template x-if="loading">
|
|
<div class="spinner"></div>
|
|
</template>
|
|
<span x-text="loading ? 'جارٍ الإرسال...' : 'إرسال رمز التحقق (OTP) ←'"></span>
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- STEP 2: OTP Verification -->
|
|
<div x-show="authStep === 'otp'">
|
|
<div style="text-align: center; margin-bottom: 20px;">
|
|
<span style="font-size: 12px; color: var(--text-muted);">تم إرسال رمز التحقق إلى:</span>
|
|
<div style="font-family: monospace; font-size: 15px; font-weight: 800; color: var(--accent-cyan); margin-top: 4px;" x-text="phoneDisplay"></div>
|
|
</div>
|
|
|
|
<form @submit.prevent="verifyOtp()">
|
|
<div class="form-group">
|
|
<label class="form-label" style="text-align: center;">أدخل رمز التحقق (6 أرقام)</label>
|
|
<input type="text" x-model="otpCode" maxlength="6" autofocus placeholder="• • • • • •" class="input-text otp-input">
|
|
</div>
|
|
|
|
<button type="submit" :disabled="loading || otpCode.length < 6" class="btn-primary">
|
|
<template x-if="loading">
|
|
<div class="spinner"></div>
|
|
</template>
|
|
<span x-text="loading ? 'جارٍ التحقق...' : 'تأكيد الدخول للمنصة ✨'"></span>
|
|
</button>
|
|
|
|
<div style="display: flex; align-items: center; justify-content: space-between; margin-top: 18px;">
|
|
<button type="button" @click="authStep = 'phone'" class="btn-secondary">← تعديل الرقم</button>
|
|
<template x-if="timer > 0">
|
|
<span style="font-size: 12px; color: var(--text-muted);" x-text="'إعادة الإرسال بعد (' + timer + 'ث)'"></span>
|
|
</template>
|
|
<template x-if="timer === 0">
|
|
<button type="button" @click="sendOtp()" class="btn-secondary btn-link-cyan">إعادة إرسال الرمز ↺</button>
|
|
</template>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="auth-footer">
|
|
<span>اتصال مشفر بتكنولوجيا Zero-Trust وبصمة الجهاز الموحدة</span>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- ========================================== -->
|
|
<!-- 2. STUDENT DASHBOARD (AUTHENTICATED) -->
|
|
<!-- ========================================== -->
|
|
<div x-show="isLoggedIn" style="width: 100%;">
|
|
|
|
<div class="dashboard-hero">
|
|
<div>
|
|
<span style="display: inline-block; font-size: 11px; font-weight: 800; color: var(--accent-cyan); background: rgba(0,245,212,0.12); border: 1px solid rgba(0,245,212,0.3); padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;">دفعة التوجيهي 2007/2008</span>
|
|
<h2 style="font-size: 26px; font-weight: 900; color: #FFFFFF;" x-text="'أهلاً بك، ' + (studentData.name || 'طالبنا المتميز') + ' 🚀'"></h2>
|
|
<p style="font-size: 13px; color: var(--text-secondary); margin-top: 4px;">رحلتك لصقل الفهم وتحقيق أعلى معدل وزاري تبدأ هنا.</p>
|
|
</div>
|
|
|
|
<div class="readiness-box">
|
|
<div class="gauge-circle">84%</div>
|
|
<div>
|
|
<span style="font-size: 11px; font-weight: 700; color: var(--text-muted); display: block;">مؤشر الجاهزية للوزاري</span>
|
|
<span style="font-size: 12px; font-weight: 700; color: #34D399;">ممتاز — مسارك مستقر</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="cards-grid">
|
|
<div class="feature-card">
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 12px;">
|
|
<span style="font-size: 11px; font-weight: 800; background: rgba(59,130,246,0.15); border: 1px solid rgba(59,130,246,0.3); color: #60A5FA; padding: 2px 8px; border-radius: 6px;">علمي</span>
|
|
<span style="font-size: 11px; color: var(--text-muted);">18 درس • كويزات</span>
|
|
</div>
|
|
<h3 style="font-size: 17px; font-weight: 900; margin-bottom: 6px;">الرياضيات العلمي — المستوى الثالث</h3>
|
|
<p style="font-size: 12px; color: var(--text-muted); line-height: 1.5;">شرح تفاعلي لمفاهيم الاشتقاق والنهايات مع أسئلة وزارية محاكية.</p>
|
|
</div>
|
|
|
|
<div class="feature-card">
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 12px;">
|
|
<span style="font-size: 11px; font-weight: 800; background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); color: #FBBF24; padding: 2px 8px; border-radius: 6px;">علمي</span>
|
|
<span style="font-size: 11px; color: var(--text-muted);">14 درس • تجارب</span>
|
|
</div>
|
|
<h3 style="font-size: 17px; font-weight: 900; margin-bottom: 6px;">الفيزياء — الميكانيكا والطاقة</h3>
|
|
<p style="font-size: 12px; color: var(--text-muted); line-height: 1.5;">صقل مفاهيم الزخم الخطي والتصادمات وتطبيقاتها في الامتحانات.</p>
|
|
</div>
|
|
|
|
<div class="feature-card">
|
|
<div style="display: flex; justify-content: space-between; margin-bottom: 12px;">
|
|
<span style="font-size: 11px; font-weight: 800; background: rgba(168,85,247,0.15); border: 1px solid rgba(168,85,247,0.3); color: #C084FC; padding: 2px 8px; border-radius: 6px;">ميزة ذكية</span>
|
|
<span style="font-size: 11px; color: var(--accent-cyan); font-weight: 800;">Whisper AI</span>
|
|
</div>
|
|
<h3 style="font-size: 17px; font-weight: 900; margin-bottom: 6px;">الملاحظات الصوتية والتفريغ</h3>
|
|
<p style="font-size: 12px; color: var(--text-muted); line-height: 1.5;">سجل أي ملاحظة بصوتك أثناء الحصة، والذكاء الاصطناعي يفرغها لنص فوري.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="quiz-demo-box">
|
|
<div style="display: flex; align-items: center; gap: 8px; margin-bottom: 8px;">
|
|
<span style="font-size: 11px; font-weight: 800; background: rgba(0,245,212,0.1); border: 1px solid rgba(0,245,212,0.3); color: var(--accent-cyan); padding: 2px 8px; border-radius: 6px;">تجربة تفاعلية (Coursera Model)</span>
|
|
</div>
|
|
<h3 style="font-size: 20px; font-weight: 900;">كيف يعمل الكويز الصدمي داخل الفيديو؟</h3>
|
|
<p style="font-size: 12px; color: var(--text-muted); margin-top: 4px;">يتوقف الفيديو تلقائياً عند لحظة قياس الفهم. إذا أخطأت، يعيدك المشغل 45 ثانية لمشاهدة شرح المفهوم مجدداً.</p>
|
|
|
|
<div class="interactive-quiz-container" x-data="{ selectedOpt: null, answered: false, isCorrect: false }">
|
|
<div style="font-size: 11px; font-weight: 800; color: var(--accent-gold); margin-bottom: 8px;">سؤال اللحظة (الدقيقة 08:30 من درس الاشتقاق):</div>
|
|
<p style="font-size: 14px; font-weight: 800; margin-bottom: 14px;">ما هو مشتق اقتران الجيب f(x) = sin(x) بالنسبة لـ x؟</p>
|
|
|
|
<div>
|
|
<div @click="selectedOpt = 1; answered = true; isCorrect = true"
|
|
:class="answered && selectedOpt === 1 ? 'quiz-option correct' : 'quiz-option'">
|
|
<span>أ) cos(x)</span>
|
|
<span x-show="answered && selectedOpt === 1" style="color: #34D399;">✓ إجابة صحيحة! استئناف الفيديو</span>
|
|
</div>
|
|
<div @click="selectedOpt = 2; answered = true; isCorrect = false"
|
|
:class="answered && selectedOpt === 2 ? 'quiz-option incorrect' : 'quiz-option'">
|
|
<span>ب) -cos(x)</span>
|
|
<span x-show="answered && selectedOpt === 2" style="color: #F87171;">✗ خطأ — سيتم إرجاعك 45 ثانية للشرح</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="watermark-anim">
|
|
<span x-text="'SAQEL-DRM • ' + (studentData.phone || '079XXXXXXX')"></span>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</main>
|
|
|
|
<!-- Footer -->
|
|
<footer>
|
|
<div class="container">
|
|
<div class="footer-content">
|
|
<span>منصة صَقِل التعليمية — الجيل الثاني للتعليم التفاعلي © 2026</span>
|
|
<div style="display: flex; gap: 16px;">
|
|
<a href="/teacher" class="nav-link">بوابة المعلم</a>
|
|
<span style="color: var(--accent-cyan);">الخادم متصل ومشفر 🔒</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
</body>
|
|
</html>
|
|
HTML;
|
|
}
|
|
}
|