Skip to content

This page was made as a personal project in connection with an educational exercise.

This is NOT the official site of the company or brand identified on the page. The creator of this page is NOT affiliated with the company or brand in any way. DO NOT enter any personal information (such as logins, passwords or credit card numbers) on this site.

Commit

Permalink
final submission
Browse files Browse the repository at this point in the history
  • Loading branch information
0AvinashMohanDev1 committed Jan 22, 2023
1 parent cc342f5 commit aeca9a0
Show file tree
Hide file tree
Showing 14 changed files with 266 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"liveServer.settings.port": 5501
"liveServer.settings.port": 5502
}
6 changes: 4 additions & 2 deletions admin/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
#navbar div{
display: grid;
margin: auto;
grid-template-columns: repeat(3,1fr);
grid-template-columns: repeat(4,1fr);
gap: 100px;

}
Expand Down Expand Up @@ -166,7 +166,9 @@
grid-template-columns: repeat(2,1fr);
}
}

#logOut{
font-family: Arial, Helvetica, sans-serif;
}
@media only screen and (max-width: 450px){
#heading{
visibility: collapse;
Expand Down
5 changes: 5 additions & 0 deletions admin/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ navBar.innerHTML = `
<button id="removeProducts">All Products</button>
<button id="addProducts">Add Product</button>
<button id="editProducts">Edit Product</button>
<button id="logOut">Log out</button>
</div>
`;
let removeProductsButton = document.getElementById("removeProducts");
let userData=JSON.parse(localStorage.getItem("webUserData"))||[];

logOut.addEventListener('click',()=>{
window.location.href='/index.html'
})

window.addEventListener("load", (event) => {
event.preventDefault();
fetch(url)
Expand Down
37 changes: 29 additions & 8 deletions html/cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<title>welcome to trial</title>
<link rel="stylesheet" href="/styles/cart.css">
<style>
.navbar-1 {
Expand Down Expand Up @@ -60,29 +60,50 @@
</head>

<body>
<nav class="navbar-1">
<div id="left">
<a href="/index.html">
<img src="https://hindubabynames.info/downloads/wp-content/themes/hbn_download/download/cosmetic-companies/nykaa-logo.png"
alt="Nyka">
</a>
</div>
<div id="right">
<button id="Getapp-btn"><i class="fa-solid fa-mobile-screen-button"></i> Get App</button> |
<button id="Stores"><i class="fa-sharp fa-solid fa-location-dot"></i> Stores & Events</button> |
<button><i class="fa-solid fa-gift"></i> Gift Card</button> |
<button><i class="fa-solid fa-question"></i> Help</button>
</div>
</nav>
<!-- body of product page -->


<div class="container">
<div id="cart">Add Some Product to see</div>
</div>

<!-- // -->
<div id="navbar"></div>
<div class="MyProfile-Container">
<div class="MYWISH-CONT">
<p class="mywish-text">Shopping bag <span class="prod-count"></span></p>

<div class="MYWISH-BOX">
<p style="color: grey;">Total : <span id="total"></span></p>
<p style="color: grey;">Qty : <span id="qty"></span></p>
<input type="text" placeholder="Coupon">
<p ><b>Total :</b> <span id="total"></span></p>
<p ><b>Qty :</b> <span id="qty"></span></p>
<input type="text" placeholder="Coupon" id="masai20">
<button id="coupon">Add Coupon</button>
<p style="color: grey;">Discount 20%</p>
<p style="color: grey;">Grand total : <span id="gran_total"></span></p>
</div>
<div>
<button id="newbutton">Procced</button>
<button id="newbutton">Proceed</button>
</div>
</div>

</div>


</div>



</body>

</html>
Expand Down
2 changes: 1 addition & 1 deletion html/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<body>
<div id="logo" >
<a href="./index.html"><img src="https://hindubabynames.info/downloads/wp-content/themes/hbn_download/download/cosmetic-companies/nykaa-logo.png" alt="NYKAA Logo"></a>
<a href="/index.html"><img src="https://hindubabynames.info/downloads/wp-content/themes/hbn_download/download/cosmetic-companies/nykaa-logo.png" alt="NYKAA Logo"></a>
</div>
<div id="bodydiv">
<div id="login">
Expand Down
2 changes: 1 addition & 1 deletion html/order.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2>Thank You!</h2>
</html>
<script>
function closepopup(){
window.location.href="index.html"
window.location.href="/index.html"
}
</script>

Expand Down
26 changes: 14 additions & 12 deletions html/payment.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,27 +120,22 @@ <h6 class="ms-3 mt-3 mb-0 ">CHOOSE PAYMENT METHOD</h6>
<div class="content shadow-sm bg-body" id="totalprice">
<div class="price-cont bg-body">
<div class="subtotal mt-3">
<div>MRP Total : <span></span></div>
<div>MRP Total : <span id="amount"></span></div>

<div id="subt"></div>
<hr>
</div>
<div class="shc mt-3">
<div>Product Discount</div>
<div>Product Discount: <b>20%</b></div>

</div>
<hr>
<div class="ds mt-3">
<div class="deta"><b>Total Amount</b></div>
<div class="deta"><b>Total Amount: </b><span id="total"></span></div>

</div>
<hr>






</div>
</div>
</div>
Expand All @@ -154,10 +149,6 @@ <h6>CHANGE ADDRESS</h6> <a href="/html/adress.html" class="change_">Change</a>


</div>




</div>
</div>
</div>
Expand All @@ -182,5 +173,16 @@ <h6>CHANGE ADDRESS</h6> <a href="/html/adress.html" class="change_">Change</a>
function myfun(){
window.location.href="adress.html"
}
let data=JSON.parse(localStorage.getItem('webUserData'))||[];
let num=data[0].userNumberID;
let amount=document.getElementById('amount');
let total=document.getElementById('total');
let balance=0;
for(let i=0;i<data[num].userCartData.length;i++){
balance+=data[num].userCartData[i].price*data[num].userCartData[i].quantity;
}
amount.innerText=balance;

total.innerText=balance-balance*(.2);
</script>
</html>
15 changes: 10 additions & 5 deletions html/product.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
<nav class="navbar-1-2">
<nav class="navbar-1">
<div id="left">
<a href="index.html"><h4>BEAUTY BONANZA Get Your Daily Dose Of Amazing Deals</h4></a>
<a href="/index.html"><h4>BEAUTY BONANZA Get Your Daily Dose Of Amazing Deals</h4></a>
</div>
<div id="right">
<button id="Getapp-btn"><i class="fa-solid fa-mobile-screen-button"></i> Get App</button> |
Expand Down Expand Up @@ -116,7 +116,7 @@
<div id="bag"><a href="/html/cart.html"><i class="fa-solid fa-bag-shopping"></i></a></div>

</div>
<a href="./index.html">home🏡</a>
<a href="/index.html">home🏡</a>
<a href="/html/profile.html">🦁</a>
</nav>
</nav>
Expand Down Expand Up @@ -291,17 +291,22 @@ <h5>Top Categories</h5>
</div>
</body>
<script>
let arr;
let arr=[];
let url = `https://639b3492d5141501974eaf28.mockapi.io/nykaa`
fetch(url).then((res) => {
return res.json();
}).then((data) => {
hotDisplay(data);
//console.log(data);
arr = data;
console.log(data);
data.forEach((e)=>{
arr.push(e);
})
// console.log(arr);
}).catch((err) => {
alert(err)
})
console.log(arr);

function hotDisplay(data) {
document.querySelector("#products").innerHTML = null;
data.forEach(element => {
Expand Down
2 changes: 1 addition & 1 deletion html/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<!-- <a href="/html/login.html">login</a> -->
<nav>
<a href="/html/login.html">login</a>
<a href="/html/index.html" style="font-family: Flat style; color: pink;">Nycaa</a>
<a href="/index.html" style="font-family: Flat style; color: pink;">Nykaa</a>
</nav>
<div class="conteinar" id="blur">
<!-- change class profile to content -->
Expand Down
10 changes: 5 additions & 5 deletions html/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<nav class="navbar-1-2">
<nav class="navbar-1">
<div id="left">
<a href="/html/index.html"><h4 id="top-text">BEAUTY BONANZA Get Your Daily Dose Of Amazing Deals</h4></a>
<a href="/index.html"><h4 id="top-text">BEAUTY BONANZA Get Your Daily Dose Of Amazing Deals</h4></a>
</div>
<div id="right">
<a href="https://play.google.com/store/apps/details?id=com.fsn.nykaa&hl=en_IN&shortlink=b9cf200e&is_retargeting=true&c=Android&pid=Landing%20Page&source_caller=ui" target="_blank">
Expand All @@ -27,12 +27,12 @@
<nav class="navbar-2">
<div id="left1">
<div>
<a href="/html/index.html"><img src="https://bl-i.thgim.com/public/incoming/t8zkyh/article65347390.ece/alternates/FREE_1200/Nykaa.png" alt="NYKAA Logo"></a>
<a href="/index.html"><img src="https://bl-i.thgim.com/public/incoming/t8zkyh/article65347390.ece/alternates/FREE_1200/Nykaa.png" alt="NYKAA Logo"></a>
</div>
<div><a href="">Categories</a></div>
<div><a href="/html/product.html" target="_blank">Brands</a></div>
<div><a href="">Luke</a></div>
<div><a href="/html/product.html" target="_blank">Nyka Fashion</a></div>
<div><a href="/html/product.html" target="_blank">Nykaa Fashion</a></div>
<div><a href="">Beauty Advice</a></div>
</div>
<div id="right1">
Expand All @@ -41,8 +41,8 @@
<input type="text" placeholder="Search on Nykaa">
</form>
<a href="/html/login.html"><button id="Signin-btn">Sign in</button></a>
<div id="bag"><a href=""><i class="fa-solid fa-bag-shopping"></i></a></div>

<div id="bag"><a href="/html/cart.html"><i class="fa-solid fa-bag-shopping"></i></a></div>
<a href="./html/profile.html">🦁</a>
</div>
</nav>
</nav>
Expand Down
16 changes: 10 additions & 6 deletions scripts/cart.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
let data=JSON.parse(localStorage.getItem('webUserData'))||[];
let num=data[0].userNumberID;
let cart=document.getElementById('cart');
let bill=document.getElementById('pay');
let bill=document.getElementById('total');
let coupan=document.getElementById('masai20');
let couponBtn=document.getElementById('coupan');
let totalQuantity=document.getElementById('totalQuantity');
let couponBtn=document.getElementById('coupon');
let totalQuantity=document.getElementById('qty');
// let discount=document.getElementById('discount');
display(data[num].userCartData);

function display(value){
Expand All @@ -13,7 +14,8 @@ function display(value){
totalCartValue+=(value[i].quantity)*(value[i].price);
console.log(value[i]);
}
totalCartValue-=totalCartValue*(0.20);
// totalCartValue-=totalCartValue*(0.20);
// discount.innerText=totalCartValue;
couponBtn.addEventListener('click',(e)=>{
e.preventDefault();
if(coupan.value==='masai20'){
Expand Down Expand Up @@ -52,7 +54,6 @@ function display(value){

let quantity=document.createElement('h2');
quantity.setAttribute('class','add');
// quantity.style.backgroundColor='#c6c4b0'
quantity.innerText=element.quantity;

let subs=document.createElement('h3');;
Expand Down Expand Up @@ -104,5 +105,8 @@ function display(value){
}



let newbutton=document.getElementById('newbutton');
newbutton.addEventListener('click',()=>{
window.location.href='./adress.html'
})

14 changes: 12 additions & 2 deletions scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,21 @@ let arr = ['https://images-static.nykaa.com/uploads/cf96cee1-979c-4f29-bc44-ae4d
slider.innerHTML=`
<img src=${image} alt="Banner-Nykaa" >
`
console.log(i)
// console.log(i)
i++;
if(i==arr.length){
i=0;
}
}

}, 2500)
}, 2500)
// let search=document.getElementById("search");
// search.addEventListener("input",()=>{
// container.innerHTML=null;
// let input=search.value.toLowerCase();
// let newData=productData.filter((el)=>{
// return el.Title.toLowerCase().includes(input);
// });
// console.log(newData);
// display(newData);
// });
2 changes: 1 addition & 1 deletion scripts/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ signupForm.addEventListener("submit",(e)=>{
window.location.href='/admin/admin.html'
}else{
alert(`Welcome back ${userData[userData[0].userNumberID].userPersonalData.name}`);
window.location.href='./index.html';
window.location.href='/index.html';
}
console.log(userData);
}else{
Expand Down
Loading

0 comments on commit aeca9a0

Please sign in to comment.