Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Menu de navegação</title>
- <link rel="stylesheet" href="estilo.css">
- </head>
- <body>
- <section id="banner">
- <div>
- <img src="https://www.multylog.com.br/assets/images/ecologia.png" alt="Logotipo">
- </div>
- <input type="checkbox" id="menu-hanburguer">
- <label for="menu-hanburguer">
- <div class="menu">
- <span class="hanburguer"></span>
- </div>
- </label>
- <ul>
- <li><a href="">Home</a></li>
- <li><a href="">Serviços</a></li>
- <li><a href="">Sobre</a></li>
- <li><a href="">Contato</a></li>
- </ul>
- </section>
- <script src="script.js">
- </script>
- </body>
- </html>
- /// CSS
- *{
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- body{
- background-color: #F5DEB3;
- }
- #banner{
- display: grid;
- justify-content: center;
- align-content: center;
- margin-top: 10%;
- }
- .menu{
- background-color: #DAA520;
- width: 65px;
- height: 65px;
- border-radius: 50%;
- bottom: 25px;
- right: 25px;
- position: fixed;
- cursor: pointer;
- box-shadow: 0 0 0 0 #DAA520, 0 0 0 0 #DAA520;
- transition: box-shadow 1s ease-in-out;
- }
- .hanburguer{
- position: relative;
- display: block;
- width: 40px;
- height: 3px;
- background-color: #fff;
- top: 32px;
- left: 13px;
- transition: .5s ease-in-out;
- }
- #menu-hanburguer{
- display: none;
- }
- .menu:hover{
- box-shadow: 0 0 0 8px #DAA520, 0 0 0 8px #DAA520;
- }
- input:checked ~ ul{
- opacity: 1;
- transition: .2s 1s ease-in-out;
- }
- input:checked ~ label .hanburguer{
- transform: rotate(45deg);
- }
- input:checked ~ label .hanburguer:before{
- transform: rotate(90deg);
- top: 0px;
- }
- input:checked ~ label .hanburguer:after{
- transform: rotate(90deg);
- bottom: 0px;
- }
- input:checked ~ label .menu{
- box-shadow: 0 0 0 130vw #DAA520, 0 0 0 130vw #DAA520;
- }
- .hanburguer:before,
- .hanburguer:after{
- background-color: #fff;
- content: '';
- display: block;
- width: 100%;
- height: 100%;
- position: absolute;
- transition: .5s ease-in-out;
- }
- .hanburguer:before{
- top: -10px;
- }
- .hanburguer:after{
- bottom: -10px;
- }
- ul{
- position: absolute;
- top: 30%;
- left: 45%;
- transform: translate(-50% -50%);
- list-style: none;
- opacity: 0;
- transition: 1s;
- }
- a{
- display: block;
- margin-bottom: 30px;
- color: #fff;
- font-size: 40px;
- text-decoration: none;
- font-weight: 900;
- font-family: "Trebuchet MS";
- }
Advertisement
Add Comment
Please, Sign In to add comment