Radial Popup Menu In Pure CSS – Circle Menu

Category: CSS & CSS3 , Menu & Navigation | June 24, 2018
Author:0guzhan
Views Total:9,578 views
Official Page:Go to website
Last Update:June 24, 2018
License:MIT

Preview:

Radial Popup Menu In Pure CSS – Circle Menu

Description:

Yet another circle menu navigation concept to create a floating action button that reveals a radial popup menu when toggled.

Built with pure HTML and CSS/CSS3. No JavaScript required.

How to use it:

Create the radial popup menu from a regular html unordered list. In this example, we’re going to use Font Awesome 5 for the icons.

<link rel="stylesheet" 
      href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" 
      integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" 
      crossorigin="anonymous">
<ul id="menu"&gt;
  <a class="menu-button icon-plus" href="#menu" title="Show navigation"><span class="fas fa-share-alt"></span></a>
  <a class="menu-button icon-minus" href="#0" title="Hide navigation"><span class="fas fa-share-alt"></span></a>
  <li class="menu-item">
      <a href="#menu">
          <span class="fab fa-github"></span>
      </a>
  </li>
  <li class="menu-item">
      <a href="#menu">
          <span class="fab fa-facebook"></span>
      </a>
  </li>
  <li class="menu-item">
      <a href="#menu">
          <span class="fab fa-twitter"></span>
      </a>
  </li>
  <li class="menu-item">
      <a href="#menu">
          <span class="fab fa-instagram"></span>
      </a>
  </li>
</ul>

The necessary CSS styles for the floating action button.

#menu {
  width: 150px;
  height: 150px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -75px 0 0 -75px;
  list-style: none;
  font-size: 200%;
}
.menu-button {
  opacity: 0;
  z-index: -1;
}
.menu-button {
  width: 150px;
  height: 150px;
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: #424242;
  background-size: 100%;
  overflow: hidden;
  text-decoration: none;
  line-height: 150px;
  color: #fff;
}
#menu:not(:target)>a:first-of-type, #menu:target>a:last-of-type {
  opacity: 1;
  z-index: 1;
}
#menu:not(:target)>.icon-plus:before, #menu:target>.icon-minus:before { opacity: 1; }

The required CSS for the menu items.

.menu-item {
  width: 70px;
  height: 70px;
  position: absolute;
  left: 55%;
  line-height: 5px;
  top: 50%;
  margin: -50px 0 0 -50px;
  border-radius: 50%;
  background-color: #424242;
  transform: translate(0px, 0px);
  transition: transform 500ms;
  z-index: -2;
  transition: .5s;
}
.menu-item:hover {
  opacity: 0.5;
  box-shadow: 0 5px 10px black;
}
.menu-item a {
  color: #fff;
  position: relative;
  top: 30%;
  left: 0;
  text-decoration: none;
}
#menu:target>.menu-item:nth-child(6) {
  transform: rotate(60deg) translateY(-150px) rotate(300deg);
  transition-delay: 0s;
}
#menu:target>.menu-item:nth-child(5) {
  transform: rotate(20deg) translateY(-155px) rotate(-20deg);
  transition-delay: 0.1s;
}
#menu:target>.menu-item:nth-child(3) {
  transform: rotate(-20deg) translateY(-155px) rotate(20deg);
  transition-delay: 0.2s;
}
#menu:target>.menu-item:nth-child(4) {
  transform: rotate(-60deg) translateY(-150px) rotate(60deg);
  transition-delay: 0.3s;
}

You Might Be Interested In:


Leave a Reply