Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature added like WISHLIST/FAVOURITE Button. #258

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 118 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,20 @@ <h3>Wireless Controllers for PlayStation 4</h3>
<div class="btn-section">
<button type="button" id = "buy-btn">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
<button type="button" id = "cart-btn">Add to Cart<img src="images/add.png" alt="Cart"></button>
<button onclick="Toggle1()"id="btnh1" class="btn"><i class="fa-solid fa-heart"></i></button>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code format is incorrect. You shouldn't insert JavaScript directly in the middle of the code. Instead, you should place those JavaScript codes in the script.js file for better organization and maintainability.

</div>
<script>
var btnvar1 = document.getElementById('btnh1');
function Toggle1(){
if (btnvar1.style.color =="red") {
btnvar1.style.color ="grey"

}
else{
btnvar1.style.color="red"
}
}
</script>
</div>
<div class="col-2">
<img src="images/controller1.png" class="controller" alt="Controller">
Expand Down Expand Up @@ -112,8 +125,21 @@ <h3>Controllers for Xbox One and Series X</h3>
<div class="btn-section">
<button type="button" id = "buy-btn">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
<button type="button" id = "cart-btn">Add to Cart<img src="images/add.png" alt="Cart"></button>
<button onclick="Toggle2()" id="btnh2" class="btn"><i class="fa-solid fa-heart"></i></button>
</div>
</div>
<script>
var btnvar2 = document.getElementById('btnh2');
function Toggle2(){
if (btnvar2.style.color =="red") {
btnvar2.style.color ="grey"

}
else{
btnvar2.style.color="red"
}
}
</script>
</div>>
<div class="col-2">
<img src="images/newcontroller3.png" class="controller" alt="Controller"> <!-- replaced old blurry image with enhanced image -->
<div class="color-box"></div>
Expand Down Expand Up @@ -143,7 +169,20 @@ <h3>Wireless Controllers for Nintendo Switch</h3>
<div class="btn-section">
<button type="button" id = "buy-btn">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
<button type="button" id = "cart-btn">Add to Cart<img src="images/add.png" alt="Cart"></button>
<button onclick="Toggle3()" id="btnh3" class="btn"><i class="fa-solid fa-heart"></i></i></button>
</div>
<script>
var btnvar3 = document.getElementById('btnh3');
function Toggle3(){
if (btnvar3.style.color =="red") {
btnvar3.style.color ="grey"

}
else{
btnvar3.style.color="red"
}
}
</script>
</div>
<div class="col-2">
<img src="images/controller2.png" class="controller" alt="Controller"><!--changed the image, as it was interchanged with the xbox controller image-->
Expand Down Expand Up @@ -174,7 +213,20 @@ <h3>VR Headset from Meta</h3>
<div class="btn-section">
<button type="button" id = "buy-btn">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
<button type="button" id = "cart-btn">Add to Cart<img src="images/add.png" alt="Cart"></button>
<button onclick="Toggle4()"id="btnh4" class="btn"><i class="fa-solid fa-heart"></i></button>
</div>
<script>
var btnvar4 = document.getElementById('btnh4');
function Toggle4(){
if (btnvar4.style.color =="red") {
btnvar4.style.color ="grey"

}
else{
btnvar4.style.color="red"
}
}
</script>
</div>
<div class="col-2">
<img src="images/metaquest.jpg" class="controller" alt="Controller"><!--changed the image, as it was interchanged with the xbox controller image-->
Expand Down Expand Up @@ -205,7 +257,20 @@ <h3>VR Headset from Apple</h3>
<div class="btn-section">
<button type="button" id = "buy-btn">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
<button type="button" id = "cart-btn">Add to Cart<img src="images/add.png" alt="Cart"></button>
<button onclick="Toggle5()" id="btnh5" class="btn"><i class="fa-solid fa-heart"></i></button>
</div>
<script>
var btnvar5 = document.getElementById('btnh5');
function Toggle5(){
if (btnvar5.style.color =="red") {
btnvar5.style.color ="grey"

}
else{
btnvar5.style.color="red"
}
}
</script>
</div>
<div class="col-2">
<img src="images/visionpro.png" class="controller" alt="Controller"><!--changed the image, as it was interchanged with the xbox controller image-->
Expand Down Expand Up @@ -236,7 +301,20 @@ <h3>High Performance Gaming Mouse</h3>
<div class="btn-section">
<button type="button" id = "buy-btn">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
<button type="button" id = "cart-btn">Add to Cart<img src="images/add.png" alt="Cart"></button>
<button onclick="Toggle6()" id="btnh6" class="btn"><i class="fa-solid fa-heart"></i></button>
</div>
<script>
var btnvar6 = document.getElementById('btnh6');
function Toggle6(){
if (btnvar6.style.color =="red") {
btnvar6.style.color ="grey"

}
else{
btnvar6.style.color="red"
}
}
</script>
</div>
<div class="col-2">
<img src="images/mouse.png" class="controller" alt="Gaming Mouse">
Expand Down Expand Up @@ -267,7 +345,20 @@ <h3>Mechanical Gaming Keyboard</h3>
<div class="btn-section">
<button type="button" id = "buy-btn">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
<button type="button" id = "cart-btn">Add to Cart<img src="images/add.png" alt="Cart"></button>
<button onclick="Toggle7()" id="btnh7" class="btn"><i class="fa-solid fa-heart"></i></button>
</div>
<script>
var btnvar7 = document.getElementById('btnh7');
function Toggle7(){
if (btnvar7.style.color =="red") {
btnvar7.style.color ="grey"

}
else{
btnvar7.style.color="red"
}
}
</script>
</div>
<div class="col-2">
<img src="images/keyboard.png" class="controller" alt="Gaming Keyboard">
Expand Down Expand Up @@ -298,7 +389,20 @@ <h3>Wireless Gaming Headset</h3>
<div class="btn-section">
<button type="button" id = "buy-btn">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
<button type="button" id = "cart-btn">Add to Cart<img src="images/add.png" alt="Cart"></button>
<button onclick="Toggle8()" id="btnh8" class="btn"><i class="fa-solid fa-heart"></i></button>
</div>
<script>
var btnvar8 = document.getElementById('btnh8');
function Toggle8(){
if (btnvar8.style.color =="red") {
btnvar8.style.color ="grey"

}
else{
btnvar8.style.color="red"
}
}
</script>
</div>
<div class="col-2">
<img src="images/headset.png" class="controller" alt="Gaming Headset">
Expand Down Expand Up @@ -329,7 +433,20 @@ <h3>Ergonomic Gaming Chair</h3>
<div class="btn-section">
<button type="button" id = "buy-btn">Buy Now<img src="images/arrow.png" alt="Arrow"></button>
<button type="button" id = "cart-btn">Add to Cart<img src="images/add.png" alt="Cart"></button>
<button onclick="Toggle9()"id="btnh9" class="btn"><i class="fa-solid fa-heart"></i></button>
</div>
<script>
var btnvar9 = document.getElementById('btnh9');
function Toggle9(){
if (btnvar9.style.color =="red") {
btnvar9.style.color ="grey"

}
else{
btnvar9.style.color="red"
}
}
</script>
</div>
<div class="col-2">
<img src="images/newchair.png" class="controller" alt="Gaming Chair">
Expand Down
12 changes: 12 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,18 @@ button:hover img {
gap: 15px;
}

.btn{
background: transparent;
border: none;
margin: 10px;
font-size: 40px;
outline: none;
color: gray;
}

.btn i:hover{
cursor : pointer;
}
.col-1::after {
content: '';
width: 10px;
Expand Down