1
Does anyone know how I can animar
the passage of dashboard
for the menu?
Menu are the 3 dashes of the app and Dashboard is what appears when the code runs! Just a little animation !
CSS | HTML
body{
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
margin-bottom: 0px;
background: #252C35;
color: white;
}
#UpperBar{
height: 45px;
}
.MASlime{
position: absolute;
font-size: 30px;
top: 1px;
left: 40px;
}
#Totals{
position: absolute;
font-size: 30px;
}
.Total{
position: absolute;
top: 70px;
left: 130px;
}
.TotalEarnings{
position: absolute;
top: 70px;
left: 200px;
}
.TotalO{
position: absolute;
top: 140px;
left: 130px;
}
.TotalOrders{
position: absolute;
top: 140px;
left: 200px;
}
#Earnings{
position: absolute;
top: 70px;
left: 350px;
}
#Orders{
position: absolute;
top: 140px;
left: 350px;
}
.NewOrder{
position: absolute;
top: 250px;
left: 200px;
font-size: 30px;
}
.OrderName{
position: absolute;
top: 350px;
left: 140px;
width: 250px;
height: 25px;
background-color: #252C35;
color: white;
border: 1px;
border-style: solid;
border-radius: 5px;
border-color: white;
padding: 5px;
}
.OrderDate{
position: absolute;
top: 400px;
left: 140px;
width: 250px;
height: 25px;
background-color: #252C35;
color: white;
border: 1px;
border-style: solid;
border-radius: 5px;
border-color: white;
padding: 5px;
}
.SKU{
position: absolute;
top: 450px;
left: 140px;
width: 250px;
height: 25px;
background-color: #252C35;
color: white;
border: 1px;
border-style: solid;
border-radius: 5px;
border-color: white;
padding: 5px;
}
.SUBMIT{
position: absolute;
top: 500px;
left: 220px;
width: 100px;
height: 40px;
background-color: #252C35;
color: white;
border: 1px;
border-style: solid;
border-radius: 5px;
border-color: white;
padding: 5px;
}
.Menu{
position: absolute;
top: 25px;
left: 480px;
font-size: 30px;
cursor: pointer;
}
.menu{
text-align: center;
width: 100%;
display: none;
}
.menu a{
display: block;
border-bottom: 1px solid #EAEAED;
text-decoration: none;
color: white;
margin-top: 100px;
padding-bottom: 10px;
font-size: 30px;
background: #252C35;
}
.All{
display: block;
}
#toggle{
display: none;
}
#toggle:checked + .menu{
display: block;
}
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>EComerce App Slime</title>
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<div id="menu">
<label for="toggle" class="Menu">☰</label>
<input type="checkbox" id="toggle" onclick="meuMenuToggle()"/>
<div class="menu">
<a href="#">Slime Recipe</a>
</div>
</div>
<div id="UpperBar">
<p class="MASlime">MASlime</p>
</div>
<div id="HomePage">
<div id="Totals">
<p class="Total">Total</p>
<p class="TotalEarnings">Earnings</p>
<p class="TotalO">Total</p>
<p class="TotalOrders">Orders</p>
<p id="Earnings">100€</p>
<p id="Orders">1</p>
</div>
<div id="NewOrder">
<p class="NewOrder">New Order</p>
<form id="OrderForm">
<input class="OrderName" type="text" name="OrderName" placeholder="Buyer Name" required>
<input class="OrderDate" type="text" name="OrderDate" placeholder="Date of Order" required>
<input class="SKU" type="text" name="ProductSKU" placeholder="Product SKU" required>
<input class="SUBMIT" type="button" name="Submit" value="SUBMIT">
</form>
</div>
</div>
<script>
function meuMenuToggle() {
var x = document.getElementById("HomePage");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
</script>
<script src="js/index.js"></script>
</body>
</html>
Use the Greensock library, it is normally used for such animations, here’s a tutorial - https://youtu.be/dzz8kigJqvs
– Pona
@Pona I’ll try it! However if you want to give up I’d appreciate it very much!
– user132381
Animate type what? Make a transparency transition? Appear coming from the left, take a loop on the screen? You need to give more details...
– hugocsl
You use Jquery in your code?
– ElvisP
@Eliseub. I don’t use much jquery!
– user132381
But is there? Because it doesn’t need a lot of jquery, or complexity for what you need, maybe 3 lines.
– ElvisP
Possible duplicate of How can I make a div disappear when I click a button
– Rafael Barros