From 285d226d3e6e0c4053f75ea0ceb4e29821462f04 Mon Sep 17 00:00:00 2001 From: Champvillard Sebastien Date: Fri, 16 Feb 2024 14:18:48 +0000 Subject: [PATCH 1/3] Upload New File --- js/car.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 js/car.js diff --git a/js/car.js b/js/car.js new file mode 100644 index 0000000..770687f --- /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; + +} -- GitLab From a54e69c857bc9f3416d14449b53cdc870d841ad7 Mon Sep 17 00:00:00 2001 From: Champvillard Sebastien Date: Fri, 16 Feb 2024 14:19:12 +0000 Subject: [PATCH 2/3] Upload New File --- js/extra.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 js/extra.js diff --git a/js/extra.js b/js/extra.js new file mode 100644 index 0000000..723e2cf --- /dev/null +++ b/js/extra.js @@ -0,0 +1,7 @@ +function extra(name, price) { + this.name = name; + this.price = price; +} + + + -- GitLab From 650b0638356cb313604c27f0d8a3ae559fed7c4c Mon Sep 17 00:00:00 2001 From: Champvillard Sebastien Date: Fri, 16 Feb 2024 14:20:01 +0000 Subject: [PATCH 3/3] G1-Champvillard Sebastien --- js/TestCar.js | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 js/TestCar.js diff --git a/js/TestCar.js b/js/TestCar.js new file mode 100644 index 0000000..a7c7e9c --- /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 -- GitLab