diff --git a/js/media-slider-lazy-load.js b/js/media-slider-lazy-load.js
deleted file mode 100644
index f97b726..0000000
--- a/js/media-slider-lazy-load.js
+++ /dev/null
@@ -1,283 +0,0 @@
-/**
- * @name MediaSlider
- * @version 1.1.0
- * @author @RealTime
- * @description A lazy-loading media slider component supporting multiple media types with URL lazy loading
- */
-
-class MediaSlider {
- constructor(containerId, mediaUrls) {
- this.containerId = containerId;
- this.mediaUrls = Array.isArray(mediaUrls) ? mediaUrls : []; // Ensure mediaUrls is an array
- this.loadedMedia = new Set(); // Track which media URLs have been loaded
- this.init();
- }
-
- init() {
- this.injectStyles();
- this.createSlider();
- this.initializeSwiper();
- }
-
- injectStyles() {
- const styles = `
-
-
- `;
- document.head.insertAdjacentHTML('beforeend', styles);
- }
-
- detectMediaType(url) {
- const extension = url.split('.').pop().toLowerCase();
- const mediaTypes = {
- 'jpg': 'image',
- 'jpeg': 'image',
- 'png': 'image',
- 'gif': 'image',
- 'webp': 'image',
- 'avif': 'image',
- 'mp3': 'audio',
- 'm4a': 'audio',
- 'wav': 'audio',
- 'ogg': 'audio',
- 'mp4': 'video',
- 'webm': 'video',
- 'ogv': 'video',
- 'pdf': 'pdf',
- 'docx': 'office',
- 'xlsx': 'office',
- 'pptx': 'office'
- };
- return mediaTypes[extension] || 'unknown';
- }
-
- createPlaceholder(url) {
- return `
-
- Loading ${this.detectMediaType(url)} media...
-
- `;
- }
-
- createMediaElement(url) {
- const mediaType = this.detectMediaType(url);
- switch(mediaType) {
- case 'image':
- return ``;
- case 'audio':
- return ``;
- case 'video':
- return ``;
- case 'pdf':
- return ``;
- case 'office':
- return ``;
- default:
- return `Unsupported media type
`;
- }
- }
-
- createSlider() {
- if (this.mediaUrls.length === 0) {
- document.getElementById(this.containerId).innerHTML = 'No media available
';
- return; // Exit if there are no media URLs
- }
-
- const sliderHtml = `
-
-
- ${this.mediaUrls.map(url => `
-
- ${this.createPlaceholder(url)}
-
- `).join('')}
-
-
-
-
- `;
- document.getElementById(this.containerId).innerHTML = sliderHtml;
- }
-
- initializeSwiper() {
- const script = document.createElement('script');
- script.src = 'https://cdn.jsdelivr.net/npm/swiper@10/swiper-bundle.min.js';
- script.onload = () => {
- const swiper = new Swiper('.swiper', {
- loop: true,
- autoplay: false,
- navigation: {
- nextEl: '.swiper-button-next',
- prevEl: '.swiper-button-prev',
- },
- effect: 'fade',
- fadeEffect: {
- crossFade: true
- },
- speed: 900,
- preloadImages: true,
- watchSlidesProgress: true,
- on: {
- slideChangeTransitionStart: (swiper) => {
- this.lazyLoadMedia(swiper.slides[swiper.activeIndex]);
- }
- }
- });
-
- // Load first slide's media initially
- this.lazyLoadMedia(swiper.slides[swiper.activeIndex]);
- };
- document.body.appendChild(script);
- }
-
- lazyLoadMedia(slideElement) {
- const lazyElements = slideElement.querySelectorAll('.lazy-load');
-
- lazyElements.forEach(el => {
- const url = el.getAttribute('data-src');
-
- // Skip if already loaded
- if (this.loadedMedia.has(url)) {
- this.replaceWithLoadedMedia(el, url);
- return;
- }
-
- // Create the appropriate media element
- const mediaType = this.detectMediaType(url);
- let newElement;
-
- switch(mediaType) {
- case 'image':
- newElement = document.createElement('img');
- newElement.src = url;
- newElement.alt = 'Slide';
- break;
- case 'audio':
- newElement = document.createElement('audio');
- newElement.innerHTML = `