Giter VIP home page Giter VIP logo

ccrouter's Introduction

CCRouter

"A Front-End Router for Web Developers"

CCRouter is a Mini-framework for Front-end developers to create responsive and asynchronous user interfaces. This routing framework is base upon hashes and is currently working on most of the modern web browsers.

Features of CCRouter

  • Customizable colors
  • Built-in animated Google-like progress bar on top

Getting Started

  1. Bower
bower install ccrouter

How it's working

  1. First download the project via bower or just download the release Zip file.
  2. Link the dist/ccrouter.js and dist/ccrouter.css files to your HTML file like this,
<link rel="stylesheet" href="dist/ccrouter.css">
<script type="text/javascript" src="dist/ccrouter.js"></script>
  1. Create a display element (an element which displays the pages usually a div) Initialize CCRouter Framework through JavaScript.
<script type="text/javascript">
    $(document).ready(function() 
    {
        var router = ccrouter();  // Create a new router from ccrouter

        router.initialize("Routes/", "html", {
            color:  "dodgerblue",
            display: "#display",
            height: "2",
            initial: "index"
        }); 
        // Map the change of hashes to the router
        router.listen(); // Listen for the incoming hashchanges
    });
</script>

Initialize Function Arguments

Order Argument Description Default Example
1st Directory or URL where all routes / sub-URLS exist null routes, tabs
2nd Extension of the files / web pages null html, php
3rd Properties for the initialization null ...
4th A Preprocessor function that gets a string input and returns a string output null ...
5th A callback function (that has a route name input) that is called after a route is loaded null ...

Properties

Property Description Default Example
color Color of the loading bar blue dodgerblue, red, orangered
display Query selector for the display object that renders the page asynchronously null #display, .page-render #page
height Height of the page loader progressbar 2 2, 4, 5
initial Initial route loaded when the page is loaded for the first time null index, home, initial

ccrouter's People

Contributors

chamuth avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

fayazali123

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.