اعثر على كل ما تريد
اعثر على كل ما تريد
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
:root {
--main-orange: #ff6600; /* اللون البرتقالي من اللوجو */
--dark-bg: #0a0a0c; /* اللون الداكن للخلفية */
}
body {
margin: 0;
background-color: var(--dark-bg);
font-family: sans-serif;
}
/* حاوية السلايدر */
.slider-container {
position: relative;
max-width: 100%;
height: 400px;
margin: auto;
overflow: hidden;
border-bottom: 3px solid var(--main-orange);
}
.slides {
display: none;
height: 100%;
position: relative;
}
.slides img {
width: 100%;
height: 100%;
object-fit: cover; /* لضمان ملء الصورة للمساحة بشكل جميل */
}
/* النص فوق الصورة */
.caption {
position: absolute;
bottom: 20%;
right: 5%;
color: white;
text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
}
/* زر "اشتر الآن" داخل السلايدر */
.btn-buy {
background-color: var(--main-orange);
color: white;
padding: 12px 30px;
border: none;
border-radius: 5px;
font-size: 1.2rem;
cursor: pointer;
font-weight: bold;
transition: 0.3s;
text-decoration: none;
display: inline-block;
margin-top: 15px;
}
.btn-buy:hover {
background-color: #e65c00;
transform: scale(1.05);
}
/* أسهم التنقل */
.prev, .next {
cursor: pointer;
position: absolute;
top: 50%;
width: auto;
padding: 16px;
color: white;
font-weight: bold;
font-size: 20px;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
user-select: none;
background-color: rgba(0,0,0,0.3);
}
.next {
left: 0;
border-radius: 3px 0 0 3px;
}
.prev {
right: 0;
}
.prev:hover, .next:hover {
background-color: var(--main-orange);
}
/* نقاط التنقل السفلى */
.dots-container {
text-align: center;
padding: 10px;
background: var(--dark-bg);
}
.dot {
cursor: pointer;
height: 12px;
width: 12px;
margin: 0 2px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
transition: background-color 0.6s ease;
}
.active, .dot:hover {
background-color: var(--main-orange);
}
/* تأثير التلاشي */
.fade {
animation-name: fade;
animation-duration: 1.5s;
}
@keyframes fade {
from {opacity: .4}
to {opacity: 1}
}
</style>
</head>
<body>
<div class="slider-container">
<div class="slides fade">
<img src="https://via.placeholder.com/1200x400/0a0a0c/ff6600?text=عرض+خاص" alt="العرض الأول">
<div class="caption">
<h1>أحدث المنتجات وصلت!</h1>
<a href="#" class="btn-buy">اشترِ الآن</a>
</div>
</div>
<div class="slides fade">
<img src="https://via.placeholder.com/1200x400/111/ff6600?text=تخفيضات+رمضان" alt="العرض الثاني">
<div class="caption">
<h1>تخفيضات تصل إلى 50%</h1>
<a href="#" class="btn-buy">تسوق الآن</a>
</div>
</div>
<a class="prev" onclick="plusSlides(1)">❯</a>
<a class="next" onclick="plusSlides(-1)">❮</a>
</div>
<div class="dots-container">
<span class="dot" onclick="currentSlide(1)"></span>
<span class="dot" onclick="currentSlide(2)"></span>
</div>
<script>
let slideIndex = 1;
showSlides(slideIndex);
function plusSlides(n) {
showSlides(slideIndex += n);
}
function currentSlide(n) {
showSlides(slideIndex = n);
}
function showSlides(n) {
let i;
let slides = document.getElementsByClassName("slides");
let dots = document.getElementsByClassName("dot");
if (n > slides.length) {slideIndex = 1}
if (n < 1) {slideIndex = slides.length}
for (i = 0; i < slides.length; i++) {
slides[i].style.display = "none";
}
for (i = 0; i < dots.length; i++) {
dots[i].className = dots[i].className.replace(" active", "");
}
slides[slideIndex-1].style.display = "block";
dots[slideIndex-1].className += " active";
}
// تحريك تلقائي كل 5 ثواني
setInterval(() => {
plusSlides(1);
}, 5000);
</script>
</body>
</html>