Skip to content

Commit 5357609

Browse files
committed
Navbar.js V3.0
.. details at #9
1 parent 41c74e2 commit 5357609

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4344
-1529
lines changed

.npmignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1+
node_modules/
12
demo/
2-
dist/
3-
bower.json
4-
index.html
3+
Navbar Artwork/
4+
package-lock.json

LESS/bootstrap.less

Lines changed: 0 additions & 19 deletions
This file was deleted.

LESS/navbar.less

Lines changed: 0 additions & 191 deletions
This file was deleted.

LESS/variables.less

Lines changed: 0 additions & 42 deletions
This file was deleted.

README.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
1-
# Navbar - minimal navigation script
2-
This is a script that most web developers need for a quick site navigation, built with Native Javascript and supported on all major browsers as well as legacy browsers starting with IE8.
1+
# Navbar.js - Modern Navigation Component
2+
The mobile first menu navigation for today's modern web, developed with native JavaScript and packed with lots of features.
33

44
[![NPM Version](https://img.shields.io/npm/v/navbar.js.svg?style=flat-square)](https://www.npmjs.com/package/navbar.js)
55
[![NPM Downloads](https://img.shields.io/npm/dm/navbar.js.svg?style=flat-square)](http://npm-stat.com/charts.html?package=navbar.js)
66
[![jsDeliver](https://data.jsdelivr.com/v1/package/npm/navbar.js/badge)](https://www.jsdelivr.com/package/npm/navbar.js)
77

8+
[![NAVBAR Preview](./demo/assets/img/navbar.png)](./demo/assets/img/navbar.png)
9+
810
# Demo
911
Download the package and check the demo folder, or check it online [here](http://thednp.github.io/navbar.js/).
1012

11-
12-
# Features
13-
* opens submenus on mouseenter, by adding `open` and `open-position` classes to the menu item, in rapid succession</li>
14-
* hides submenus on mouseleave, by removing the above classes in a delayed succesion</li>
15-
* super light script, `1.2k` in size when minified
16-
* responsive design ready
17-
* super light and easy to customize CSS
13+
# Navbar.js Highlights
14+
* Mobile First Design
15+
* ES6/ES7 sources and powerful build tools
16+
* SCSS sources with powerful mixins and advanced inheritance and automation functionality
17+
* very light footprint, `3kb` in size when minified
1818
* 3 sets of positions top (main), left or right
19-
* animations are based on position
20-
* LESS/SCSS sources ready
19+
* provides a set of options for JavaScript initialization
2120
* DATA API allows you to automatically initiate without JS invocation
22-
* cross-browser supported
21+
* modern browser supported and semi-modern alike with a special polyfill for IE10+ provided
2322

24-
# NPM/Bower
25-
You can install this through NPM or bower respectively:
23+
# How It Works
24+
* opens submenus on `mouseenter`, by adding `open` and `open-position` classes to the menu item, in rapid succession</li>
25+
* hides submenus on `mouseleave`, by removing the above classes in a delayed succesion</li>
26+
* on mobile devices it makes use of the `open-mobile` class to toggle submenus and a `click` handler associated</li>
27+
28+
# NPM
29+
You can install this through NPM:
2630

2731
```
2832
$ npm install navbar.js
29-
# or
30-
$ bower install navbar.js
3133
```
3234

3335
# Browser Usage
@@ -37,7 +39,7 @@ Link the required CSS in your document `<head>` tag
3739
<link href="../assets/css/navbar.css" rel="stylesheet">
3840
```
3941

40-
Link the required JS in your document `<body>` tag
42+
Link the required JS in your document `<body>` tag, though it should work in the `<head>` as well
4143
```html
4244
<script src="../assets/js/navbar.js"></script>
4345
```
@@ -56,8 +58,8 @@ To use the DATA-API, you need to provide the `data-function="navbar"` attribute
5658
<li><a href="#">Another Link Title</a></li>
5759
</ul>
5860
```
61+
Other initialization options apply, explained in the demo.
5962

60-
Legacy browsers need `classList` polyfill, so give them <a href="https://github.com/thednp/minifill">minifill</a>.
6163

6264
# Node
6365
On node.js environments
@@ -72,9 +74,19 @@ var myMenu = new Navbar('selector');
7274
# Build Tools
7375
You have 3 build tools for building custom builds
7476

75-
* `$ npm run min-js` - to minify the **navbar.js**
76-
* `$ npm run build-less` - to compile and minify the **navbar.less**
77-
* `$ npm run build-scss` - to compile and minify the **navbar.scss**
77+
* `$ npm run build` - to compile and minify the ES6/ES7 source **navbar.js** and **navbar.min.js**
78+
* `$ npm run compile` - to compile and minify the **navbar.less** and other demo related sources
79+
* `$ npm run bundle` - to execute both the above in paralel
80+
81+
# Custom CSS Builds
82+
You can create your own custom styling, here's a quickie:
83+
* create a new file for instance `src/scss/my-navbar.scss`,
84+
* include the mixins and variables' values you need (check out the demos for more)
85+
* run the below script
86+
87+
```
88+
node compile.js INPUTFILE:src/scss/my-navbar.scss OUTPUTFILE:path-to/src/css/my-navbar.min.css MIN:true
89+
```
7890

7991
# License
8092
[MIT License](https://github.com/thednp/navbar.js/blob/master/LICENSE)

SCSS/bootstrap.scss

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)