<!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>
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
'islamic-gold': '#D4AF37',
'islamic-dark-gold': '#B8941F',
'islamic-light-gold': '#F4E4BC',
'islamic-green': '#006633',
'islamic-dark-green': '#004225',
'islamic-blue': '#003366',
},
animation: {
'rotate-slow': 'rotate 20s linear infinite',
'rotate-reverse': 'rotate-reverse 15s linear infinite',
'pulse-gold': 'pulse-gold 3s ease-in-out infinite',
'float': 'float 6s ease-in-out infinite',
}
}
}
}
</script>
<style>
@import url('https://fonts.googleapis.co...
body {
font-family: 'Amiri', serif;
}
@keyframes rotate {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
@keyframes rotate-reverse {
from { transform: rotate(360deg); }
to { transform: rotate(0deg); }
}
@keyframes pulse-gold {
0%, 100% {
box-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
transform: scale(1);
}
50% {
box-shadow: 0 0 40px rgba(212, 175, 55, 0.6);
transform: scale(1.05);
}
}
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
}
.islamic-gradient {
background: linear-gradient(135deg,
#D4AF37 0%,
#F4E4BC 25%,
#006633 50%,
#D4AF37 75%,
#B8941F 100%);
background-size: 400% 400%;
animation: gradientMove 8s ease infinite;
}
.islamic-gradient-dark {
background: linear-gradient(135deg,
#1a1a1a 0%,
#2d2d2d 25%,
#004225 50%,
#B8941F 75%,
#1a1a1a 100%);
background-size: 400% 400%;
animation: gradientMove 8s ease infinite;
}
@keyframes gradientMove {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
100% { background-position: 0% 50%; }
}
.islamic-pattern {
background-image:
radial-gradient(circle at 25% 25%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
radial-gradient(circle at 75% 75%, rgba(0, 102, 51, 0.1) 0%, transparent 50%);
}
input[type="range"] {
background: transparent;
-webkit-appearance: none;
}
input[type="range"]::-webkit-slider-track {
background: rgba(212, 175, 55, 0.3);
height: 4px;
border-radius: 2px;
}
input[type="range"]::-webkit-slider-thumb {
-webkit-appearance: none;
background: #D4AF37;
height: 16px;
width: 16px;
border-radius: 50%;
cursor: pointer;
}
</style>
</head>
<body class="min-h-screen transition-colors duration-300">
<div id="background" class="fixed inset-0 islamic-gradient dark:islamic-gradient-dark islamic-pattern"></div>
<script>
// Dark mode detection
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.documentElement.classList.add('dark');
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => {
if (event.matches) {
document.documentElement.classList.add('dark');
} else {
document.documentElement.classList.remove('dark');
}
});
</script>
<div class="relative z-10 min-h-screen flex items-center justify-center p-4">
<div class="w-full max-w-md mx-auto">
<!-- Main Player Container -->
<div class="bg-white/90 dark:bg-gray-900/90 backdrop-blur-lg rounded-3xl p-8 shadow-2xl border-2 border-islamic-gold/50 animate-pulse-gold">
<!-- Islamic Header -->
<div class="text-center mb-6">
<h1 class="text-2xl font-bold text-islamic-gold mb-2">بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ</h1>
<p class="text-islamic-green dark:text-islamic-light-gold text-sm">مشغل القرآن الكريم</p>
</div>
<!-- Animated Islamic Symbol Circle -->
<div class="relative mb-8 flex items-center justify-center">
<div class="relative w-48 h-48 rounded-full flex items-center justify-center">
<!-- Outer rotating ring -->
<div class="absolute w-48 h-48 rounded-full border-4 border-islamic-gold/30 animate-rotate-slow"></div>
<div class="absolute w-40 h-40 rounded-full border-3 border-islamic-green/40 animate-rotate-reverse"></div>
<div class="absolute w-32 h-32 rounded-full border-2 border-islamic-gold/50 animate-rotate-slow"></div>
<!-- Islamic geometric patterns -->
<div class="absolute w-44 h-44 opacity-20">
<svg viewBox="0 0 200 200" class="w-full h-full animate-rotate-slow">
<defs>
<pattern id="islamicPattern" x="0" y="0" width="50" height="50" patternUnits="userSpaceOnUse">
<polygon points="25,5 45,20 45,35 25,50 5,35 5,20" fill="none" stroke="#D4AF37" stroke-width="1"/>
</pattern>
</defs>
<circle cx="100" cy="100" r="90" fill="url(#islamicPattern)"/>
</svg>
</div>
<!-- Center Islamic Symbol -->
<div class="relative z-10 w-20 h-20 bg-islamic-gold/20 backdrop-blur rounded-full flex items-center justify-center animate-float">
<!-- Crescent and Star -->
<div class="relative">
<svg class="w-12 h-12 text-islamic-gold" viewBox="0 0 24 24" fill="currentColor">
<!-- Crescent -->
<path d="M12 2C8.5 2 5.5 4.5 5.5 8c0 3.5 3 6 6.5 6 1.5 0 2.8-.5 3.8-1.3C14.8 13.5 13.5 14 12 14c-3.3 0-6-2.7-6-6s2.7-6 6-6c1.5 0 2.8.5 3.8 1.3C14.8 2.5 13.5 2 12 2z"/>
<!-- Star -->
<path d="M18 8l-1.5 1.5L18 11l1.5-1.5L18 8zm0-1l.5-.5L19 7l-.5.5L18 7zm1 3l.5.5L20 10l-.5-.5L19 10zm-2 0l-.5.5L17 10l.5-.5L17 10z"/>
</svg>
</div>
<!-- Play/Pause indicator -->
<div class="absolute inset-0 flex items-center justify-center">
<div id="playIndicator" class="w-6 h-6 text-islamic-gold opacity-80">
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M8 5v14l11-7z"/>
</svg>
</div>
<div id="pauseIndicator" class="w-6 h-6 text-islamic-gold opacity-80 hidden">
<svg viewBox="0 0 24 24" fill="currentColor">
<path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/>
</svg>
</div>
</div>
</div>
</div>
</div>
<!-- Audio Element -->
<audio id="audioPlayer" preload="metadata">
<!-- ضع رابط الملف الصوتي هنا -->
<source src="https://www.soundjay.com/mi..." type="audio/wav">
<!-- يمكنك تغيير الرابط أعلاه إلى ملف MP3 أو أي ملف صوتي آخر -->
</audio>
<!-- Track Info -->
<div class="mb-6 text-center">
<h3 id="trackName" class="text-islamic-green dark:text-islamic-light-gold text-lg font-bold mb-1">سورة الفاتحة</h3>
<p id="trackTime" class="text-islamic-gold text-sm">00:00 / 00:00</p>
</div>
<!-- Progress Bar -->
<div class="mb-6">
<div class="w-full bg-islamic-gold/20 rounded-full h-3 mb-2 overflow-hidden">
<div id="progressBar" class="bg-gradient-to-r from-islamic-gold to-islamic-dark-gold h-3 rounded-full transition-all duration-300 shadow-lg" style="width: 0%"></div>
</div>
<input
type="range"
id="progressSlider"
min="0"
max="100"
value="0"
class="w-full cursor-pointer"
>
</div>
<!-- Control Buttons -->
<div class="flex justify-center items-center space-x-6 space-x-reverse mb-6">
<!-- Restart Button -->
<button id="restartBtn" class="w-14 h-14 bg-islamic-gold/20 backdrop-blur rounded-full flex items-center justify-center text-islamic-gold hover:bg-islamic-gold/30 transition-all duration-300 hover:scale-110 border-2 border-islamic-gold/30">
<svg class="w-6 h-6" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/>
</svg>
</button>
<!-- Play/Pause Button -->
<button id="playPauseBtn" class="w-20 h-20 bg-gradient-to-br from-islamic-gold to-islamic-dark-gold rounded-full flex items-center justify-center text-white hover:scale-110 transition-all duration-300 shadow-xl border-4 border-white/20">
<svg id="playBtnIcon" class="w-10 h-10 mr-1" viewBox="0 0 24 24" fill="currentColor">
<path d="M8 5v14l11-7z"/>
</svg>
<svg id="pauseBtnIcon" class="w-10 h-10 hidden" viewBox="0 0 24 24" fill="currentColor">
<path d="M6 19h4V5H6v14zm8-14v14h4V5h-4z"/>
</svg>
</button>
<!-- Stop Button -->
<button id="stopBtn" class="w-14 h-14 bg-islamic-gold/20 backdrop-blur rounded-full flex items-center justify-center text-islamic-gold hover:bg-islamic-gold/30 transition-all duration-300 hover:scale-110 border-2 border-islamic-gold/30">
<svg class="w-6 h-6" viewBox="0 0 24 24" fill="currentColor">
<path d="M6 6h12v12H6z"/>
</svg>
</button>
</div>
<!-- Speed Control -->
<div class="mb-6">
<label class="block text-islamic-green dark:text-islamic-light-gold text-sm font-bold mb-3 text-center">
السرعة: <span id="speedValue" class="text-islamic-gold">1.0x</span>
</label>
<div class="flex items-center space-x-3 space-x-reverse">
<button id="speedDown" class="w-12 h-12 bg-islamic-gold/20 backdrop-blur rounded-full flex items-center justify-center text-islamic-gold hover:bg-islamic-gold/30 transition-all duration-300 border border-islamic-gold/30">
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
<path d="M19 13H5v-2h14v2z"/>
</svg>
</button>
<input
type="range"
id="speedSlider"
min="0.5"
max="3"
step="0.1"
value="1"
class="flex-1 cursor-pointer"
>
<button id="speedUp" class="w-12 h-12 bg-islamic-gold/20 backdrop-blur rounded-full flex items-center justify-center text-islamic-gold hover:bg-islamic-gold/30 transition-all duration-300 border border-islamic-gold/30">
<svg class="w-5 h-5" viewBox="0 0 24 24" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</svg>
</button>
</div>
</div>
<!-- Volume Control -->
<div class="mb-4">
<label class="block text-islamic-green dark:text-islamic-light-gold text-sm font-bold mb-3 text-center">
الصوت: <span id="volumeValue" class="text-islamic-gold">100%</span>
</label>
<input
type="range"
id="volumeSlider"
min="0"
max="100"
value="100"
class="w-full cursor-pointer"
>
</div>
<!-- Islamic Footer -->
<div class="text-center mt-6">
<p class="text-islamic-gold text-xs">﴿وَقُل رَّبِّ زِدْنِي عِلْمًا﴾</p>
</div>
</div>
</div>
</div>
<script>
// DOM Elements
const audioPlayer = document.getElementById('audioPlayer');
const playPauseBtn = document.getElementById('playPauseBtn');
const playBtnIcon = document.getElementById('playBtnIcon');
const pauseBtnIcon = document.getElementById('pauseBtnIcon');
const playIndicator = document.getElementById('playIndicator');
const pauseIndicator = document.getElementById('pauseIndicator');
const stopBtn = document.getElementById('stopBtn');
const restartBtn = document.getElementById('restartBtn');
const progressBar = document.getElementById('progressBar');
const progressSlider = document.getElementById('progressSlider');
const speedSlider = document.getElementById('speedSlider');
const speedValue = document.getElementById('speedValue');
const speedUp = document.getElementById('speedUp');
const speedDown = document.getElementById('speedDown');
const volumeSlider = document.getElementById('volumeSlider');
const volumeValue = document.getElementById('volumeValue');
const trackName = document.getElementById('trackName');
const trackTime = document.getElementById('trackTime');
let isPlaying = false;
// Initialize audio when loaded
audioPlayer.addEventListener('loadedmetadata', function() {
updateTimeDisplay();
});
// Play/Pause Button
playPauseBtn.addEventListener('click', function() {
if (isPlaying) {
audioPlayer.pause();
} else {
audioPlayer.play().catch(error => {
showCustomAlert('خطأ في تشغيل الملف الصوتي. تأكد من صحة رابط الملف.');
console.error('Audio play error:', error);
});
}
});
// Audio Events
audioPlayer.addEventListener('play', function() {
isPlaying = true;
playBtnIcon.classList.add('hidden');
pauseBtnIcon.classList.remove('hidden');
playIndicator.classList.add('hidden');
pauseIndicator.classList.remove('hidden');
});
audioPlayer.addEventListener('pause', function() {
isPlaying = false;
playBtnIcon.classList.remove('hidden');
pauseBtnIcon.classList.add('hidden');
playIndicator.classList.remove('hidden');
pauseIndicator.classList.add('hidden');
});
audioPlayer.addEventListener('ended', function() {
isPlaying = false;
playBtnIcon.classList.remove('hidden');
pauseBtnIcon.classList.add('hidden');
playIndicator.classList.remove('hidden');
pauseIndicator.classList.add('hidden');
progressBar.style.width = '0%';
progressSlider.value = 0;
});
audioPlayer.addEventListener('error', function(e) {
showCustomAlert('خطأ في تحميل الملف الصوتي. تأكد من صحة رابط الملف في الكود.');
console.error('Audio error:', e);
});
// Stop Button
stopBtn.addEventListener('click', function() {
audioPlayer.pause();
audioPlayer.currentTime = 0;
progressBar.style.width = '0%';
progressSlider.value = 0;
});
// Restart Button
restartBtn.addEventListener('click', function() {
audioPlayer.currentTime = 0;
if (isPlaying) {
audioPlayer.play();
}
});
// Progress Updates
audioPlayer.addEventListener('timeupdate', function() {
if (audioPlayer.duration) {
const progress = (audioPlayer.currentTime / audioPlayer.duration) * 100;
progressBar.style.width = progress + '%';
progressSlider.value = progress;
updateTimeDisplay();
}
});
// Progress Slider
progressSlider.addEventListener('input', function() {
if (audioPlayer.duration) {
const time = (this.value / 100) * audioPlayer.duration;
audioPlayer.currentTime = time;
}
});
// Speed Control
speedSlider.addEventListener('input', function() {
const speed = parseFloat(this.value);
audioPlayer.playbackRate = speed;
speedValue.textContent = speed.toFixed(1) + 'x';
});
speedUp.addEventListener('click', function() {
let currentSpeed = parseFloat(speedSlider.value);
if (currentSpeed < 3) {
currentSpeed += 0.1;
speedSlider.value = currentSpeed.toFixed(1);
audioPlayer.playbackRate = currentSpeed;
speedValue.textContent = currentSpeed.toFixed(1) + 'x';
}
});
speedDown.addEventListener('click', function() {
let currentSpeed = parseFloat(speedSlider.value);
if (currentSpeed > 0.5) {
currentSpeed -= 0.1;
speedSlider.value = currentSpeed.toFixed(1);
audioPlayer.playbackRate = currentSpeed;
speedValue.textContent = currentSpeed.toFixed(1) + 'x';
}
});
// Volume Control
volumeSlider.addEventListener('input', function() {
const volume = this.value / 100;
audioPlayer.volume = volume;
volumeValue.textContent = this.value + '%';
});
// Time Display Update
function updateTimeDisplay() {
const current = formatTime(audioPlayer.currentTime || 0);
const duration = formatTime(audioPlayer.duration || 0);
trackTime.textContent = `${current} / ${duration}`;
}
// Format Time Helper
function formatTime(seconds) {
const minutes = Math.floor(seconds / 60);
const remainingSeconds = Math.floor(seconds % 60);
return `${minutes.toString().padStart(2, '0')}:${remainingSeconds.toString().padStart(2, '0')}`;
}
// Custom Alert Function
function showCustomAlert(message) {
const modal = document.createElement('div');
modal.className = 'fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50';
modal.innerHTML = `
<div class="bg-white dark:bg-gray-800 p-6 rounded-lg shadow-lg max-w-sm w-full mx-4 border-2 border-islamic-gold">
<p class="text-gray-700 dark:text-gray-300 mb-4 text-center text-base">${message}</p>
<div class="flex justify-center">
<button class="px-6 py-2 bg-islamic-gold text-white hover:bg-islamic-dark-gold rounded-lg transition-colors font-bold" onclick="this.closest('.fixed').remove()">حسناً</button>
</div>
</div>
`;
document.body.appendChild(modal);
}
// Initialize
updateTimeDisplay();
</script>
</body>
</html>
التعليقات