fix: I have a good feeling for relative imports this time

This commit is contained in:
Davide Passoni
2024-12-11 10:37:19 +01:00
parent dc7fd2c870
commit da2152f0e3
14 changed files with 20 additions and 20 deletions

View File

@@ -3,12 +3,12 @@
"short_name": "DCS Olympus", "short_name": "DCS Olympus",
"icons": [ "icons": [
{ {
"src": "/images/favicons/android-chrome-192x192.png", "src": "./images/favicons/android-chrome-192x192.png",
"sizes": "192x192", "sizes": "192x192",
"type": "image/png" "type": "image/png"
}, },
{ {
"src": "/images/favicons/android-chrome-512x512.png", "src": "./images/favicons/android-chrome-512x512.png",
"sizes": "512x512", "sizes": "512x512",
"type": "image/png" "type": "image/png"
} }

View File

@@ -31,7 +31,7 @@ export class ExplosionMarker extends CustomMarker {
var el = document.createElement("div"); var el = document.createElement("div");
el.classList.add("ol-explosion-icon"); el.classList.add("ol-explosion-icon");
var img = document.createElement("img"); var img = document.createElement("img");
img.src = "/images/markers/explosion.svg"; img.src = "./images/markers/explosion.svg";
img.onload = () => SVGInjector(img); img.onload = () => SVGInjector(img);
el.appendChild(img); el.appendChild(img);
this.getElement()?.appendChild(el); this.getElement()?.appendChild(el);

View File

@@ -28,7 +28,7 @@ export class SmokeMarker extends CustomMarker {
el.classList.add("ol-smoke-icon"); el.classList.add("ol-smoke-icon");
el.setAttribute("data-color", this.#color); el.setAttribute("data-color", this.#color);
var img = document.createElement("img"); var img = document.createElement("img");
img.src = "/images/markers/smoke.svg"; img.src = "./images/markers/smoke.svg";
img.onload = () => SVGInjector(img); img.onload = () => SVGInjector(img);
el.appendChild(img); el.appendChild(img);
this.getElement()?.appendChild(el); this.getElement()?.appendChild(el);

View File

@@ -56,7 +56,7 @@ export class TemporaryUnitMarker extends CustomMarker {
var unitIcon = document.createElement("div"); var unitIcon = document.createElement("div");
unitIcon.classList.add("unit-icon"); unitIcon.classList.add("unit-icon");
var img = document.createElement("img"); var img = document.createElement("img");
img.src = `/images/units/map/${getApp().getMap().getOptions().AWACSMode ? "awacs" : "normal"}/${this.#coalition}/${blueprint.markerFile ?? blueprint.category}.svg`; img.src = `./images/units/map/${getApp().getMap().getOptions().AWACSMode ? "awacs" : "normal"}/${this.#coalition}/${blueprint.markerFile ?? blueprint.category}.svg`;
img.onload = () => SVGInjector(img); img.onload = () => SVGInjector(img);
unitIcon.appendChild(img); unitIcon.appendChild(img);
unitIcon.toggleAttribute("data-rotate-to-heading", false); unitIcon.toggleAttribute("data-rotate-to-heading", false);

View File

@@ -67,7 +67,7 @@ export class Airbase extends CustomMarker {
el.classList.add("airbase-icon"); el.classList.add("airbase-icon");
el.setAttribute("data-object", "airbase"); el.setAttribute("data-object", "airbase");
this.#img.src = "/images/markers/airbase.svg"; this.#img.src = "./images/markers/airbase.svg";
this.#img.onload = () => SVGInjector(this.#img); this.#img.onload = () => SVGInjector(this.#img);
el.appendChild(this.#img); el.appendChild(this.#img);
this.getElement()?.appendChild(el); this.getElement()?.appendChild(el);

View File

@@ -23,7 +23,7 @@ export class Bullseye extends CustomMarker {
el.classList.add("bullseye-icon"); el.classList.add("bullseye-icon");
el.setAttribute("data-object", "bullseye"); el.setAttribute("data-object", "bullseye");
var img = document.createElement("img"); var img = document.createElement("img");
img.src = "/images/markers/bullseye.svg"; img.src = "./images/markers/bullseye.svg";
img.onload = () => SVGInjector(img); img.onload = () => SVGInjector(img);
el.appendChild(img); el.appendChild(img);
this.getElement()?.appendChild(el); this.getElement()?.appendChild(el);

View File

@@ -15,7 +15,7 @@ export class Carrier extends Airbase {
el.classList.add("airbase-icon"); el.classList.add("airbase-icon");
el.setAttribute("data-object", "airbase"); el.setAttribute("data-object", "airbase");
this.getImg().src = "/images/carriers/nimitz.png"; this.getImg().src = "./images/carriers/nimitz.png";
this.getImg().style.width = `0px`; // Make the image immediately small to avoid giant carriers this.getImg().style.width = `0px`; // Make the image immediately small to avoid giant carriers
el.appendChild(this.getImg()); el.appendChild(this.getImg());
this.getElement()?.appendChild(el); this.getElement()?.appendChild(el);

View File

@@ -44,7 +44,7 @@ export function OlUnitListEntry(props: {
invert invert
`}> `}>
<img <img
src={`/images/units/${props.silhouette}`} src={`./images/units/${props.silhouette}`}
className="my-auto max-h-full max-w-full" className="my-auto max-h-full max-w-full"
/> />
</div> </div>

View File

@@ -20,7 +20,7 @@ export function OlUnitSummary(props: { blueprint: UnitBlueprint; coalition: Coal
className={` className={`
absolute right-5 top-0 h-full object-cover opacity-10 invert absolute right-5 top-0 h-full object-cover opacity-10 invert
`} `}
src={"vite/images/units/" + props.blueprint.filename} src={"vite./images/units/" + props.blueprint.filename}
alt="" alt=""
/> />
<div <div

View File

@@ -94,7 +94,7 @@ export function LoginModal(props: { open: boolean }) {
max-md:border-none max-md:border-none
`} `}
> >
<img src="/images/splash/1.jpg" className={` <img src="./images/splash/1.jpg" className={`
contents-center w-full object-cover opacity-[7%] contents-center w-full object-cover opacity-[7%]
`}></img> `}></img>
<div <div
@@ -154,7 +154,7 @@ export function LoginModal(props: { open: boolean }) {
`} `}
> >
<span className="size-[80px] min-w-14"> <span className="size-[80px] min-w-14">
<img src="/images/olympus-500x500.png" className={` <img src="./images/olympus-500x500.png" className={`
flex w-full flex w-full
`}></img> `}></img>
</span> </span>
@@ -360,7 +360,7 @@ export function LoginModal(props: { open: boolean }) {
> >
<Card className="flex"> <Card className="flex">
<img <img
src="/images/splash/1.jpg" src="./images/splash/1.jpg"
className={` className={`
h-[40%] max-h-[120px] contents-center w-full rounded-md h-[40%] max-h-[120px] contents-center w-full rounded-md
object-cover object-cover
@@ -385,7 +385,7 @@ export function LoginModal(props: { open: boolean }) {
</Card> </Card>
<Card className="flex"> <Card className="flex">
<img <img
src="/images/splash/1.jpg" src="./images/splash/1.jpg"
className={` className={`
h-[40%] max-h-[120px] contents-center w-full rounded-md h-[40%] max-h-[120px] contents-center w-full rounded-md
object-cover object-cover

View File

@@ -349,7 +349,7 @@ export function FormationMenu(props: {
translate-y-[-50%] rotate-90 cursor-move opacity-80 translate-y-[-50%] rotate-90 cursor-move opacity-80
invert invert
`} `}
src={`/images/units/${unit?.getBlueprint()?.filename}`} src={`./images/units/${unit?.getBlueprint()?.filename}`}
></img> ></img>
</div> </div>
); );

View File

@@ -68,7 +68,7 @@ export function Header() {
dark:border-gray-800 dark:bg-olympus-900 dark:border-gray-800 dark:bg-olympus-900
`} `}
> >
<img src="images/icon.png" className={`my-auto h-10 w-10 rounded-md p-0`}></img> <img src="./images/icon.png" className={`my-auto h-10 w-10 rounded-md p-0`}></img>
{!scrolledLeft && ( {!scrolledLeft && (
<FaChevronLeft <FaChevronLeft
className={` className={`

View File

@@ -66,8 +66,8 @@ import {
const bearingStrings = ["north", "north-east", "east", "south-east", "south", "south-west", "west", "north-west", "north"]; const bearingStrings = ["north", "north-east", "east", "south-east", "south", "south-west", "west", "north-west", "north"];
var pathIcon = new Icon({ var pathIcon = new Icon({
iconUrl: "/images/markers/marker-icon.png", iconUrl: "./images/markers/marker-icon.png",
shadowUrl: "/images/markers/marker-shadow.png", shadowUrl: "./images/markers/marker-shadow.png",
iconAnchor: [13, 41], iconAnchor: [13, 41],
}); });
@@ -912,7 +912,7 @@ export abstract class Unit extends CustomMarker {
if (this.belongsToCommandedCoalition() || this.getDetectionMethods().some((value) => [VISUAL, OPTIC].includes(value))) if (this.belongsToCommandedCoalition() || this.getDetectionMethods().some((value) => [VISUAL, OPTIC].includes(value)))
marker = this.getBlueprint()?.markerFile ?? this.getDefaultMarker(); marker = this.getBlueprint()?.markerFile ?? this.getDefaultMarker();
else marker = "aircraft"; else marker = "aircraft";
img.src = `/images/units/map/${getApp().getMap().getOptions().AWACSMode ? "awacs" : "normal"}/${this.getCoalition()}/${marker}.svg`; img.src = `./images/units/map/${getApp().getMap().getOptions().AWACSMode ? "awacs" : "normal"}/${this.getCoalition()}/${marker}.svg`;
img.onload = () => SVGInjector(img); img.onload = () => SVGInjector(img);
unitIcon.appendChild(img); unitIcon.appendChild(img);

View File

@@ -178,7 +178,7 @@ export class Weapon extends CustomMarker {
var unitIcon = document.createElement("div"); var unitIcon = document.createElement("div");
unitIcon.classList.add("unit-icon"); unitIcon.classList.add("unit-icon");
var img = document.createElement("img"); var img = document.createElement("img");
img.src = `/images/units/map/${getApp().getMap().getOptions().AWACSMode ? "awacs" : "normal"}/${this.getCoalition()}/${this.getMarkerCategory()}.svg`; img.src = `./images/units/map/${getApp().getMap().getOptions().AWACSMode ? "awacs" : "normal"}/${this.getCoalition()}/${this.getMarkerCategory()}.svg`;
img.onload = () => SVGInjector(img); img.onload = () => SVGInjector(img);
unitIcon.appendChild(img); unitIcon.appendChild(img);
unitIcon.toggleAttribute("data-rotate-to-heading", this.getIconOptions().rotateToHeading); unitIcon.toggleAttribute("data-rotate-to-heading", this.getIconOptions().rotateToHeading);