42 lines
1.1 KiB
JavaScript
42 lines
1.1 KiB
JavaScript
/**
|
|
* @class Underwater
|
|
*/
|
|
export class Underwater {
|
|
|
|
/**
|
|
* @param {object} data
|
|
*/
|
|
set data(data) {
|
|
this._data = data;
|
|
}
|
|
|
|
async render() {
|
|
return `
|
|
<div class="container px-4 pt-4">
|
|
<p class="p-2">
|
|
<strong>Denominazione:</strong> ${this._data.denomination}
|
|
</p>
|
|
<p class="p-2">
|
|
<strong>Località generica:</strong> ${this._data.genericPlace}
|
|
</p>
|
|
<p class="p-2">
|
|
<strong>Periodo:</strong> ${this._data.period}
|
|
</p>
|
|
<p class="p-2">
|
|
<strong>Stato di conservazione:</strong> ${this._data.conservationState}
|
|
</p>
|
|
<p class="mt-4 pl-2 pr-5">
|
|
<strong class="pb-3">Descrizione breve</strong></br>
|
|
${this._data.shortDescription}
|
|
</p>
|
|
<p class="p-2 mb-4">
|
|
<strong>Autore scheda:</strong> ${this._data.author}
|
|
</p>
|
|
</div>`;
|
|
}
|
|
|
|
async fetchData(url) {
|
|
return await fetch(url).then(res => res.json());
|
|
}
|
|
}
|