0.3.1 • Published 10 years ago

simple-nav v0.3.1

Weekly downloads
6
License
ISC
Repository
github
Last release
10 years ago

simple-nav

Javascript

with NPM

SimpleNav = require('simple-nav')

myNavigation = new SimpleNav({
  // defaults
  scrolledClass: 'scrolled'
  expandedClass: 'open'
  scrollTolerance: 120
  gotoSpeed: 10

  gotoAnchorTimer: 500
  handleScrollTimer: 300
  toggleMenuTimer: 300
});

Scss

$small: "only screen and (min-width: 40.063em)";

nav.primary-navigation {
  > h1 {
    @include inline-block;
  }

  > .menu {
    @include inline-icon('menu');
    display: block;
    position: absolute;
    right: 10px;
    top: 10px;

    span { display: none; }
  }

  > ul.nav-links {
    display: none;
    float: right;

    li {
      @include inline-block;
      margin-right: rem-calc(10px);
      margin-top: rem-calc(12px);
    }
  }

  .button {
    @include inline-block;
    margin-bottom: 0;
    margin-top: rem-calc(-2px);
    padding: rem-calc(4px 6px);
  }

  @media #{$small} {
    > .menu { display: none; }

    > ul.nav-links {
      display: block;
    }
  }

  // When the body tag has the open class applied
  body.open & {
    > ul.nav-links { display: block; }
  }
}

Markup

%nav.primary-navigation
  - # Title & Menu Icon
  %h1 Title
  %a.menu(href="#") <span>Menu</span>

  - # Nav links
  %ul.nav-links
    %li
      %a(href="some-link") Some Link
    %li
      %a(href="some-other-link") Some Other Link
    %li
      %a.button(href="AWESOME") AWESOME
0.3.1

10 years ago

0.3.0

10 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago