Giter Club home page Giter Club logo

progress-indicator's Introduction

Progress-indicator

This is a progress indicator I use in almost every vue/nuxt project of mine.

Prerequisites:

  • This repo is only useful for vue/nuxt projects. I just wrote above are u blind
  • Install NProgress using npm i nprogress.

Issues:

If you have any issues, don't bombard my dms on discord, I'm not using it.

Just create a new issue right here like a gentleman.

Vue:

Copy the contents from progress.js to your main.js, you'll probably want to remove the import Vue from 'vue'; line, and improvise a lil' bit. If you can't improvise, you should be doing basics.

Put the nprogress.css and loadIndicator.css in the public css directory and link them to index.html.

Nuxt:

  1. Copy the progress.js to your plugins folder.
  2. Copy the nprogress.css and loadIndicator.css to your static folder.
  3. In your nuxt.config.js file, add this Ofc not the export default {} that was just for reference
export default {
    head: {
        link: [
            { rel: 'stylesheet', type: 'text/css', href: '/nprogress.css' },
            { rel: 'stylesheet', type: 'text/css', href: '/loadIndicator.css' }
        ]
    },

    plugins: [
        {src: "~/plugins/progress.js"}
    ]
}

Usage:

// Start a minimal progress bar to indicate something is happening
this.$load.start()
// or
this.$load.start('load')

// Start a full window load with a special loading indicator in the center of the page
// Note that this is to be used when your app is rendering the UI and the UI looks a bit broken while it happens
// This can be used as an overlay to hide the broken UI while its loading
this.$load.start('page')

// Ends the loading indicator
// Cus obv since you started it, so you need to end the indicator when whatever was loading has been loaded.
this.$load.done()

Note:

You don't necessarily have to use the loading indicator I added, I used it because I liked it the most, there are more indicators available at this website, you can modify the code to adapt to whichever indicator you liked the most, only if you know what you're doing. Don't shout at me in issues section if you break your code.

progress-indicator's People

Contributors

silentjungle399 avatar ctk-warrior avatar

Stargazers

Herr Erde avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.