menu style : demo 5

HTML

                        

CSS

                        .demo{ background: #fc986a; }
                        .navbar{
                            width: 250px;
                            height: 250px;
                            margin: 0 auto;
                            position: relative;
                        }
                        .navbar .menu{
                            width: 250px;
                            height: 250px;
                            opacity: 0;
                            -webkit-transform: scale(0);
                            -moz-transform: scale(0);
                            transform: scale(0);
                            -webkit-transition: all 0.4s ease-out;
                            -moz-transition: all 0.4s ease-out;
                            transition: all 0.4s ease-out;
                        }
                        .navbar .open.menu{
                            opacity: 1;
                            -webkit-transform: scale(1);
                            -moz-transform: scale(1);
                            transform: scale(1);
                        }
                        .navbar .menu a{
                            display: block;
                            width: 40px;
                            height: 40px;
                            line-height: 40px;
                            text-align: center;
                            font-size: 30px;
                            color: #fff;
                            text-decoration: none;
                            margin: -20px 0 0 -20px;
                            position: absolute;
                        }
                        .navbar .nav-toggle{
                            display: block;
                            width: 40px;
                            height: 40px;
                            line-height: 40px;
                            border-radius: 50%;
                            background: #fff;
                            box-sizing: content-box;
                            position: absolute;
                            top: 0;
                            left: 0;
                            bottom: 0;
                            right: 0;
                            margin: auto;
                            text-decoration: none;
                            text-align: center;
                            font-size: 30px;
                            color: #444;
                            padding: 10px;
                        }
                    

JavaScript

(Menu depend on jQuery.)
                        

                        $(document).ready(function(){
                            var items = document.querySelectorAll('.menu a');
                            for(var i = 0, l = items.length; i < l; i++) {
                                items[i].style.left = (50 - 35*Math.cos(-0.5 * Math.PI - 2*(1/l)*i*Math.PI)).toFixed(4) + "%";
                                items[i].style.top = (50 + 35*Math.sin(-0.5 * Math.PI - 2*(1/l)*i*Math.PI)).toFixed(4) + "%";
                            }
                            document.querySelector('.nav-toggle').onclick = function(e) {
                                e.preventDefault(); document.querySelector('.menu').classList.toggle('open');
                            }
                        });
                    
License Terms