update banner

This commit is contained in:
Flatlogic Bot 2026-01-24 16:49:24 +00:00
parent f2b8772836
commit 20bcc52b21
3 changed files with 45 additions and 94 deletions

View File

@ -7,7 +7,7 @@
{% if banners %} {% if banners %}
<!-- Carousel Section --> <!-- Carousel Section -->
<section class="banner-carousel mb-4 mt-n1"> <section class="banner-carousel mb-4 mt-n1">
<div id="mainBannerCarousel" class="carousel slide" data-bs-ride="carousel" data-bs-interval="{% if CURRENT_LANG == 'ar' %}12000{% else %}8000{% endif %}" data-bs-pause="hover"> <div id="mainBannerCarousel" class="carousel slide" data-bs-pause="hover">
<div class="carousel-indicators"> <div class="carousel-indicators">
{% for banner in banners %} {% for banner in banners %}
<button type="button" data-bs-target="#mainBannerCarousel" data-bs-slide-to="{{ forloop.counter0 }}" {% if forloop.first %}class="active" aria-current="true"{% endif %} aria-label="Slide {{ forloop.counter }}"></button> <button type="button" data-bs-target="#mainBannerCarousel" data-bs-slide-to="{{ forloop.counter0 }}" {% if forloop.first %}class="active" aria-current="true"{% endif %} aria-label="Slide {{ forloop.counter }}"></button>
@ -51,19 +51,24 @@
</section> </section>
<script> <script>
// Explicitly re-initialize to ensure custom interval is respected document.addEventListener('DOMContentLoaded', function() {
document.addEventListener('DOMContentLoaded', function() { var myCarouselElement = document.querySelector('#mainBannerCarousel');
var myCarousel = document.querySelector('#mainBannerCarousel'); if (myCarouselElement) {
if (myCarousel) { // Set higher interval for Arabic to allow more reading time
var interval = {% if CURRENT_LANG == 'ar' %}12000{% else %}8000{% endif %}; var interval = {% if CURRENT_LANG == 'ar' %}15000{% else %}10000{% endif %};
var carousel = new bootstrap.Carousel(myCarousel, {
interval: interval, var carousel = new bootstrap.Carousel(myCarouselElement, {
ride: 'carousel', interval: interval,
pause: 'hover' wrap: true,
}); pause: 'hover'
console.log("Carousel initialized with interval:", interval); });
}
}); // Manually trigger the cycle to ensure it starts even if ride was false
carousel.cycle();
console.log('Carousel initialized with interval:', interval);
}
});
</script> </script>
{% endif %} {% endif %}

View File

@ -18,11 +18,6 @@ body {
overflow-x: hidden; overflow-x: hidden;
} }
[lang="ar"] body {
direction: rtl;
text-align: right;
}
.navbar { .navbar {
background-color: var(--white); background-color: var(--white);
box-shadow: 0 2px 10px rgba(0,0,0,0.1); box-shadow: 0 2px 10px rgba(0,0,0,0.1);
@ -85,37 +80,25 @@ body {
margin-bottom: 40px; margin-bottom: 40px;
} }
.role-card { /* Carousel Adjustments */
background: var(--white); .carousel-item {
padding: 40px; transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
border-radius: 20px;
box-shadow: 0 10px 30px rgba(0,0,0,0.05);
transition: all 0.3s ease;
border: 1px solid transparent;
height: 100%;
cursor: pointer;
} }
.role-card:hover { .carousel-item.active {
border-color: var(--secondary-color); display: block !important;
transform: translateY(-10px); opacity: 1 !important;
} }
.role-icon { /* Ensure captions are visible in RTL */
font-size: 3rem; [dir="rtl"] .carousel-caption {
color: var(--secondary-color); right: 5% !important;
margin-bottom: 20px; left: auto !important;
text-align: right !important;
} }
.role-title { .carousel-caption {
font-size: 1.5rem; z-index: 10;
font-weight: 700;
color: var(--primary-color);
}
.role-desc {
color: var(--text-muted);
margin-bottom: 25px;
} }
footer { footer {
@ -123,13 +106,3 @@ footer {
color: var(--white); color: var(--white);
padding: 50px 0; padding: 50px 0;
} }
/* RTL Adjustments */
[lang="ar"] .ms-auto {
margin-right: auto !important;
margin-left: 0 !important;
}
/* Carousel transition speed */
.carousel-item {
transition: transform 1.5s ease-in-out !important;
}

View File

@ -18,11 +18,6 @@ body {
overflow-x: hidden; overflow-x: hidden;
} }
[lang="ar"] body {
direction: rtl;
text-align: right;
}
.navbar { .navbar {
background-color: var(--white); background-color: var(--white);
box-shadow: 0 2px 10px rgba(0,0,0,0.1); box-shadow: 0 2px 10px rgba(0,0,0,0.1);
@ -85,37 +80,25 @@ body {
margin-bottom: 40px; margin-bottom: 40px;
} }
.role-card { /* Carousel Adjustments */
background: var(--white); .carousel-item {
padding: 40px; transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
border-radius: 20px;
box-shadow: 0 10px 30px rgba(0,0,0,0.05);
transition: all 0.3s ease;
border: 1px solid transparent;
height: 100%;
cursor: pointer;
} }
.role-card:hover { .carousel-item.active {
border-color: var(--secondary-color); display: block !important;
transform: translateY(-10px); opacity: 1 !important;
} }
.role-icon { /* Ensure captions are visible in RTL */
font-size: 3rem; [dir="rtl"] .carousel-caption {
color: var(--secondary-color); right: 5% !important;
margin-bottom: 20px; left: auto !important;
text-align: right !important;
} }
.role-title { .carousel-caption {
font-size: 1.5rem; z-index: 10;
font-weight: 700;
color: var(--primary-color);
}
.role-desc {
color: var(--text-muted);
margin-bottom: 25px;
} }
footer { footer {
@ -123,13 +106,3 @@ footer {
color: var(--white); color: var(--white);
padding: 50px 0; padding: 50px 0;
} }
/* RTL Adjustments */
[lang="ar"] .ms-auto {
margin-right: auto !important;
margin-left: 0 !important;
}
/* Carousel transition speed */
.carousel-item {
transition: transform 1.5s ease-in-out !important;
}