made changes
This commit is contained in:
parent
6ea321bb23
commit
c8ccf8b4c2
3 changed files with 15 additions and 11 deletions
|
@ -1,4 +1,5 @@
|
||||||
//sticky navbar
|
//sticky navbar ---------------------------------------------
|
||||||
|
|
||||||
const nav = document.querySelector("header");
|
const nav = document.querySelector("header");
|
||||||
window.addEventListener("scroll", function(){
|
window.addEventListener("scroll", function(){
|
||||||
if(this.document.documentElement.scrollTop>20){
|
if(this.document.documentElement.scrollTop>20){
|
||||||
|
@ -7,18 +8,18 @@ window.addEventListener("scroll", function(){
|
||||||
else{
|
else{
|
||||||
nav.classList.remove("sticky");
|
nav.classList.remove("sticky");
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
//parallax effect
|
//parallax effect ---------------------------------------------
|
||||||
|
|
||||||
const Parallax = document.querySelector("#home");
|
const Parallax = document.querySelector("#home");
|
||||||
window.addEventListener("scroll", function(){
|
window.addEventListener("scroll", function(){
|
||||||
let offset = window.pageYOffset;
|
let offset = window.pageYOffset;
|
||||||
Parallax.style.backgroundPositionY = offset * 0.5 +"px";
|
Parallax.style.backgroundPositionY = offset * 0.5 +"px";
|
||||||
});
|
});
|
||||||
|
|
||||||
|
//menu ---------------------------------------------
|
||||||
|
|
||||||
//menu
|
|
||||||
let menu = document.querySelector('nav')
|
let menu = document.querySelector('nav')
|
||||||
let menubtn = document.querySelector('.menu-btn')
|
let menubtn = document.querySelector('.menu-btn')
|
||||||
let closebtn = document.querySelector('.close-btn')
|
let closebtn = document.querySelector('.close-btn')
|
||||||
|
@ -30,7 +31,7 @@ closebtn.addEventListener('click', function(){
|
||||||
menu.classList.remove('active');
|
menu.classList.remove('active');
|
||||||
});
|
});
|
||||||
|
|
||||||
//static
|
//static ---------------------------------------------
|
||||||
|
|
||||||
const staticContentE1 = document.querySelectorAll('.num');
|
const staticContentE1 = document.querySelectorAll('.num');
|
||||||
|
|
||||||
|
@ -54,7 +55,7 @@ staticContentE1.forEach((staticContentE1) =>{
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//countdown
|
//countdown ---------------------------------------------
|
||||||
|
|
||||||
const openTimeStr = "We are open at 17:00"
|
const openTimeStr = "We are open at 17:00"
|
||||||
const openTime = parseInt(openTimeStr.substring(15, 20));
|
const openTime = parseInt(openTimeStr.substring(15, 20));
|
||||||
|
|
|
@ -212,13 +212,15 @@ body{
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------------------------------------------------------*/
|
||||||
#food-items{
|
#food-items{
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
#category-list{
|
#category-list{
|
||||||
display: none;
|
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------------------------------------------------------*/
|
||||||
|
.cart-toggle{
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
#cart-page{
|
#cart-page{
|
||||||
background: var(--other-color);
|
background: var(--other-color);
|
||||||
margin: 40px 10px;
|
margin: 40px 10px;
|
||||||
|
@ -303,3 +305,4 @@ body{
|
||||||
color: var(--bg-color);
|
color: var(--bg-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
<i class="fa fa-star" id="rating"> 4.3</i>
|
<i class="fa fa-star" id="rating"> 4.3</i>
|
||||||
<i class="fa-solid fa-cart-plus add-to-cart"></i>
|
<i class="fa-solid fa-cart-plus add-to-cart"></i>
|
||||||
</div>
|
</div>
|
||||||
<img src="images/order/1.jpg" alt="">
|
<img src="images/order/2.jpg" alt="">
|
||||||
<p id="order-name">Spicy Edamame</p>
|
<p id="order-name">Spicy Edamame</p>
|
||||||
<p id="order-price">$6.00</p>
|
<p id="order-price">$6.00</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -786,7 +786,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script src="order.js" type="module"></script>
|
||||||
|
|
||||||
<script src="main.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Add table
Reference in a new issue