Skip to content

This project is a progress steps widget built using HTML5, CSS3, and JavaScript. The widget provides a visual representation of progress through a series of steps, allowing users to navigate between steps and track their progress.

License

Notifications You must be signed in to change notification settings

mohafezatkar/simple-progress-steps-widget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Simple Progress Steps Widget

Table of Contents
  1. About The Project
  2. Usage
  3. JavaScript Functionality
  4. Styling
  5. Conclusion
  6. License
  7. Contact

(back to top)

About

This project is a progress steps widget built using HTML5, CSS3, and JavaScript. The widget provides a visual representation of progress through a series of steps, allowing users to navigate between steps and track their progress.

Built With

  • HTML5
  • CSS3
  • JS

Usage

To use the progress steps widget, follow these steps:

  1. Include the required HTML markup in your web page:
<!DOCTYPE html>
<html lang="en">
<head>
    <link rel="stylesheet" href="css/styles.css">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div class="container">
        <div class="progress-container">
            <div class="progress" id="progress"></div>
                <div class="circle active">1</div>
                <div class="circle">2</div>
                <div class="circle">3</div>
                <div class="circle">4</div>
        </div>
        <button class="btn" id="#prev" type="button" disabled>Prev</button>
        <button class="btn" id="#next" type="button">Next</button>
    </div>
<script src="js/main.js"></script>
</body>
</html>
  1. Link the CSS stylesheets by adding the following line within the section of your HTML file:
<link rel="stylesheet" href="css/styles.css">
  1. Include the JavaScript code by adding the following line before the closing tag of your HTML file:
<script src="js/main.js"></script>
  1. Customize the number of steps by modifying the HTML markup. Add or remove

    elements as needed, and update the corresponding JavaScript code accordingly.

  2. Run the web page in a web browser to see the progress steps widget in action. You should be able to navigate between steps using the "Prev" and "Next" buttons.

(back to top)

JavaScript Functionality

The JavaScript code included in the project provides the functionality for the progress steps widget. It allows users to move forward or backward through the steps and updates the visual representation of the progress.

The key JavaScript functions used in this project are:

  • next: This function is called when the "Next" button is clicked. It increments the currentActive variable, ensuring it does not exceed the total number of steps. Then, it calls the update function to update the widget's appearance.

  • prev: This function is called when the "Prev" button is clicked. It decrements the currentActive variable, making sure it does not go below 1 (the first step). It then calls the update function to update the widget's appearance.

  • update: This function updates the widget's appearance based on the current step (currentActive). It enables or disables the "Prev" and "Next" buttons as necessary, adds the "active" class to the circles representing completed steps, and adjusts the width of the progress bar based on the progress made.

Please note that if you want to modify the behavior or add more functionality to the progress steps widget, you can do so by modifying the JavaScript code accordingly.

(back to top)

Styling

The CSS styles provided in the styles.css file control the visual appearance of the progress steps widget. You can customize these styles to match your desired design.

(back to top)

Conclusion

The progress steps widget is a simple and intuitive way to guide users through a series of steps. By using HTML5, CSS3, and JavaScript, this project provides an easy-to-implement solution for incorporating progress tracking into your web pages. Feel free to modify and expand upon this project to suit your specific needs.

(back to top)

License

Distributed under the MIT License.

(back to top)

Contact

Alireza Mohafezatkar - https://www.linkedin.com/in/alireza-mohafezatkar/ - [email protected]

Project Link: https://github.com/mohafezatkar/simple-progress-steps-widget

(back to top)

About

This project is a progress steps widget built using HTML5, CSS3, and JavaScript. The widget provides a visual representation of progress through a series of steps, allowing users to navigate between steps and track their progress.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published