Affichage avec url

This commit is contained in:
HarmandI 2021-10-19 17:17:14 +02:00
parent 8d4456bae6
commit ce00336862
4 changed files with 21 additions and 3 deletions

Binary file not shown.

View File

@ -16,11 +16,14 @@
<li id="films"><a href="films.html">Films</a></li> <li id="films"><a href="films.html">Films</a></li>
<li id="planets"><a href="planets.html">Planets</a></li> <li id="planets"><a href="planets.html">Planets</a></li>
<li id="characters"><a href="characters.html">Characters</a></li> <li id="characters"><a href="characters.html">Characters</a></li>
</ul> </ul>
</nav> </nav>
</section> </section>
<div class="image-charactere" ></div>
<section id="resultats"></section> <section id="resultats"></section>
</body> </body>
</html> </html>

View File

@ -2,6 +2,7 @@ import { api_call,API_URL } from "./util";
const PERSONNAGES = document.getElementById("resultats"); const PERSONNAGES = document.getElementById("resultats");
const NAME = document.getElementById("titreaccordeon"); const NAME = document.getElementById("titreaccordeon");
const PLANETENAISSANCE= document.getElementById("2");
class People { class People {
constructor(birth_year, eye_colo, gender, hair_color,height,mass,skin_color) { constructor(birth_year, eye_colo, gender, hair_color,height,mass,skin_color) {
@ -58,9 +59,13 @@ for (let i = 0; i < PERPAGE; i++) {
const urlmass=json.results[i].mass; const urlmass=json.results[i].mass;
const urlskin_color= json.results[i].skin_color; const urlskin_color= json.results[i].skin_color;
const urlname= json.results[i].name; const urlname= json.results[i].name;
const urlhomeworld=json.results[i].homeworld;
const urlfilms=json.results[i].films;
// const gens = new People(urlbirth_year, urleye_colo, urlgender, urlhair_color, urlmass,urlskin_color); // const gens = new People(urlbirth_year, urleye_colo, urlgender, urlhair_color, urlmass,urlskin_color);
// console.log(gens); // console.log(gens);
PERSONNAGES.innerHTML += PERSONNAGES.innerHTML +=
`<section class="resultat"> `<section class="resultat">
<h1 class="titreAccordeon">${urlname}</h1> <h1 class="titreAccordeon">${urlname}</h1>
@ -72,8 +77,8 @@ for (let i = 0; i < PERPAGE; i++) {
<div id=couleurCheveux> Couleur des Cheveux : ${urlhair_color} </div> <div id=couleurCheveux> Couleur des Cheveux : ${urlhair_color} </div>
<div id= poids> Poids du personnage : ${urlmass} kg</div> <div id= poids> Poids du personnage : ${urlmass} kg</div>
<div id= couleurPeau> Couleur de Peau : ${urlskin_color} </div> <div id= couleurPeau> Couleur de Peau : ${urlskin_color} </div>
<div class="2"> 2</div> <div class="2"> Planète de Naissance : ${urlhomeworld}</div>
<div class="3"> 3</div> <div class="3"> Film je suis présent : ${urlfilms}</div>
</div> </div>
</section>`; </section>`;

View File

@ -57,6 +57,16 @@ div.image-films {
content: url("../assets/imgs/mando.png"); content: url("../assets/imgs/mando.png");
} }
div.image-charactere {
background-color: transparent;
margin-top: -170px;
margin-left: auto;
width: 30%;
content: url("../assets/imgs/grogu.png");
}
#reponses-films { #reponses-films {
color : #FFF; color : #FFF;
float: left; float: left;