SnapSlide is a lightweight, responsive image gallery/slider built with vanilla JavaScript and styled with Tailwind CSS. It features automatic slide transitions, navigation controls, and a clean, modern design.
- Responsive Design: Works on all devices and screen sizes
- Automatic Transitions: Slides change automatically with configurable timing
- Navigation Controls: Previous/Next buttons and indicator dots
- Play/Pause Control: Toggle automatic transitions
- Fullscreen Mode: View the gallery in fullscreen
- Touch Support: Swipe gestures for mobile devices
- Keyboard Navigation: Use arrow keys to navigate slides
- Customizable: Easy to modify and extend
You can view a live demo of SnapSlide here (Replace with your deployed URL after uploading to GitHub Pages).
-
Clone the repository:
git clone https://github.com/yourusername/snapslide.git
-
Open
index.htmlin your browser to view the gallery. -
To customize the images, edit the
slidesarray inscript.js:const slides = [ { url: 'your-image-url.jpg', alt: 'Image description', title: 'Image Title' }, // Add more slides as needed ];
-
To change the transition speed, modify the
autoplaySpeedvariable inscript.js:const autoplaySpeed = 3000; // milliseconds between slides
- HTML5
- CSS3
- JavaScript (ES6+)
- Tailwind CSS - Utility-first CSS framework
- Font Awesome - Icons
The project uses Tailwind CSS for styling. You can modify colors by changing the color classes in index.html:
- Primary color: Replace
blue-600andblue-500classes - Secondary color: Replace
green-500andgreen-600classes - Background: Replace
bg-gray-100class
To change the slider height, modify the .slider-container style in the <style> section of index.html:
.slider-container {
position: relative;
height: 400px; /* Change this value */
overflow: hidden;
}SnapSlide works in all modern browsers:
- Chrome
- Firefox
- Safari
- Edge
- Opera
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
To upload this project to GitHub:
-
Create a new repository on GitHub
-
Initialize git in your local project folder:
git init
-
Add all files to git:
git add . -
Commit your changes:
git commit -m "Initial commit" -
Add your GitHub repository as remote:
git remote add origin https://github.com/yourusername/snapslide.git
-
Push to GitHub:
git push -u origin main
-
Optional: Enable GitHub Pages in your repository settings to deploy the site.
- Sample images from Unsplash
- Icons from Font Awesome
- Built with Tailwind CSS
