Html
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="menu.css">
</head>
<body>
<input type="radio" name="opcao" id="opcao-bolos" checked>
<label for="opcao-bolos">Bolos</label>
<input type="radio" name="opcao" id="opcao-bebidas">
<label for="opcao-bebidas">Bebidas</label>
<div class="container-menus">
<img src="imagens/menu-bolos.png" id="menu-bolos" class="menu">
<img src="imagens/menu-bebidas.png" id="menu-bebidas" class="menu">
</div>
</body>
</html>
CSS
#opcao-bolos:checked ~ #menu-bebidas,
#opcao-bebidas:checked ~ #menu-bolos {
display: none;
}
input[type=radio] {
display: none;
}
.menu {
width: 100%;
}
body {
background: #3D1A11;
font-family: sans-serif;
margin: 0;
text-align: center;
}
label {
background: center 0.5em no-repeat #563429;
background-size: 4em;
color: white;
display: block;
font-size: 75%;
padding: 4em 0 1em;
text-transform: uppercase;
}
label[for=opcao-bolos] {
background-image: url(imagens/icone-bolos.svg);
}
label[for=opcao-bebidas] {
background-image: url(imagens/icone-bebidas.svg);
}
:checked + label {
background-color: #E4876D;
}
label {
width: 50%;
position: fixed;
bottom: 0;
z-index: 1;
}
label[for=opcao-bolos] {
left: 0;
}
label[for=opcao-bebidas] {
right: 0;
}
.menu {
margin-bottom: 100px;
}
html,
body {
overflow-x: hidden;
width: 100%;
}
.container-menus {
transform: translateX(0);
transition: transform 300ms ease;
width: 200%;
}
.container-menus .menu {
float: left;
width: 50%;
}
#opcao-bebidas:checked ~ .container-menus {
transform: translateX(-50%);
}
/* hack android velho */
body { -webkit-animation: bugfix infinite 1s; }
@-webkit-keyframes bugfix {
from { padding: 0; }
to { padding: 0; }
}