diff --git a/css/global.css b/css/global.css index 7809461..0ceeaa4 100644 --- a/css/global.css +++ b/css/global.css @@ -122,6 +122,7 @@ select { font-size: 20px; } */ button, .button { + font-family: var(--text-familly); background-color: #1a1a1a; color: #ffffff; border: 2px solid #ffffff; diff --git a/css/modal-ships.css b/css/modal-ships.css new file mode 100644 index 0000000..65381d3 --- /dev/null +++ b/css/modal-ships.css @@ -0,0 +1,34 @@ +.modal-ships { + background-image: url("/assets/spaceships/blueprint.png"); + background-size: cover; + font-size: 25px; + width: 1000px; /* Set the width to the image width */ + height: 560px; /* Set the height to the image height */ + position: relative; + margin: auto; + padding: 40px; + color: yellow; +} + +.infos-ships { + padding: 20px; + margin-bottom: 20px; /* Space below the info box */ +} + +.btn-close-ships { + position: absolute; + font-size:x-large; + bottom: 20px; + left: 20px; + background-color: rgba(255, 255, 255, 0.8); + border: none; + color: yellow; + padding: 10px 20px; + cursor: pointer; + border-radius: 5px; + transition: background-color 0.3s ease; +} + +.btn-close-ships:hover { + background-color: rgba(255, 255, 255, 1); +} diff --git a/css/ships.css b/css/ships.css index c3be5f8..d6e7f40 100644 --- a/css/ships.css +++ b/css/ships.css @@ -53,4 +53,7 @@ /* On hover, add a black background color with a little bit see-through */ .prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); +} +.btn-ships{ + font-size:x-large; } \ No newline at end of file diff --git a/html/templates/ships/ships.html b/html/templates/ships/ships.html index 4c1444c..57784b2 100644 --- a/html/templates/ships/ships.html +++ b/html/templates/ships/ships.html @@ -2,5 +2,4 @@
\ No newline at end of file diff --git a/html/templates/ships/ships_modal.html b/html/templates/ships/ships_modal.html index a5a542c..0ab65fb 100644 --- a/html/templates/ships/ships_modal.html +++ b/html/templates/ships/ships_modal.html @@ -1,9 +1,9 @@ -Name : ${ship.registration.name}
`); - $(".infos").append(`Faction : ${ship.registration.factionSymbol}
`); - $(".infos").append(`Role : ${ship.registration.role}
`); + $(".infos-ships").html(""); + $(".infos-ships").append(`Name : ${ship.registration.name}
`); + $(".infos-ships").append(`Faction : ${ship.registration.factionSymbol}
`); + $(".infos-ships").append(`Role : ${ship.registration.role}
`); } }) modal.show(); @@ -56,11 +55,11 @@ export default (temp_engine) => { ships.forEach(ship =>{ if(ship.symbol==id_ship) { - $(".infos").html(""); - $(".infos").append(`Current system : ${ship.nav.systemSymbol}
`); - $(".infos").append(`Current waypoint : ${ship.nav.waypointSymbol}
`); - $(".infos").append(`Current status : ${ship.nav.status}
`); - $(".infos").append(`Flight mode : ${ship.nav.flightMode}
`); + $(".infos-ships").html(""); + $(".infos-ships").append(`Current system : ${ship.nav.systemSymbol}
`); + $(".infos-ships").append(`Current waypoint : ${ship.nav.waypointSymbol}
`); + $(".infos-ships").append(`Current status : ${ship.nav.status}
`); + $(".infos-ships").append(`Flight mode : ${ship.nav.flightMode}
`); } }) modal.show(); @@ -70,11 +69,11 @@ export default (temp_engine) => { ships.forEach(ship =>{ if(ship.symbol==id_ship) { - $(".infos").html(""); - $(".infos").append(`Current member : ${ship.crew.current}
`); - $(".infos").append(`Capacity : ${ship.crew.capacity}
`); - $(".infos").append(`required member : ${ship.crew.required}
`); - $(".infos").append(`Moral : ${ship.crew.morale}
`); + $(".infos-ships").html(""); + $(".infos-ships").append(`Current member : ${ship.crew.current}
`); + $(".infos-ships").append(`Capacity : ${ship.crew.capacity}
`); + $(".infos-ships").append(`required member : ${ship.crew.required}
`); + $(".infos-ships").append(`Moral : ${ship.crew.morale}
`); } }) modal.show(); @@ -84,13 +83,13 @@ export default (temp_engine) => { ships.forEach(ship =>{ if(ship.symbol==id_ship) { - $(".infos").html(""); - $(".infos").append(`Name : ${ship.frame.name}
`); - $(".infos").append(`Description : ${ship.frame.description}
`); - $(".infos").append(`Fuel capacity : ${ship.frame.fuelCapacity}
`); - $(".infos").append(`Condition : ${ship.frame.condition}
`); - $(".infos").append(`Power : ${ship.frame.requirements.power}
`); - $(".infos").append(`Crew : ${ship.frame.requirements.crew}
`); + $(".infos-ships").html(""); + $(".infos-ships").append(`Name : ${ship.frame.name}
`); + $(".infos-ships").append(`Description : ${ship.frame.description}
`); + $(".infos-ships").append(`Fuel capacity : ${ship.frame.fuelCapacity}
`); + $(".infos-ships").append(`Condition : ${ship.frame.condition}
`); + $(".infos-ships").append(`Power : ${ship.frame.requirements.power}
`); + $(".infos-ships").append(`Crew : ${ship.frame.requirements.crew}
`); } }) @@ -101,12 +100,12 @@ export default (temp_engine) => { ships.forEach(ship =>{ if(ship.symbol==id_ship) { - $(".infos").html(""); - $(".infos").append(`Name : ${ship.reactor.name}
`); - $(".infos").append(`Description : ${ship.reactor.description}
`); - $(".infos").append(`Condition : ${ship.reactor.condition}
`); - $(".infos").append(`Power : ${ship.reactor.powerOutput}
`); - $(".infos").append(`Crew : ${ship.reactor.requirements.crew}
`); + $(".infos-ships").html(""); + $(".infos-ships").append(`Name : ${ship.reactor.name}
`); + $(".infos-ships").append(`Description : ${ship.reactor.description}
`); + $(".infos-ships").append(`Condition : ${ship.reactor.condition}
`); + $(".infos-ships").append(`Power : ${ship.reactor.powerOutput}
`); + $(".infos-ships").append(`Crew : ${ship.reactor.requirements.crew}
`); } }) modal.show(); @@ -116,13 +115,13 @@ export default (temp_engine) => { ships.forEach(ship =>{ if(ship.symbol==id_ship) { - $(".infos").html(""); - $(".infos").append(`Name : ${ship.engine.name}
`); - $(".infos").append(`Description : ${ship.engine.description}
`); - $(".infos").append(`Condition : ${ship.engine.condition}
`); - $(".infos").append(`Speed : ${ship.engine.speed}
`); - $(".infos").append(`Crew : ${ship.engine.requirements.crew}
`); - $(".infos").append(`Power : ${ship.engine.requirements.power}
`); + $(".infos-ships").html(""); + $(".infos-ships").append(`Name : ${ship.engine.name}
`); + $(".infos-ships").append(`Description : ${ship.engine.description}
`); + $(".infos-ships").append(`Condition : ${ship.engine.condition}
`); + $(".infos-ships").append(`Speed : ${ship.engine.speed}
`); + $(".infos-ships").append(`Crew : ${ship.engine.requirements.crew}
`); + $(".infos-ships").append(`Power : ${ship.engine.requirements.power}
`); } }) modal.show(); @@ -132,24 +131,16 @@ export default (temp_engine) => { ships.forEach(ship =>{ if(ship.symbol==id_ship) { - $(".infos").html(""); - $(".infos").append(`current fuel : ${ship.fuel.current}
`); - $(".infos").append(`Description : ${ship.fuel.capacity}
`); - $(".infos").append(`Condition : ${ship.fuel.consumed.amount}
`); - $(".infos").append(`Speed : ${ship.fuel.consumed.timestamp}
`); + $(".infos-ships").html(""); + $(".infos-ships").append(`current fuel : ${ship.fuel.current}
`); + $(".infos-ships").append(`Description : ${ship.fuel.capacity}
`); + $(".infos-ships").append(`Condition : ${ship.fuel.consumed.amount}
`); + $(".infos-ships").append(`Speed : ${ship.fuel.consumed.timestamp}
`); } }) modal.show(); }); - $(".ships-list").on("click", (e) => { - const id_ship = $(e.target).attr("data-id"); - ships.forEach(ship =>{ - if(ship.symbol==id_ship) - { - } - }) - - }); + }); function showSlides(n) { @@ -162,19 +153,9 @@ export default (temp_engine) => { slides[i].style.display = "none"; } slides[slideIndex-1].style.display = "block"; - // let img = slideIndex[slideIndex - 1].children(".imgShip"); - // if (n > 0) - // { - // img.animate({left: '250px'}) - // } - // else - // { - - // } - } - temp_engine.add_event(".btn-close", "click", () => { + temp_engine.add_event(".btn-close-ships", "click", () => { modal.close(); }); temp_engine.add_event(".prev", "click", () => {