From a4b7cb41b03fa06835a38e5f6dfafaf7d8847f36 Mon Sep 17 00:00:00 2001 From: julia123456789037 Date: Fri, 16 Feb 2024 15:08:30 +0100 Subject: [PATCH] commit --- index.html | 71 +++++++++++++++++++++++++++++++---------------------- js/Car.js | 41 +++++++++++++++++++++++++++++++ js/extra.js | 8 ++++++ 3 files changed, 91 insertions(+), 29 deletions(-) create mode 100644 js/Car.js create mode 100644 js/extra.js diff --git a/index.html b/index.html index be6da78..c617947 100644 --- a/index.html +++ b/index.html @@ -1,48 +1,60 @@ - Page Title - - + Page Title + +
- -
-
+ +
+
+ + - @@ -50,6 +62,7 @@ + diff --git a/js/Car.js b/js/Car.js new file mode 100644 index 0000000..5681e93 --- /dev/null +++ b/js/Car.js @@ -0,0 +1,41 @@ + +function Car(image, make, model, description, price, category, year, mileage, exts = []) { + 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.lstExt = []; +} +Car.prototype.constructor = Car + +Car.prototype.addEtra = function(ext) { + var dernCase =this.lstExt.length; + this.lstExt[dernCase] = ext; +} + + +Car.prototype.generateImage = function(elt) { + console.log(elt); + /* + var imm = decoment.CreateElement('img') + imm.setAttribute('src' = this.image); + imm.setAttribute('alt' = this.make + this.model); + imm.setAttribute('class' = "card-img-top"); + */ + var imm = document.createTextNode("\"""); + elt.Text = imm; +} + +Car.prototype.generateExtras = function(elt) { + var tempo, element; + elt.appendChild(""); +} \ No newline at end of file diff --git a/js/extra.js b/js/extra.js new file mode 100644 index 0000000..921e91f --- /dev/null +++ b/js/extra.js @@ -0,0 +1,8 @@ + +function Extra(name,price) { + this.name = name; + this.price = price; +} +Extra.prototype.constructor = Extra + + -- GitLab