Skip to content

Commit

Permalink
refactor(client): use relative paths
Browse files Browse the repository at this point in the history
  • Loading branch information
leia-uwu committed Sep 14, 2023
1 parent 0296dc1 commit 8366c71
Show file tree
Hide file tree
Showing 14 changed files with 67 additions and 67 deletions.
8 changes: 4 additions & 4 deletions client/src/pages/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
<title>Suroi - Changelog</title>

<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/svg+xml" sizes="any" href="/img/logos/suroi_small.svg">
<link rel="icon" type="image/svg+xml" sizes="any" href="./img/logos/suroi_small.svg">

<link rel="icon" type="image/x-icon" sizes="16x16" href="/img/logos/suroi_16x16.png">
<link rel="icon" type="image/x-icon" sizes="32x32" href="/img/logos/suroi_32x32.png">
<link rel="icon" type="image/x-icon" sizes="96x96" href="/img/logos/suroi_96x96.png">
<link rel="icon" type="image/x-icon" sizes="16x16" href="./img/logos/suroi_16x16.png">
<link rel="icon" type="image/x-icon" sizes="32x32" href="./img/logos/suroi_32x32.png">
<link rel="icon" type="image/x-icon" sizes="96x96" href="./img/logos/suroi_96x96.png">
</head>

<body>
Expand Down
36 changes: 18 additions & 18 deletions client/src/pages/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@
<title>Suroi - 2D battle royale game</title>

<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/svg+xml" sizes="any" href="/img/logos/suroi_small.svg">
<link rel="icon" type="image/svg+xml" sizes="any" href="./img/logos/suroi_small.svg">

<link rel="icon" type="image/x-icon" sizes="16x16" href="/img/logos/suroi_16x16.png">
<link rel="icon" type="image/x-icon" sizes="32x32" href="/img/logos/suroi_32x32.png">
<link rel="icon" type="image/x-icon" sizes="96x96" href="/img/logos/suroi_96x96.png">
<link rel="icon" type="image/x-icon" sizes="16x16" href="./img/logos/suroi_16x16.png">
<link rel="icon" type="image/x-icon" sizes="32x32" href="./img/logos/suroi_32x32.png">
<link rel="icon" type="image/x-icon" sizes="96x96" href="./img/logos/suroi_96x96.png">
</head>
<body>
<div id="splash-ui">
<div id="splash-logo">
<img src="/img/logos/suroi.svg" alt="Suroi logo" draggable="false">
<img src="./img/logos/suroi.svg" alt="Suroi logo" draggable="false">
</div>
<div id="splash-modals">
<div id="splash-news">
<h2>
<a href="/news">
<a href="./news">
<i class="fa-solid fa-newspaper"></i>
News
<i class="fa-solid fa-arrow-up-right-from-square"></i>
Expand Down Expand Up @@ -92,14 +92,14 @@ <h2>
<div class="featured-container">
<p class="featured-heading">Featured YouTubr</p>
<a class="featured-content" id="youtube-featured-content" href="" target="_blank">
<img class="featured-logo" src="/img/misc/youtube-icon.svg" alt="YouTube icon">
<img class="featured-logo" src="./img/misc/youtube-icon.svg" alt="YouTube icon">
<span class="featured-name" id="youtube-featured-name"></span>
</a>
</div>
<div class="featured-container">
<p class="featured-heading">Featured Streamr</p>
<a class="featured-content" id="twitch-featured-content" target="_blank" href="">
<img class="featured-logo" src="/img/misc/twitch-icon.svg" alt="Twitch icon">
<img class="featured-logo" src="./img/misc/twitch-icon.svg" alt="Twitch icon">
<span class="featured-name" id="twitch-featured-name"></span>
</a>
</div>
Expand All @@ -114,15 +114,15 @@ <h2>
Wiki
<i class="fa-solid fa-arrow-up-right-from-square"></i>
</a>
<a href="/proxy.txt" target="_blank" rel="noopener noreferrer">
<a href="./proxy.txt" target="_blank" rel="noopener noreferrer">
Proxies
<i class="fa-solid fa-arrow-up-right-from-square"></i>
</a>
<a href="/leaderboard" target="_blank" rel="noopener noreferrer">
<a href="./leaderboard" target="_blank" rel="noopener noreferrer">
Leaderboard
<i class="fa-solid fa-arrow-up-right-from-square"></i>
</a>
<a href="/news" target="_blank" rel="noopener noreferrer">
<a href="./news" target="_blank" rel="noopener noreferrer">
News
<i class="fa-solid fa-arrow-up-right-from-square"></i>
</a>
Expand All @@ -131,7 +131,7 @@ <h2>
</div>
<div>
<div id="splash-backlinks">
<a href="/changelog" target="_blank" rel="noopener noreferrer">v<%=APP_VERSION%></a>
<a href="./changelog" target="_blank" rel="noopener noreferrer">v<%=APP_VERSION%></a>
</div>
<div id="splash-settings">
<button style="display: none;" class="btn btn-darken btn-secondary" id="btn-language"><i class="fa-solid fa-earth-americas"></i></button>
Expand All @@ -153,12 +153,12 @@ <h2>
<div style="display: flex; flex-direction: column; gap: 5px">
<button class="btn btn-lg btn-primary fa-solid fa-bars" style="display: none; margin-left: 5px" id="btn-game-menu"></button>
<button class="btn btn-lg btn-primary" id="btn-emotes" style="display: none; margin-left: 5px">
<img src="/img/misc/emotes_icon.svg" style="margin-bottom: -3px">
<img src="./img/misc/emotes_icon.svg" style="margin-bottom: -3px">
</button>
</div>
</div>
<div id="gas-timer">
<img id="gas-timer-image" src="/img/misc/gas-waiting-icon.svg">
<img id="gas-timer-image" src="./img/misc/gas-waiting-icon.svg">
<span id="gas-timer-text">0:00</span>
</div>
<div id="debug-hud">
Expand All @@ -170,11 +170,11 @@ <h2>
</div>
<div class="ui-leaderboard">
<div class="counter">
<img src="/img/misc/player_icon.svg">
<img src="./img/misc/player_icon.svg">
<div class="counter-text" id="ui-players-alive">1</div>
</div>
<div class="counter" id="kill-counter" style="margin-top: 5px; display: none">
<img src="/img/misc/skull_icon.svg">
<img src="./img/misc/skull_icon.svg">
<div class="counter-text" id="ui-kills">0</div>
</div>
<div id="kill-feed"></div>
Expand Down Expand Up @@ -490,8 +490,8 @@ <h3>Customize</h3>
</div>
<div id="customize-tabs-container">
<div class="tab-bar" id="customize-tab-bar">
<button class="tab active" id="tab-skins"><img src="/img/misc/player_icon.svg">Skins</button>
<button class="tab" id="tab-emotes"><img src="/img/misc/emotes_icon.svg">Emotes</button>
<button class="tab active" id="tab-skins"><img src="./img/misc/player_icon.svg">Skins</button>
<button class="tab" id="tab-emotes"><img src="./img/misc/emotes_icon.svg">Emotes</button>
</div>
<div id="customize-tabs">
<div class="tab-content active" id="tab-skins-content">
Expand Down
8 changes: 4 additions & 4 deletions client/src/pages/leaderboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<title>Suroi - Leaderboard</title>

<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/svg+xml" sizes="any" href="/img/logos/suroi_small.svg">
<link rel="icon" type="image/svg+xml" sizes="any" href="./img/logos/suroi_small.svg">

<link rel="icon" type="image/x-icon" sizes="16x16" href="/img/logos/suroi_16x16.png">
<link rel="icon" type="image/x-icon" sizes="32x32" href="/img/logos/suroi_32x32.png">
<link rel="icon" type="image/x-icon" sizes="96x96" href="/img/logos/suroi_96x96.png">
<link rel="icon" type="image/x-icon" sizes="16x16" href="./img/logos/suroi_16x16.png">
<link rel="icon" type="image/x-icon" sizes="32x32" href="./img/logos/suroi_32x32.png">
<link rel="icon" type="image/x-icon" sizes="96x96" href="./img/logos/suroi_96x96.png">
</head>
<body></body>
</html>
12 changes: 6 additions & 6 deletions client/src/pages/news.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
<title>Suroi - News</title>

<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/svg+xml" sizes="any" href="/img/logos/suroi_small.svg">
<link rel="icon" type="image/svg+xml" sizes="any" href="./img/logos/suroi_small.svg">

<link rel="icon" type="image/x-icon" sizes="16x16" href="/img/logos/suroi_16x16.png">
<link rel="icon" type="image/x-icon" sizes="32x32" href="/img/logos/suroi_32x32.png">
<link rel="icon" type="image/x-icon" sizes="96x96" href="/img/logos/suroi_96x96.png">
<link rel="icon" type="image/x-icon" sizes="16x16" href="./img/logos/suroi_16x16.png">
<link rel="icon" type="image/x-icon" sizes="32x32" href="./img/logos/suroi_32x32.png">
<link rel="icon" type="image/x-icon" sizes="96x96" href="./img/logos/suroi_96x96.png">
</head>
<body>
<div id="splash-logo">
<a href="/" title="Play Game (Return Home)">
<img src="/img/logos/suroi.svg" alt="Suroi logo" draggable="false">
<a href="../" title="Play Game (Return Home)">
<img src="./img/logos/suroi.svg" alt="Suroi logo" draggable="false">
</a>
</div>
<div id="news-page">
Expand Down
12 changes: 6 additions & 6 deletions client/src/pages/rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@
<title>Suroi - Rules & Tutorial</title>

<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="icon" type="image/svg+xml" sizes="any" href="/img/logos/suroi_small.svg">
<link rel="icon" type="image/svg+xml" sizes="any" href="./img/logos/suroi_small.svg">

<link rel="icon" type="image/x-icon" sizes="16x16" href="/img/logos/suroi_16x16.png">
<link rel="icon" type="image/x-icon" sizes="32x32" href="/img/logos/suroi_32x32.png">
<link rel="icon" type="image/x-icon" sizes="96x96" href="/img/logos/suroi_96x96.png">
<link rel="icon" type="image/x-icon" sizes="16x16" href="./img/logos/suroi_16x16.png">
<link rel="icon" type="image/x-icon" sizes="32x32" href="./img/logos/suroi_32x32.png">
<link rel="icon" type="image/x-icon" sizes="96x96" href="./img/logos/suroi_96x96.png">
</head>
<body>
<div id="splash-logo">
<a href="/" title="Play Game (Return Home)">
<img src="/img/logos/suroi.svg" alt="Suroi logo" draggable="false">
<a href="../" title="Play Game (Return Home)">
<img src="./img/logos/suroi.svg" alt="Suroi logo" draggable="false">
</a>
</div>
<div id="news-page">
Expand Down
2 changes: 1 addition & 1 deletion client/src/scripts/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export class Game {
prepareInteractText();

if (canInteract) {
$("#interact-key").html('<img src="/img/misc/tap-icon.svg" alt="Tap">').addClass("active").show();
$("#interact-key").html('<img src="./img/misc/tap-icon.svg" alt="Tap">').addClass("active").show();
} else {
$("#interact-key").removeClass("active").hide();
}
Expand Down
14 changes: 7 additions & 7 deletions client/src/scripts/news/newsPosts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const news: NewsPost[] = [
date: 1694706686000,
author: "HAZEL",
title: "Back with a Bang",
bannerImage: "/img/news/v0.10.0.png",
bannerImage: "./img/news/v0.10.0.png",
content: `Despite the construction delays, we're back on the island to officially open the newest building: the refinery! Full of plenty of loot, but watch out or the whole place could go ka-boom...<br><br>
We're also happy to announce a large shipment containing 4 new types of guns, including two new DMRs! One gun is Italian, and three are American. Sources indicate the new LMG is particularly potent...<br><br>
Expand Down Expand Up @@ -43,7 +43,7 @@ Special thanks to Leia and platonthek. This update wouldn't have been possible w
date: 1690748181000,
author: "HAZEL",
title: "Behind Closed Doors",
bannerImage: "/img/news/v0.9.0.png",
bannerImage: "./img/news/v0.9.0.png",
content: `We at HAZEL are proud to announce the construction of 3 new structures on the island. The cozy house is a great place to spend the night…although you’ll want to leave before the gas catches you. The warehouse, though abandoned, still contains some unopened shipments, just waiting to be looted. Lastly, if you need to do some “business”, there are plenty of porta potties around for that purpose.<br><br>
There are also two new Austrian arrivals to the island. Like the Micro Uzi but want something that packs more of a punch? The Steyr AUG might be for you. If you prefer a challenge, grab the all-new full auto pistol, the CZ-75A.<br><br>
Expand Down Expand Up @@ -137,7 +137,7 @@ Surians can now customize their skins, and express themselves with emotes too! E
date: 1687625334000,
author: "HAZEL",
title: "Locked & Loaded",
bannerImage: "/img/news/v0.5.0.png",
bannerImage: "./img/news/v0.5.0.png",
content: `The newest supply shipment to the island has arrived, along with a slew of new weapons! Blast enemies all day long with the 47 round pan on the Lewis gun, or test your marksmanship with the Tango 51. Prefer hand-to-hand combat? The K-bar or the baseball bat may be for you. A glint of gold may yield a fruitful surprise...`,
longContent: `<h2>Suroi v0.5.0</h2>
Expand All @@ -155,7 +155,7 @@ Surians can now customize their skins, and express themselves with emotes too! E
date: 1687026036000,
author: "Dr. Felix Sterling",
title: "Supplies received",
bannerImage: "/img/news/v0.4.0.png",
bannerImage: "./img/news/v0.4.0.png",
content: `We have received the new arms and supply shipment from Mr. Flint. In the crates were all four weapons promised: the Mosin-Nagant, Ithaca Model 37, SAF-200, and Glock 19. These should help us dramatically, as we were in great need of additional and varied firepower. Additionally, the new medical items, gauze, colas, and medikits, will allow better treatment of injuries. However, they were not of the portable variety we requested, and we hope to resolve this soon.`,
longContent: `<h2>Suroi v0.4.0</h2>
Expand All @@ -182,7 +182,7 @@ Surians can now customize their skins, and express themselves with emotes too! E
date: 1685914769000,
author: "Dr. Petrova",
title: "2, 8, 18, 7",
bannerImage: "/img/news/v0.3.0.png",
bannerImage: "./img/news/v0.3.0.png",
content: `A mysterious orange gas is now being reported around the island. We collected a sample and were able to convert it to a solid at -7.2°C, but found it to be very toxic. You’ve been warned! In other news, if you’re the last one on the island left, you’ll get your very own chicken dinner courtesy of HAZEL, the perfect meal to enjoy your victory!`,
longContent: `<h2>Suroi v0.3.0</h2>
<h3>New features</h3>
Expand All @@ -205,7 +205,7 @@ Surians can now customize their skins, and express themselves with emotes too! E
date: 1685317752000,
author: "hasanger",
title: "Fun guns",
bannerImage: "/img/news/v0.2.0.png",
bannerImage: "./img/news/v0.2.0.png",
content: `This week's update introduces guns, health crates, and keybinds! There are only 2 guns for now: the AK-47 and the M3K. More will be added soon.<br>If you're having issues with textures, try <a href="https://its.uiowa.edu/support/article/719">clearing your cache.</a>`,
longContent: `<h2>Suroi v0.2.0</h2>
<h3>New features</h3>
Expand All @@ -224,7 +224,7 @@ Surians can now customize their skins, and express themselves with emotes too! E
date: 1684625426000,
author: "hasanger",
title: "We're back, baby",
bannerImage: "/img/news/v0.1.0.png",
bannerImage: "./img/news/v0.1.0.png",
content: `Kongregate may have shut down Surviv Reloaded, but that's not gonna stop me! Today, I'm releasing the first ever beta version of Suroi, an open-source 2D battle royale game inspired by surviv.io.
To report a bug or suggest something, <a href="https://discord.suroi.io" target="_blank" rel="noopener noreferrer">join the Discord server</a>. If you have any questions, check out the FAQ on <a href="https://suroi.io/news" target="_blank" rel="noopener noreferrer">the news page</a>.`,
longContent: `<h2>FAQ</h2>
Expand Down
2 changes: 1 addition & 1 deletion client/src/scripts/objects/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ export class Player extends GameObject<ObjectCategory.Player> {
if (level > 0) {
const definition = definitions[equipmentType === "backpack" ? level : level - 1];
container.children(".item-name").text(`Lvl. ${level}`);
container.children(".item-image").attr("src", `/img/game/loot/${definition.idString}.svg`);
container.children(".item-image").attr("src", `./img/game/loot/${definition.idString}.svg`);

let itemTooltip = definition.name;
if (equipmentType === "helmet" || equipmentType === "vest") {
Expand Down
2 changes: 1 addition & 1 deletion client/src/scripts/packets/receiving/joinedPacket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class JoinedPacket extends ReceivingPacket {
const emoteSelectors = [".emote-top", ".emote-right", ".emote-bottom", ".emote-left"];
for (let i = 0; i < 4; i++) {
const emoteType = stream.readObjectTypeNoCategory(ObjectCategory.Emote);
$(`#emote-wheel > ${emoteSelectors[i]}`).css("background-image", `url("/img/game/emotes/${emoteType.idString}.svg")`);
$(`#emote-wheel > ${emoteSelectors[i]}`).css("background-image", `url("./img/game/emotes/${emoteType.idString}.svg")`);
}
$("canvas").addClass("active");
$("#splash-ui").fadeOut(enablePlayButton);
Expand Down
4 changes: 2 additions & 2 deletions client/src/scripts/packets/receiving/updatePacket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ export class UpdatePacket extends ReceivingPacket {

if (game.gas.state === GasState.Advancing) {
$("#gas-timer").addClass("advancing");
$("#gas-timer-image").attr("src", "/img/misc/gas-advancing-icon.svg");
$("#gas-timer-image").attr("src", "./img/misc/gas-advancing-icon.svg");
} else {
$("#gas-timer").removeClass("advancing");
$("#gas-timer-image").attr("src", "/img/misc/gas-waiting-icon.svg");
$("#gas-timer-image").attr("src", "./img/misc/gas-waiting-icon.svg");
}

if ((game.gas.state === GasState.Inactive || game.gas.initialDuration !== 0) && !UI_DEBUG_MODE) {
Expand Down
Loading

0 comments on commit 8366c71

Please sign in to comment.