Skip to content

HTML carousel using scss/css and vanilla javascript (no Bootstrap)

License

Notifications You must be signed in to change notification settings

AndrewJBateman/html-scss-carousel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ HTML SCSS Carousel

  • HTML, CSS and vanilla JS used to create a carousel of images.
  • Note: to open web links in a new window use: ctrl+click on link

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • SCSS used to make styles code better structured and easier to follow.
  • User can click on forward or back buttons to change image on screen, otherwise images will scroll automatically every 4.5 seconds (adjustable)

📷 Screenshots

Example screenshot.

📶 Technologies

💾 Setup

💻 Code Examples

  • js/script.js extract to listen for user click on forward or back carousel buttons. A value of 1 or -1 is then passed to the moveSlide function that will move the carousel and highlight the next/previous dot on screen.
buttons.forEach((button) => {
  button.addEventListener("click", () => {
    const offset = button.dataset.carouselBtn === "next" ? 1 : -1;
    moveSlide(offset);
  });
});

🆒 Features

  • Vanilla javascript used, so no Bootstrap JS download required that slows down initial render speed.

📋 Status & To-Do List

  • Status: Working.
  • To-Do: Use BEM CSS formatting, use images from CDN that are auto-scaled and compressed, bottom right text to be a box with title, para text and a call-to-action button.

👏 Inspiration

📁 License

  • This project is licensed under the MIT License - see the LICENSE file for details.

✉️ Contact

  • Repo created by ABateman, email: gomezbateman@yahoo.com

About

HTML carousel using scss/css and vanilla javascript (no Bootstrap)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published