This is a very simple MaterialDesign style mobile App menu special effect. This effect is completed using CSS3 and a small amount of jQuery code. After the user clicks the hamburger menu button, the button will be deformed and enlarged to the entire mobile APP screen, and the menu options will slide from the bottom of the screen, the effect is very ...,. Brief tutorial
This is a very simple Material Design style mobile App menu special effect. This effect is completed using CSS3 and a small amount of jQuery code. After the user clicks the hamburger menu button, the button will be deformed and enlarged to the entire mobile APP screen, and the menu options will slide from the bottom of the screen, the effect is very cool.
. Navigation menu usage Element. P. nav-toggle is an extension animation used to create a circle, and p. icon is a hamburger icon.
- Search
- Main Page
- HTML5 Learning
- CSS3 Learning
- Contact us
Material cards
...
..
...
CSS style
In this APP program design, the mobile phone interface uses fixed width and height, and is set to fixed positioning. The screen of the mobile phone is also set to a fixed width and height, and set to relative positioning.
-
.phone { position: fixed; top: 50%; left: 50%; -webkit-transform: translateX(-50%) translateY(-50%); -ms-transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%); width: 280px; height: 580px; border-radius: 40px; background-color: white;}.phone .screen { width: 260px; height: 450px; background-color: #ECEBE9; display: block; margin: 65px auto; overflow: hidden; position: relative; border-radius: 2px; border: 4px solid #262626;}
The package element of the hamburger icon is set to a circle with a radius of 30 pixels. Its: The before pseudo element is set to the same size as it, and this pseudo element will be used later to create the circular expansion animation effect.
-
.nav-toggle { width: 60px; height: 60px; z-index: 2; border-radius: 50%; margin: 10px; position: absolute; cursor: pointer; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); -webkit-transition-duration: 0.66s; transition-duration: 0.66s; -webkit-transition-timing-function: swing; transition-timing-function: swing;}.nav-toggle:before { width: 60px; height: 60px; border-radius: 50%; background-color: #4A75E6; content: ""; position: absolute; top: 50%; left: 50%; -webkit-transform: translateX(-50%) translateY(-50%); -ms-transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%); -webkit-transition-duration: 0.66s; transition-duration: 0.66s; -webkit-transition-timing-function: swing; transition-timing-function: swing;}
After the user clicks the hamburger icon, The jQuery code is used in the special effect to switch the class for the body element. When the body element is added. after nav-openclass ,. nav-toggle: The before pseudo element starts to be animated, and the circle begins to expand.
-
body.nav-open .nav-toggle:before { width: 1200px; height: 1200px; background-color: rgba(74, 117, 230, 0.95);}
The CSS code for the entire effect is very simple. For more information, see download an object.
The above is the content of the simple Material Design style mobile App menu special effect. For more information, see PHP Chinese Network (www.php1.cn )!