mnshchtri / ecommerce-website Goto Github PK
View Code? Open in Web Editor NEWGroup CourseWork-IS
Group CourseWork-IS
Tonight we will do focus on wireframe
when i was merging the chnages that u had made , i accidently just accepted the changes instead of accepting both the changes . this has led to te fact that my code and your code was there. and it creates a clash of elements in the html. and while i was trying to handle the issue, your details were lost. so we need to work on that as asap @mnshchtri
I've made additions and committed the modifications to the JavaScript code. Although the commit is visible, I encounter an error when attempting to pull from the 'origin dev' branch.
Here is the code changes in js:
let next = document.querySelector('.next')
let prev = document.querySelector('.prev')
let next1 = document.querySelector('.next1')
let prev1 = document.querySelector('.prev1')
//functionality added for giving the popup message alerting whenever the add to cart button is clicked
function handleAddToCartClick(productName) {
alert(productName + " has been added to the cart! Thank You for Shopping.");
}
// Add event listeners to all "Add to Cart" buttons
document.addEventListener('DOMContentLoaded', function () {
var addToCartButtons = document.querySelectorAll('.item button');
// Loop through each selected button
addToCartButtons.forEach(function (button) {
// Add a click event listener to each button
button.addEventListener('click', function () {
// Get the product name associated with the clicked button
var productName = this.parentElement.querySelector('.name').innerText.trim();
// Call the handleAddToCartClick function with the product name as an argument
handleAddToCartClick(productName);
});
});
});
next.addEventListener('click', function () {
let items = document.querySelectorAll('.item')
document.querySelector('.slide').appendChild(items[0])
})
prev.addEventListener('click', function () {
let items = document.querySelectorAll('.item')
document.querySelector('.slide').prepend(items[items.length - 1])
})
next1.addEventListener('click', function () {
let items = document.querySelectorAll('.item1')
document.querySelector('.slide1').appendChild(items[0])
})
prev1.addEventListener('click', function () {
let items = document.querySelectorAll('.item1')
document.querySelector('.slide1').prepend(items[items.length - 1])
})
so basically this is not an issue , its just a thing that clicked my mind. yea i know i can write this on whatsapp , slack or whatever , but it seems cool while writing here . so why not .
yea the idea was that , we should have made a new project in github in the first place instead of a single repo . that would have allowed us to assign the tasks, track the bugs and many more
@mnshchtri
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.