Skip to content

Commit 70109b2

Browse files
committed
Move to nav-bar.ts and fix favicon links
1 parent 8b25288 commit 70109b2

11 files changed

Lines changed: 85 additions & 160 deletions

File tree

site/about/index.html

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta name="description" content="LegoFan9 SWGoH Tools - About">
88
<meta name="author" content="LegoFan9">
9-
<link rel="icon" href="../favicon.ico">
10-
<link rel="stylesheet" href="/src/nav-bar.css">
9+
<link rel="icon" href="/favicon.ico">
1110
<link rel="stylesheet" href="style.css">
1211
<title>LegoFan9 Tools</title>
1312
<!-- Google tag (gtag.js) -->
@@ -22,36 +21,21 @@
2221
</head>
2322

2423
<body>
25-
<header>
26-
<nav>
27-
<div class="nav-container">
28-
<div class="logo">SWGoH Updates</div>
29-
<button class="menu-toggle" aria-label="Toggle menu"></button>
30-
<ul class="nav-links">
31-
<li><a href="javascript:history.back()">Back</a></li>
32-
<li><a href="/">Home</a></li>
33-
<li><a href="/swgoh-portrait-maker/">SWGoH Portrait Maker</a></li>
34-
<li><a href="/swgoh-updates/">SWGoH Updates</a></li>
35-
<li><a href="/about/">About</a></li>
36-
</ul>
37-
</div>
38-
</nav>
39-
</header>
40-
<div style="height: 65px;"></div>
24+
<nav></nav>
4125

4226
<p>Hi! I'm LegoFan9, I made this site originally for portrait maker, however I have since added numerous tools. Here
4327
are some of the ones I find most worth sharing</p>
4428
<ul>
4529
<li><a href="../swgoh-updates/">Update Notifier</a> A discord based automatic datamining tool for SWGoH</li>
46-
<li><a href="../swgoh-portrait-maker/">SWGoH Portrait Maker</a> A tool that overlays custom SWGoH style borders over your images</li>
47-
<li><a href="https://github.com/Lego-Fan9/swgoh-assetapi">SWGoH AssetAPI</a> An asset datamining tool for SWGoH</li>
48-
<li><a href="../swgoh-updates/sprite-downloads/">SWGoH Sprite Cutter</a> A tool that datamines SWGoH sprites. Closed source, but you can download
30+
<li><a href="../swgoh-portrait-maker/">SWGoH Portrait Maker</a> A tool that overlays custom SWGoH style borders
31+
over your images</li>
32+
<li><a href="https://github.com/Lego-Fan9/swgoh-assetapi">SWGoH AssetAPI</a> An asset datamining tool for SWGoH
33+
</li>
34+
<li><a href="../swgoh-updates/sprite-downloads/">SWGoH Sprite Cutter</a> A tool that datamines SWGoH sprites.
35+
Closed source, but you can download
4936
assets</li>
5037
</ul>
5138
<p>There are more plans for the future, but for now I think thats all. MTFBWY</p>
52-
<script>
53-
document.querySelector(".menu-toggle").addEventListener("click", () => {
54-
document.querySelector(".nav-links").classList.toggle("show");
55-
});
56-
</script>
39+
40+
<script type="module" src="/src/nav-bar.ts"></script>
5741
</body>

site/account-viewer/index.html

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,7 @@
99

1010
<body>
1111
<main class="dashboard">
12-
<nav>
13-
<div class="nav-container">
14-
<div class="logo">SWGoH Updates</div>
15-
<button class="menu-toggle" aria-label="Toggle menu"></button>
16-
<ul class="nav-links">
17-
<li><a href="javascript:history.back()">Back</a></li>
18-
<li><a href="/">Home</a></li>
19-
<li><a href="../swgoh-portrait-maker/">SWGoH Portrait Maker</a></li>
20-
<li><a href="../swgoh-updates/">SWGoH Updates</a></li>
21-
<li><a href="../about/">About</a></li>
22-
</ul>
23-
</div>
24-
</nav>
25-
<div id="gap-1" style="height:5px;"></div>
12+
<nav></nav>
2613

2714
<section class="allycode-input card">
2815
<h2>Enter AllyCode</h2>
@@ -114,11 +101,7 @@ <h2>Terms and Conditions</h2>
114101
</footer>
115102

116103
<script type="module" src="/src/account-viewer/main.ts"></script>
117-
<script>
118-
document.querySelector(".menu-toggle").addEventListener("click", () => {
119-
document.querySelector(".nav-links").classList.toggle("show");
120-
});
121-
</script>
104+
<script type="module" src="/src/nav-bar.ts"></script>
122105
</body>
123106

124107
</html>

site/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<meta name="description" content="LegoFan9's Star Wars: Galaxy of Heroes Tools">
88
<meta name="author" content="LegoFan9">
99
<link rel="icon" href="/favicon.ico" type="image/x-icon">
10-
<link rel="stylesheet" href="src/nav-bar.css">
1110
<title>LegoFan9's SWGoH Tools</title>
1211
<style>
1312
body {

site/src/account-viewer/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import './style.css';
2-
import '/src/nav-bar.css'
32
import { FillList } from "./listBuilder.ts";
43
import { cleanAllyCode, wakeServer } from "./requestMaker.ts"
54
import { Chart } from "chart.js"

site/src/nav-bar.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import "./nav-bar.css";
2+
3+
const nav = document.querySelector('nav');
4+
5+
if (nav) {
6+
const navContainer = document.createElement('div');
7+
navContainer.className = 'nav-container';
8+
9+
const logo = document.createElement('div');
10+
logo.className = 'logo';
11+
logo.textContent = 'SWGoH Updates';
12+
navContainer.appendChild(logo);
13+
14+
const menuToggle = document.createElement('button');
15+
menuToggle.className = 'menu-toggle';
16+
menuToggle.setAttribute('aria-label', 'Toggle menu');
17+
menuToggle.textContent = '☰';
18+
navContainer.appendChild(menuToggle);
19+
20+
const navLinks = document.createElement('ul');
21+
navLinks.className = 'nav-links';
22+
23+
const links: { href: string; text: string }[] = [
24+
{ href: 'javascript:history.back()', text: 'Back' },
25+
{ href: '/', text: 'Home' },
26+
{ href: '../swgoh-portrait-maker/', text: 'SWGoH Portrait Maker' },
27+
{ href: '../swgoh-updates/', text: 'SWGoH Updates' },
28+
{ href: '../about/', text: 'About' },
29+
];
30+
31+
links.forEach(link => {
32+
const li = document.createElement('li');
33+
const a = document.createElement('a');
34+
a.href = link.href;
35+
a.textContent = link.text;
36+
li.appendChild(a);
37+
navLinks.appendChild(li);
38+
});
39+
40+
navContainer.appendChild(navLinks);
41+
42+
nav.appendChild(navContainer);
43+
44+
document.querySelector(".menu-toggle")?.addEventListener("click", () => {
45+
document.querySelector(".nav-links")?.classList.toggle("show");
46+
});
47+
48+
adjustBodyPadding();
49+
window.addEventListener('resize', adjustBodyPadding);
50+
}
51+
52+
function adjustBodyPadding() {
53+
const nav = document.querySelector('nav');
54+
if (nav) {
55+
document.body.style.paddingTop = `${nav.offsetHeight}px`;
56+
}
57+
}

site/swgoh-portrait-maker/index.html

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<meta name="description" content="SWGoH Portrait Maker - Create custom portraits for your favorite characters.">
88
<meta name="author" content="LegoFan9">
99
<link rel="icon" href="/favicon.ico" type="image/x-icon">
10-
<link rel="stylesheet" href="/src/nav-bar.css">
1110
<title>SWGoH Portrait Maker</title>
1211
<link rel="stylesheet" href="style.css">
1312
<script src="https://cdnjs.cloudflare.com/ajax/libs/dom-to-image/2.6.0/dom-to-image.min.js"></script>
@@ -23,22 +22,7 @@
2322
</head>
2423

2524
<body>
26-
<header>
27-
<nav>
28-
<div class="nav-container">
29-
<div class="logo">SWGoH Updates</div>
30-
<button class="menu-toggle" aria-label="Toggle menu"></button>
31-
<ul class="nav-links">
32-
<li><a href="javascript:history.back()">Back</a></li>
33-
<li><a href="/">Home</a></li>
34-
<li><a href="/swgoh-portrait-maker/">SWGoH Portrait Maker</a></li>
35-
<li><a href="/swgoh-updates/">SWGoH Updates</a></li>
36-
<li><a href="/about/">About</a></li>
37-
</ul>
38-
</div>
39-
</nav>
40-
<div id="top-gap" style="height: 45px;"></div>
41-
</header>
25+
<nav></nav>
4226
<main>
4327
<h1>SWGOH Portrait Maker</h1>
4428
<h1 class="uploadText">Upload Your Image Here:</h1>
@@ -137,7 +121,7 @@ <h1 class="uploadText" id="imageDownloadText" style="display: none;">Now downloa
137121
<a id="downloadLinkM" onclick="mobileDownload()" style="display: none;">Download Result(Mobile)</a>
138122
<p id="downloadLinkMDesc" style="display: none;">Hold down on the image then click save to photos</p>
139123
<div style="height: 50px;"></div>
140-
124+
141125
<div id="termsModal" style="display: none;" class="modal-overlay">
142126
<div class="modal-content">
143127
<h2>Before You Continue</h2>
@@ -191,11 +175,7 @@ <h2 style="margin-top:0;">Notice</h2>
191175
<div id="debugGapC" style="height: 30px; display: none;"></div>
192176
</footer>
193177
<script src="/src/portraitMaker.js" type="module"></script>
194-
<script>
195-
document.querySelector(".menu-toggle").addEventListener("click", () => {
196-
document.querySelector(".nav-links").classList.toggle("show");
197-
});
198-
</script>
178+
<script type="module" src="/src/nav-bar.ts"></script>
199179
</body>
200180

201181
</html>

site/swgoh-portrait-maker/terms.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
77
<meta name="description" content="Terms of Service and Privacy Policy for LegoFan9's swgoh-portrait-maker tool">
88
<meta name="author" content="LegoFan9">
9-
<link rel="icon" href="../favicon.ico" type="image/x-icon">
9+
<link rel="icon" href="/favicon.ico" type="image/x-icon">
1010
<title>Terms of Service - swgoh-portrait-maker</title>
1111
<style>
1212
body {
@@ -46,6 +46,7 @@
4646

4747
<body>
4848
<header>
49+
<nav></nav>
4950
<h1>swgoh-portrait-maker</h1>
5051
<h2>Terms of Service</h2>
5152
<p><em>Last Updated: 6/1/2025</em></p>
@@ -127,6 +128,7 @@ <h3>6. Contact</h3>
127128

128129
</div>
129130
</main>
131+
<script type="module" src="/src/nav-bar.ts"></script>
130132
</body>
131133

132134
</html>

site/swgoh-updates/index.html

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<meta name="description" content="SWGoH Updates - Automatic datamine tool for SWGoH">
88
<meta name="author" content="LegoFan9">
99
<link rel="icon" href="swgoh-updates-icon.webp">
10-
<link rel="stylesheet" href="/src/nav-bar.css">
1110
<link rel="stylesheet" href="style.css">
1211
<title>SWGoH Updates</title>
1312
<!-- Google tag (gtag.js) -->
@@ -22,21 +21,7 @@
2221
</head>
2322

2423
<body>
25-
<header>
26-
<nav>
27-
<div class="nav-container">
28-
<div class="logo">SWGoH Updates</div>
29-
<button class="menu-toggle" aria-label="Toggle menu"></button>
30-
<ul class="nav-links">
31-
<li><a href="javascript:history.back()">Back</a></li>
32-
<li><a href="/">Home</a></li>
33-
<li><a href="/swgoh-portrait-maker/">SWGoH Portrait Maker</a></li>
34-
<li><a href="/swgoh-updates/">SWGoH Updates</a></li>
35-
<li><a href="/about/">About</a></li>
36-
</ul>
37-
</div>
38-
</nav>
39-
</header>
24+
<nav></nav>
4025
<h1>SWGoH Updates</h1>
4126
<p>SWGoH Updates provides datamined information as soon as it becomes available. Join the Discord to see it in
4227
action!</p>
@@ -62,11 +47,7 @@ <h1>SWGoH Updates</h1>
6247
<a class="app-link" href="sprite-downloads/" style="margin-top: auto;">Open</a>
6348
</div>
6449
</div>
65-
<script>
66-
document.querySelector(".menu-toggle").addEventListener("click", () => {
67-
document.querySelector(".nav-links").classList.toggle("show");
68-
});
69-
</script>
50+
<script type="module" src="/src/nav-bar.ts"></script>
7051
</body>
7152

7253
</html>

site/swgoh-updates/loc-bundle-format/index.html

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<meta name="author" content="LegoFan9">
99
<link rel="icon" href="../swgoh-updates-icon.webp">
1010
<link rel="stylesheet" href="style.css">
11-
<link rel="stylesheet" href="../../src/nav-bar.css">
1211
<title>SWGoH Updates Formatter</title>
1312
<!-- Google tag (gtag.js) -->
1413
<script async src="https://www.googletagmanager.com/gtag/js?id=G-X7TKZ22H21"></script>
@@ -22,22 +21,7 @@
2221
</head>
2322

2423
<body>
25-
<header>
26-
<nav>
27-
<div class="nav-container">
28-
<div class="logo">SWGoH Updates</div>
29-
<button class="menu-toggle" aria-label="Toggle menu"></button>
30-
<ul class="nav-links">
31-
<li><a href="javascript:history.back()">Back</a></li>
32-
<li><a href="/">Home</a></li>
33-
<li><a href="/swgoh-portrait-maker/">SWGoH Portrait Maker</a></li>
34-
<li><a href="/swgoh-updates/">SWGoH Updates</a></li>
35-
<li><a href="/about/">About</a></li>
36-
</ul>
37-
</div>
38-
</nav>
39-
<div style="height: 30px;"></div>
40-
</header>
24+
<nav></nav>
4125
<h1>SWGoH Localization Bundle Formatter</h1>
4226
<div class="main-card">
4327
<textarea id="inputText" placeholder="Paste your localization string here..."
@@ -62,9 +46,5 @@ <h1>SWGoH Localization Bundle Formatter</h1>
6246
&copy; 2025 LegoFan9. All rights reserved.
6347
</footer>
6448
<script src="/src/locFormat.js" type="module"></script>
65-
<script>
66-
document.querySelector(".menu-toggle").addEventListener("click", () => {
67-
document.querySelector(".nav-links").classList.toggle("show");
68-
});
69-
</script>
49+
<script type="module" src="/src/nav-bar.ts"></script>
7050
</body>

site/swgoh-updates/sprite-downloads/download.html

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
<meta name="description" content="SWGoH Sprite Downloads">
88
<meta name="author" content="LegoFan9">
99
<title>Download Sprites</title>
10-
<link rel="icon" href="../../favicon.ico" type="image/x-icon">
10+
<link rel="icon" href="/favicon.ico" type="image/x-icon">
1111
<link rel="stylesheet" href="style.css">
12-
<link rel="stylesheet" href="/src/nav-bar.css">
1312
<!-- Google tag (gtag.js) -->
1413
<script async src="https://www.googletagmanager.com/gtag/js?id=G-X7TKZ22H21"></script>
1514
<script>
@@ -22,33 +21,14 @@
2221
</head>
2322

2423
<body>
25-
<header>
26-
<nav>
27-
<div class="nav-container">
28-
<div class="logo">SWGoH Updates</div>
29-
<button class="menu-toggle" aria-label="Toggle menu"></button>
30-
<ul class="nav-links">
31-
<li><a href="javascript:history.back()">Back</a></li>
32-
<li><a href="/">Home</a></li>
33-
<li><a href="/swgoh-portrait-maker/">SWGoH Portrait Maker</a></li>
34-
<li><a href="/swgoh-updates/">SWGoH Updates</a></li>
35-
<li><a href="/about/">About</a></li>
36-
</ul>
37-
</div>
38-
</nav>
39-
<div style="height: 25px;"></div>
40-
</header>
24+
<nav></nav>
4125
<main>
4226
<p id="status">Waking server...</p>
4327
<p id="checksumInfo"></p>
4428
<button id="startDownloadBtn" class="app-link" disabled style="display: none;">Start Download</button>
4529
</main>
4630

47-
<script>
48-
document.querySelector(".menu-toggle").addEventListener("click", () => {
49-
document.querySelector(".nav-links").classList.toggle("show");
50-
});
51-
</script>
31+
<script type="module" src="/src/nav-bar.ts"></script>
5232

5333
<script>
5434
const baseDownloadURL = "https://legofan9-sprite-server.onrender.com";

0 commit comments

Comments
 (0)