cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <!--

Honestly I'm not a fan of material design, but this was fun (this is being featured on material.uplabs.com and I'm not removing my statement).

Originally used SVGs for the curved edges but with the material ripple - it just didn't work well so I used 400px × 400px circles and make them square when pushing them off the screen (#back).

~~I saw something similar to this earlier and can't track it down - it isn't exactly the same but the static look is inspired.~~
I found the post I saw: https://material.uplabs.com/posts/google-docs-redesign-concept

-->

<div class="header --flex-row">
   <div id="back" class="back --flex-column-j!c-ai!c do-ripple" ripple-size="200">
      <div class="arrow"></div>
      <!--<svg class="bulge" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 181.5" enable-background="new 0 0 16 181.5" xml:space="preserve">
         <path d="M0,0v181.5C13.25,147,16,116,16,90.75S13.25,34.5,0,0z"/>2
      </svg>--> 
   </div>
   <div class="place" ripple-size="200">
      <div class="icons">
         <div class="home"><i class="fa fa-home" aria-hidden="true"></i></div>
         <div class="now"><i class="fa fa-pencil" aria-hidden="true"></i></div>
         <div class="next"><i class="fa fa-question" aria-hidden="true"></i></div>
      </div>
      <!--<svg class="bulge" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 181.5" enable-background="new 0 0 16 181.5" xml:space="preserve">
         <path d="M0,0v181.5C13.25,147,16,116,16,90.75S13.25,34.5,0,0z"/>
      </svg>-->
   </div>
</div>
<div class="nav do-ripple" ripple-size="80">
   <div class="item do-ripple" ripple-size="64" tab-id="write"><i class="fa fa-pencil" aria-hidden="true"></i></div>
   <div class="item do-ripple" ripple-size="64" tab-id="history"><i class="fa fa-book" aria-hidden="true"></i></div>
   <div class="item do-ripple" ripple-size="64" tab-id="loved"><i class="fa fa-heart" aria-hidden="true"></i></div>
   <div class="item do-ripple" ripple-size="64" tab-id="settings"><i class="fa fa-cog" aria-hidden="true"></i></div>
</div>
<div class="capture hide"></div>

<!--
I even tried a mask and messed up - if someone can show me how to do it I will be very grateful.
-->
<!--<svg class="svg-defs">
   <defs>
      <clipPath id="bulge_back" x="0px" y="0px" width="66" height="100" viewBox="0 0 66 100">
         <path d="M50,0H0v100h50c7.3-19.008,8.815-36.088,8.815-50S57.301,19.008,50,0z"/>
      </clipPath>
      <clipPath id="bulge_location" x="0px" y="0px" width="66" height="100" viewBox="0 0 66 100">
         <path d="M100,0H0v100h100c7.3-19.008,8.815-36.088,8.815-50S107.3,19.008,100,0z"/>
      </clipPath>
   </defs>
</svg>-->
            
          
!
            
              /*

The noted out stuff is for the SVGs that I'm no longer using but still want the 10 minutes I put into them to be appreciated.

*/

body {
   background-color: #ECEFF1;
   .do-ripple {
      overflow: hidden;
      .ripple {
         position: absolute;
         animation: ripple 0.3s linear;
         background-color: #ccc;
         border-radius: 100%;
         opacity: 0;
         pointer-events: none;
         z-index: 1;
      }
      >*:not(.ripple) {
         z-index: 2;
      }
   }
   .header {
      overflow: hidden;
      position: fixed;
      top: 0px;
      left: 0px;
      right: 0px;
      height: 100px;
      background-color: #ffffff;
      box-shadow: 0 -6px 8px 4px rgba(0, 0, 0, 0.3);
      /*>* {
         position: relative;
         .bulge {
            position: absolute;
            top: 0px;
            bottom: 0px;
            left: 100%;
            height: 100px;
            width: 8.8px;
         }
      }*/
      .back {
         background-color: #144ACC;
         z-index: 3;
         //mask: url(#bulge_back);
         cursor: pointer;
         transition: 0.5s;
         width: 50px;
         height: 400px;
         padding-left: 350px;
         margin-right: -365px;
         border-radius: 100%;
         transform: translate(-87.5%, -50%) translateY(50px);
      box-shadow: 1px 2px 8px -1px rgba(0, 0, 0, 0.1);
         /*svg {
            display:none;
            left:50px;
            transition:10.3s;
            path {
               fill:#144ACC;
            }
         }*/
         .arrow {
            position: relative;
            width: 17px;
            height: 2px;
            margin-left: 3px;
            background-color: #ffffff;
            pointer-events: none;
            &:before,
            &:after {
               content: '';
               position: absolute;
               top: 50%;
               left: 50%;
               transform: translate(-50%, -50%) rotate(45deg) translate(-2px, 7px);
               width: 12px;
               height: 2px;
               background-color: #ffffff;
            }
            &:after {
               transform: translate(-50%, -50%) rotate(-45deg) translate(-2px, -7px);
            }
         }
         &.hide {
            margin-left: -50px;
            border-radius: 0%;
            /*svg {
               width:0px;
               left:0px;
               height:100px;
            }
            .arrow {
               opacity:0;
               transition-delay:0s 0.5s;
            }*/
         }
         /*&:hover {
            background-color:#1348C4;
            svg {
               path {
                  fill:#1348C4;
               }
            }
         }
         &:active {
            background-color:#1243B7;
            svg {
               path {
                  fill:#1243B7;
               }
            }
         }*/
      }
      .place {
         background-color: #2F73E9;
         width: 100px;
         height: 400px;
         padding-left: 250px;
         margin-right: -365px;
         border-radius: 100%;
         transform: translate(-65%, -50%) translateY(50px);
         z-index: 2;
         .icons {
            position: absolute;
            top: 50%;
            left: calc(75% + 31px);
            transform: translate(-50%, -50%);
            color: #fff;
            font-size: 32px;
            line-height: 66px;
            transition: top 0.5s ease;
            &.home {
               top: calc(50% + 66px);
            }
            &.next {
               top: calc(50% - 66px);
            }
            &.noanimation {
               transition: top 0s ease;
            }
         }
         /*svg {
            path {
               fill:#2F73E9;
            }
         }*/
      }
   }
   .capture {
      position: fixed;
      top: 0px;
      left: 0px;
      right: 0px;
      bottom: 0px;
      background-color: rgba(0, 0, 0, 0.3);
      z-index: 0;
      opacity: 1;
      pointer-events: auto;
      transition: opacity 0.25s ease;
      &.hide {
         opacity: 0;
         pointer-events: none;
      }
   }
   .nav {
      position: fixed;
      height: 40px;
      width: 40px;
      top: 30px;
      left: 135px;
      background-color: #4395FA;
      border-radius: 20px;
      transition: 0.5s;
      cursor: pointer;
      z-index: 1;
      box-shadow: 1px 2px 8px -1px rgba(0, 0, 0, 0.1);
      &.home {
         left: 85px;
      }
      .item {
         transition: 0.5s;
         width: 6px;
         height: 6px;
         background-color: #fff;
         position: absolute;
         border-radius: 20px;
         transform: translate(-50%, -50%);
         .ripple {
            display: none;
            background-color: #ECEFF1;
         }
         &:nth-child(1) {
            top: 35%;
            left: 35%;
         }
         &:nth-child(2) {
            top: 65%;
            left: 35%;
         }
         &:nth-child(3) {
            top: 35%;
            left: 65%;
         }
         &:nth-child(4) {
            top: 65%;
            left: 65%;
         }
         i {
            transition: 0.5s;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #144ACC;
            opacity: 0;
         }
      }
      &.open {
         width: 156px;
         .item {
            top: 50%;
            width: 32px;
            height: 32px;
            &:nth-child(1) {
               left: 14%;
            }
            &:nth-child(2) {
               left: 38%;
            }
            &:nth-child(3) {
               left: 62%;
            }
            &:nth-child(4) {
               left: 86%;
            }
            &:active {
               transform: translate(-50%, -50%) scale(0.9);
            }
            i {
               opacity: 1;
            }
            .ripple {
               display: block;
            }
         }
      }
   }
}

@keyframes ripple {
   0%,
   100% {
      display: block;
   }
   0% {
      opacity: 0.3;
      width: 0px;
      height: 0px;
      transform: translate(-50%, -50%) scale(0);
   }
   100% {
      opacity: 0;
      transform: translate(-50%, -50%) scale(1);
   }
}
            
          
!
            
              //console.clear();

var pages = { // ¯\_(ツ)_/¯ slightly more useful than pointless
   current: "write",
   index: {
      write: {
         id: "write",
         name: "Write",
         icon: "fa-pencil"
      },
      history: {
         id: "history",
         name: "History",
         icon: "fa-book"
      },
      loved: {
         id: "loved",
         name: "Loved",
         icon: "fa-heart"
      },
      settings: {
         id: "settings",
         name: "Settings",
         icon: "fa-cog"
      }
   }
};

$(document).ready(function() {
   console.log(Object.keys(pages.index));
   for(var i = 0; i < 4; i++) {
      console.log(Object.keys(pages.index)[i]);
      $(`.nav .item:nth-child(${i + 1})`).find("i").attr("class", `fa ${pages.index[Object.keys(pages.index)[i]].icon}`)
   }
   $(document).on("click", ".do-ripple", function(e) { // I don't like material design but I like this effect
      var x = e.pageX - $(this).offset().left;
      var y = e.pageY - $(this).offset().top;
      var s = $(this).attr("ripple-size");
      //var s = Math.max($(this).width(), $(this).height())*2; //<- if you want to take this effect (feel free), replace the above line with this. ripple-size is something I used because the elements are huge.
      $(this).append(`<div class="ripple" style="width:${s}px; height:${s}px; top:${y}px; left:${x}px"></div>`); //Shout out to Chris Coyier for showing me inline variables with Babel
   });
   $(document).on("click", "#back", function(e) {
      $(this).addClass("hide");
      $(".icons").addClass("home");
      $(".nav").addClass("home");
      pages["current"] = "home";
   });
   $(document).on("click", ".capture", function(e) {
      $(".nav").removeClass("open");
      $(".capture").addClass("hide");
   });
   $(document).on("click", ".nav:not(.open)", function(e) {
      $(this).addClass("open");
      $(".capture").removeClass("hide");
   });
   $(document).on("click", ".nav.open .item", function(e) {
      var id = $(this).attr("tab-id");
      if (pages["current"] == "home") {
         $(".place .icons .now i").removeClass().addClass("fa").addClass(pages["index"][id]["icon"]);
      } else {
         $(".place .icons .next i").removeClass().addClass("fa").addClass(pages["index"][id]["icon"]);
         $(".place .icons").addClass("next");
         setTimeout(function() {
            $(".place .icons").addClass("noanimation");
            $(".place .icons .now i").removeClass().addClass("fa").addClass(pages["index"][id]["icon"]);
            $(".place .icons").removeClass("next");
            setTimeout(function() {
               $(".place .icons").removeClass("noanimation");
            }, 10);
         }, 500);
      }
      pages["current"] = id;
      $("#back").removeClass("hide");
      $(".icons").removeClass("home");
      $(".nav").removeClass("home").removeClass("open");
      $(".capture").addClass("hide");
   });
});
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console