Compare commits
2 commits
97b06fe920
...
8fa4062015
Author | SHA1 | Date | |
---|---|---|---|
8fa4062015 | |||
3137927e37 |
5 changed files with 39 additions and 5 deletions
|
@ -38,6 +38,7 @@ img {
|
||||||
table {
|
table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
|
||||||
border: 1px solid #ddd;
|
border: 1px solid #ddd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<script src="./js/element.js"></script>
|
<script src="./js/element.js"></script>
|
||||||
<div id="div_button_score">
|
<div id="div_button_score">
|
||||||
<script src="./js/technologie.js"></script>
|
<script src="./js/technologie.js"></script>
|
||||||
|
<div id="divButton_score">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<table>
|
<table>
|
||||||
|
|
|
@ -4,7 +4,7 @@ class Element{
|
||||||
this.techno = techno
|
this.techno = techno
|
||||||
}
|
}
|
||||||
|
|
||||||
charger_depuis_bdd(){
|
chargerDepuisBdd(){
|
||||||
fetch("../bdd/arbre.json").then((data)=>{
|
fetch("../bdd/arbre.json").then((data)=>{
|
||||||
data.json().then((data)=>{
|
data.json().then((data)=>{
|
||||||
this.props = data["technologies"][this.techno]["elements"][this.tag]
|
this.props = data["technologies"][this.techno]["elements"][this.tag]
|
||||||
|
@ -16,7 +16,7 @@ class Element{
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
afficher_props_dans_html(){
|
afficherDropsDansHtml(){
|
||||||
const table= document.getElementById("table_technologies_body")
|
const table= document.getElementById("table_technologies_body")
|
||||||
|
|
||||||
const tr = document.createElement("tr")
|
const tr = document.createElement("tr")
|
||||||
|
|
33
js/main.js
33
js/main.js
|
@ -0,0 +1,33 @@
|
||||||
|
function remplirMagasin(){
|
||||||
|
|
||||||
|
|
||||||
|
const table= document.getElementById("table_magasin_body")
|
||||||
|
|
||||||
|
|
||||||
|
fetch("../bdd/arbre.json").then((data)=>{
|
||||||
|
data.json().then((data)=>{
|
||||||
|
console.log(data)
|
||||||
|
let tech = data["technologies"]
|
||||||
|
|
||||||
|
Object.keys(tech).forEach(key => {
|
||||||
|
el = tech[key]
|
||||||
|
const tr = document.createElement("tr")
|
||||||
|
const nom = document.createElement("td")
|
||||||
|
nom.innerText = el.nom
|
||||||
|
const boost = document.createElement("td")
|
||||||
|
boost.innerText = el.boost
|
||||||
|
const cout = document.createElement("td")
|
||||||
|
cout.innerText = el.cout
|
||||||
|
|
||||||
|
tr.appendChild(nom)
|
||||||
|
tr.appendChild(boost)
|
||||||
|
tr.appendChild(cout)
|
||||||
|
table.appendChild(tr)
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -3,7 +3,7 @@ class Technologie{
|
||||||
this.nom = nom
|
this.nom = nom
|
||||||
}
|
}
|
||||||
|
|
||||||
charger_depuis_bdd(){
|
chargerDepuisBdd(){
|
||||||
fetch("../bdd/arbre.json").then((data)=>{
|
fetch("../bdd/arbre.json").then((data)=>{
|
||||||
data.json().then((data)=>{
|
data.json().then((data)=>{
|
||||||
console.log(data)
|
console.log(data)
|
||||||
|
@ -15,7 +15,7 @@ class Technologie{
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
appliquer_amelioration_style(){
|
appliquerAmeliorationStyle(){
|
||||||
document.getElementById("link-css").setAttribute("href","css/"+this.props.css_id)
|
document.getElementById("link-css").setAttribute("href","css/"+this.props.css_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue