• Stars
    star
    161
  • Rank 233,470 (Top 5 %)
  • Language
    CSS
  • Created over 9 years ago
  • Updated over 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A fly-out circle menu built with CSS.

CSS Circle Fly-Out Navigation

My circular fly-out CSS navigation menu component, built with CSS3. View the demo here.

Circle fly out menu

Usage

To use, include the CSS and JavaScript in your app. Markup your menu like this:

<nav class="c-circle-menu js-menu">
  <button class="c-circle-menu__toggle js-menu-toggle">
    <span>Toggle</span>
  </button>
  <ul class="c-circle-menu__items">
    <li class="c-circle-menu__item">
      <a href="#" class="c-circle-menu__link">
        <img src="path/to/icon" alt="">
      </a>
    </li>
    <!-- more items here -->
  </ul>
  <div class="c-circle-menu__mask js-menu-mask"></div>
</nav>

Then, include your script like this:

<script src="path/to/circleMenu.min.js"></script>

Finally, you can initialize the menu like this:

<script>
  var el = '.js-menu';
  var myMenu = cssCircleMenu(el);
</script>

The default number of menu items is 5. To use a different number of items, you'll have to configure and build with Sass and Gulp.

Out of the box usage

You can use this component out of the box by downloading the uncompressed or compressed files from the css/ directory.

Use as a Bower component

The component is available as a bower package, and you can import it by running the following command:

bower install css-circle-menu

Configuring and Building with Sass and Gulp

The component is built with Sass (SCSS) and uses a JavaScript module as well to handle events. Everything gets compiled and built with Gulp. To develop and compile from gulp, just run:

npm install
gulp

To watch files during development, run

gulp watch

Using the Gulp workflow is hugely beneficial, because it makes the component much easier to work with and customise. If you're not using Gulp to compile the Sass, you will still need to leverage Compass to make use of the math helper functions. The following 11 variables are configurable in the Sass up front, and their defaults are written out for you to look at:

// $menu-item-radius: 48px;                  [1]
// $num-items: 5;                            [2]
// $menu-theme-color: rgb(255, 40, 60);      [3]
// $spread-radius: 144px;                    [4]
// $delay-increment: 0.1s;                   [5]
// $menu-position: "bottom-right";           [6]
// $mq-height: 480px;                        [7]
// $mq-width: 480px;                         [8]
// $button-bar-height: 4px;                  [9]
// $button-bar-spacing: 4px;                 [10]
// $button-lr-padding: 10px;                 [11]

You can edit these as you see fit. Here's the breakdown of these 11 configuration options:

  1. Set up the initial menu item radius.
  2. Decalare how many items our menu will contain.
  3. Set up a theme colour.
  4. The spread radius, which is how far the menu items spread from the origin.
  5. The delay increment, which is how much delay there is between each menu item leaving from / returning to the origin.
  6. The position of the menu, chosen from one of four values: bottom-right - bottom right corner (this is the default) bottom-left - bottom left corner top-left - top left corner top-right - top right corner
  7. Minimum height at which menu increases size.
  8. Minimum width at which menu increases size.
  9. The height of a bar in the toggle button.
  10. The spacing between bars in the toggle button.
  11. The padding between the left and right of the toggle button container and the bars.

Other variables will have to be customised further down in the Sass with your own discretion. Be sure to change up the Sass variable that defines the number of navigation items.

License & Copyright

Licensed under the MIT license.

Copyright 2016, Call Me Nick.

More Repositories

1

Animating-Hamburger-Icons

Animating CSS-only hamburger menu icons
CSS
488
star
2

Slide-Push-Menus

Slide and push menus with CSS3 transitions.
CSS
227
star
3

Material-Menu

Off canvas menu inspired by Google's material design
CSS
165
star
4

five-star-rating

Five star rating component
CSS
113
star
5

Custom-Context-Menu

Code and test application for creating a custom context menu.
JavaScript
81
star
6

CSS-Device-Mockups

Pure CSS device mockups.
CSS
80
star
7

responsive-tabs

Responsive tab layout with JavaScript and CSS.
CSS
69
star
8

Memory

A memory game.
JavaScript
68
star
9

Full-Screen-Background-Video

CSS
55
star
10

Draw-Fill-SVG

SVG plugin that draws and fills SVG paths
JavaScript
54
star
11

Slack-CSS-Logo

Slack animating logo built with only CSS
CSS
46
star
12

Flexbox-Examples

Some layout demos built with flexbox.
CSS
42
star
13

CSS-Presentation

My CSS presentation (demos included), that I gave at Hack Reactor
HTML
21
star
14

lifo-transitions

Last in, first out transitions
CSS
19
star
15

cooking-with-webpack

A webpack cookbook with guided tutorials
JavaScript
14
star
16

angular-js-introduction

CSS
8
star
17

css-loaders-spinners-2

More CSS Loaders & Spinners
CSS
7
star
18

Simple-Alert

A JavaScript component that displays alerts to the user.
CSS
3
star
19

shape-outside-demo

Demo of the CSS shape-outside property and syntax
CSS
3
star
20

svg-progress-wheels

Easily customizable SVG animating progress wheel components
CSS
1
star
21

short-videos-playground

A playground for demos seen on the short videos for SP
CSS
1
star
22

node-pretty-log

Logs things prettily to console in node apps.
JavaScript
1
star
23

d3-squiggly-line

Turns a line into a squiggle for visual enhancement!
CSS
1
star
24

Chatterbox-Backbone

Chatterbox built with parse and backbone
JavaScript
1
star
25

Development-Demos

Simple template for my development demos.
CSS
1
star
26

Backbone-Users-Directory

A users directory application with Backbone
JavaScript
1
star
27

Audio-Visualizer

CSS
1
star
28

Student-Solutions-Website

Student Solutions static website.
CSS
1
star
29

web-animation-api

CSS
1
star
30

references

A collection of awesome references
1
star