GithubHelp home page GithubHelp logo

achaak / circle-bar Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 37 KB

This is a module to simply add a circle bar to your site.

CSS 3.89% JavaScript 84.11% HTML 12.00%
js js-component component circle-bars progress-bar

circle-bar's Introduction

circle-bar

This is a module to simply add a circle bar to your site.

circle bar preview

Requirement :

  • JQuery

Install :

Load the required files. Inside the page's head tag include the circle bar's CSS file.

<link rel="stylesheet" href="/your-path/circle-bar.css">

And in the page's footer, include the required javascript files.

<script src="/your-path/circle-bar.js"></script>

Initialize :

For initialize the circle bar, insert this example snippet and update this with your parameters. Exemple:

$(document).ready(function() {
    circleBar().init(
        "#circle-bar", 
        {
            text: "Insert your text",
            lineColor: "#1d8eff",
            lineBgColor: "rgb(150, 203, 255)",
            backgroundColor: "white",
            lineWidth: "15",
            lineWidthHover: "7",
            bgLineWidth: "10",
            bgLineWidthHover: "4",
            lineDuration: "200ms",
            lineDelay: "100ms",
            diameter: "300",
            viewPourcentage: true,
            textCSS: {
                "color": "#a0a0a0",
                "font-weight": "bold",
                "font-family": "Verdana, Arial, Helvetica, sans-serif",
                "font-size": "1rem"
            },
            textHoverCSS: {
                "font-size": "1.5rem",
                "color": "#1d8eff"
            },
            pourcentageCSS: {
                "color": "#a0a0a0",
                "font-weight": "bold",
                "font-family": "Verdana, Arial, Helvetica, sans-serif",
                "text-transform": "uppercase",
                "font-size": "1rem"
            },
            pourcentageHoverCSS: {
                "font-size": "1.5rem",
                "color": "#1d8eff"
            }
        },
        50
    );
});

Options :

text: [string],
lineColor: <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>,
lineBgColor: <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>,
backgroundColor: <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>,
lineWidth: [number],
lineWidthHover: [number],
bgLineWidth: [number],
bgLineWidthHover: [number],
lineDuration: [duration],
lineDelay: [duration],
diameter: [number],
viewPourcentage: [boolean],
textCSS: {
/*
    Example :
    "color": "#a0a0a0",
    "font-weight": "bold",
    "font-family": "Verdana, Arial, Helvetica, sans-serif",
    "font-size": "1rem"
*/
},
textHoverCSS: {
/*
    Example :
    "font-size": "1.5rem",
    "color": "#1d8eff"
*/
},
pourcentageCSS: {
/*
    Example :
    "color": "#a0a0a0",
    "font-weight": "bold",
    "font-family": "Verdana, Arial, Helvetica, sans-serif",
    "text-transform": "uppercase",
    "font-size": "1rem"
*/
},
pourcentageHoverCSS: {
/*
    Example :
    "font-size": "1.5rem",
    "color": "#1d8eff"
*/
}

Fonctions :

circleBar().init

/**
 * Used to create the circle bar
 *
 * @param {string} _elem Class or id of the slider
 * @param {Array} _opts List of options
 * @param {number} _value Value of the circle bar
 */
circleBar.createCircleBar(elem, opts, value);

circleBar().getValue

/**
 * Used to get the value of the circle bar
 */
circleBar.getValue();

circleBar().getOpts

/**
 * Used to get the options of the circle bar
 */
circleBar.getOpts();

circleBar().setText

/**
 * Used to set text
 *
 * @param {string} _text Text to insert
 */
circleBar.setText(text);

circleBar().setValue

/**
 * Used to set a value
 *
 * @param {number} _val Value of the circle bar
 */
circleBar.setValue(value);

circleBar().setLineColor

/**
 * Used to set the color of the line of the circle bar
 * 
 * @param {string} _lineColor <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>
 */
circleBar.setLineColor(lineColor);

circleBar().setLineBgColor

/**
 * Used to set the background color of the line of the circle bar
 *
 * @param {string} _lineBgColor <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>
 */
circleBar.setLineBgColor(lineBgColor);

circleBar().setBgColor

/**
 * Used to set the background color of the circle bar
 *
 * @param {string} _bgColor <rgb()> | <rgba()> | <hsl()> | <hsla()> | <hex-color> | <named-color> | currentcolor | <deprecated-system-color>
 */
circleBar.setBgColor(bgColor);

circleBar().setLineWidth

/**
 * Used to set the line width
 *
 * @param {number} _lineWidth Width of the line
 */
circleBar.setLineWidth(lineWidth);

circleBar().setBgLineWidth

/**
 * Used to set the background line width
 *
 * @param {number} _bgLineWidth Width of the background line
 */
circleBar.setBgLineWidth(bgLineWidth);

circleBar().setLineDuration

/**
 * Used to set the line duration of the circle bar transition
 *
 * @param {string} _lineDuration Duration of the transition
 */
circleBar.setLineDuration(lineDuration);

circleBar().setLineDelay

/**
 * Used to set the line delay of the circle bar transition
 *
 * @param {string} _lineDelay Delay of the transition
 */
circleBar.setLineDelay(lineDelay);

circleBar().setLineWidthHover

/**
 * Used to set the line hover width
 *
 * @param {number} _lineWidthHover Width of the line hover
 */
circleBar.setLineWidthHover(lineWidthHover);

circleBar().setbgLineWidthHover

/**
 * Used to set the background line hover width
 *
 * @param {number} _bgLineWidthHover Width of the background line hover
 */
circleBar.setbgLineWidthHover(bgLineWidthHover);

circleBar().setLineTransitionHover

/**
 * Used to set the line transition hover of the circle bar transition
 *
 * @param {string} _lineTransitionHover Duration of the transition
 */
circleBar.setLineTransitionHover(lineTransitionHover);

circleBar().viewPourcentage

/**
 * Used to view the pourcentage of the circle bar
 *
 * @param {boolean} _bool True for view pourcentage if not false
 */
circleBar.viewPourcentage(bool);

circleBar().setTextCSS

/**
 * Used to set the CSS of the text
 *
 * @param {Array} _css Array of CSS
 */
circleBar.setTextCSS(css);

circleBar().setTextHoverCSS

/**
 * Used to set the hover CSS of the text
 *
 * @param {Array} _css Array of CSS
 */
circleBar.setTextHoverCSS(css);

circleBar().setPourcentageCSS

/**
 * Used to set the CSS of the pourcentage
 *
 * @param {Array} _css Array of CSS
 */
circleBar.setPourcentageCSS(css);

circleBar().setPourcentageHoverCSS

/**
 * Used to set the hover CSS of the pourcentage
 *
 * @param {Array} _css Array of CSS
 */
circleBar.setPourcentageHoverCSS(css);

circle-bar's People

Contributors

achaak avatar

Stargazers

 avatar

Watchers

 avatar  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.