Material Design Sidebar fadein

367 views Asked by At

I want to make that the "li" tags fly in when i open the sidebar. I have here an example of what i mean: http://www.materialup.com/posts/morph-menu

How can i make that effect? Here are a live-demo from my sidebar: www.hobbu.org

PS: to open the sidebar click on the top left icon.

sorry for my bad english, im from germany.

here is my css:

nav {
  width: 300px;
  height: 100%;
  top: 0;
  left: -300px;
  z-index: 99;
  overflow: hidden;
  background-color: #1976d2;
  position: fixed;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
}

nav > .bar {
  width: 100%;
  height: 60px;
  position: relative;
}

nav > .bar > .logo {
  width: 55px;
  height: 20px;
  top: 20px;
  right: 20px;
  background: url('../images/logo.png') no-repeat center;
  position: absolute;
}

nav > .accent {
  width: 100%;
  height: 190px;
  background: url('../images/accent-default.png') no-repeat center;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
}

nav > .accent > .user {
  width: 60px;
  height: 60px;
  top: 20px;
  margin: 0px auto;
  border-radius: 60px;
  overflow: hidden;
  background-color: #fff;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
  -moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
  -webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 1px 2px rgba(0, 0, 0, .24);
}

nav > .accent > .user > img {
  margin-left: -3px;
}

nav > .accent > .name {
  margin-top: 30px;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  text-align: center;
}

nav > .accent > .top {
  margin: 0 auto;
  margin-top: 30px;
  padding: 0;
}

nav > .accent > .top > li {
  width: 100px;
  display: inline-block;
  float: left;
  color: #fff;
  font-weight: 400;
  font-size: 14px;
  text-align: center;
}

nav > .accent > .sub {
  margin: 0;
  margin-top: 30px;
  padding: 0;
}

nav > .accent > .sub > li {
  width: 100px;
  display: inline-block;
  float: left;
  color: #fff;
  font-size: 14px;
  text-align: center;
}

nav > ul {
  margin: 0;
  padding: 0;
}

nav > ul > li {
  line-height: 40px;
  font-size: 16px;
  padding: 0px 20px;
  padding-right: 0px;
  color: #fff;
  display: block;
  float: none;
  transition: all .2s ease-in-out;
  -webkit-transition: all .2s ease-in-out;
}

nav > ul > li:hover > ul {
  display: block;
}

nav > ul > li > i {
  padding-right: 20px;
}

nav > ul > li > i.mdi-chevron-down {
  line-height: 40px;
  float: right;
}

nav > ul > li > a {
  width: 100%;
  color: #fff;
  display: inline-block;
  text-decoration: none;
  position: absolute;
}

nav > ul > li > ul {
  width: 1000%;
  padding: 0;
  margin: 0;
  margin-left: -20px;
  display: none;
  animation-name: fadeInDown; animation-duration: .3s;
  animation-timing-function: ease-in-out;
  animation-fill-mode: both;
  -webkit-animation-name: fadeInDown;
  -webkit-animation-duration: .3s;
  -webkit-animation-fill-mode: both;
  -webkit-animation-timing-function: ease-in-out;

}

nav > ul > li > ul > li {
  width: 100%;
  line-height: 30px;
  padding-left: 40px;
  font-size: 14px;
  display: block;
  float: none;
  transition: all .2s ease-in-out;
  -webkit-transition: all .2s ease-in-out;
}

nav > ul > li > ul > li:hover {
  background-color: rgba(0, 0, 0, .1);
}

nav > ul > li > ul > li > i {
  padding-left: 10px;
  padding-right: 10px;
}

nav > ul > li > ul > li > a {
  width: 100%;
  color: #fff;
  display: inline-block;
  text-decoration: none;
  position: absolute;
}
0

There are 0 answers