diff --git a/js/TestCar.js b/js/TestCar.js new file mode 100644 index 0000000000000000000000000000000000000000..a7c7e9c48a12e2d68d496b8f2b0190084eb05e58 --- /dev/null +++ b/js/TestCar.js @@ -0,0 +1,48 @@ +class Car { + + constructor(image, + make, + model, + description, + price, + category, + year, + mileage, + extras /*tableau d'Extra**/) { + this.image = image; + this.make = make; + this.model = model; + this.description = description; + this.price = price; + this.category = category; + this.year = year; + this.mileage = mileage; + this.extras = extras; + } + + generateCar(image, + make, + model, + description, + price, + category, + year, + mileage, + extras /*tableau d'Extra**/) { + const car = new Car(image, make, model, description, price, category, year, mileage, extras); + return car; + + } + + generateImage(elt) { + var imageCree = document.createElement('img'); + const chemin = String.prototype.concat("../img/", String.prototype.concat(valueOf(this.val) + valueOf(this.model))); + imageCree.src = chemin; + imageCree.className = "card-img-top" + Document.get .appendChild(imageCree); + } + + generateExtras(elt) { + + } +} \ No newline at end of file diff --git a/js/car.js b/js/car.js new file mode 100644 index 0000000000000000000000000000000000000000..770687fe1bd7bdb73aef659dd9bdf5fb5e115426 --- /dev/null +++ b/js/car.js @@ -0,0 +1,34 @@ +function Car (image, + make, + model, + description, + price, + category, + year, + mileage, + extras /*tableau d'Extra**/) { + this.image = image; + this.make = make; + this.model = model; + this.description = description; + this.price = price; + this.category = category; + this.year = year; + this.mileage = mileage; + this.extras = extras; + } + +function generateCar(image, + make, + model, + description, + price, + category, + year, + mileage, + extras /*tableau d'Extra**/) { + const car = new Car(image, make, model, description, price, category, year, mileage, extras); + console.error(car); + return car; + +} diff --git a/js/extra.js b/js/extra.js new file mode 100644 index 0000000000000000000000000000000000000000..723e2cf9bbd3254f1d09d6d15f22700433cfbb7e --- /dev/null +++ b/js/extra.js @@ -0,0 +1,7 @@ +function extra(name, price) { + this.name = name; + this.price = price; +} + + +