Skip to content

Commit bbd1b39

Browse files
authored
Merge pull request #8 from Lego-Fan9/Prepare-v1.1.1
Prepare v1.1.1
2 parents 2d2952b + 22381a0 commit bbd1b39

6 files changed

Lines changed: 20 additions & 175 deletions

File tree

.github/workflows/docker-publish.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

.github/workflows/docker-push.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

swgoh-portrait-maker/index.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@
2626
<div id="announcement-bar" style="display: none;">
2727
<div id="announcement-content">
2828
<div class="announcement-text-wrapper">
29-
<span>Version 1.1.0 is now out!</span><br>
30-
<span>This version brings 2 new upload options!</span><br>
31-
<span>Because of those new upload options we have updates or Terms of Service</span><br>
32-
<span>Another change is that Relic 0 will no longer display a relic badge at all</span><br>
33-
<span>Credit to Hyredrum for thinking of that change</span>
29+
<span>Version 1.1.1 is now out!</span><br>
30+
<span>This version fixes a couple UI elements</span><br>
31+
<span>It also now outputs images as webp instead of png</span>
3432
</div>
3533
<button id="close-banner" onclick="closeAnnouncementBar()"
3634
aria-label="Close announcement">&times;</button>
@@ -40,12 +38,13 @@
4038
<h1>SWGOH Portrait Maker</h1>
4139
</header>
4240
<main>
43-
<h1 id="uploadText">Upload Your Image Here:</h1>
41+
<h1 class="uploadText">Upload Your Image Here:</h1>
4442
<div>
4543
<div>
4644
<label for="upload" class="file-upload">Choose Image</label>
4745
<input type="file" id="upload" accept="image/*">
4846
</div>
47+
<div style="height: 10px;"></div>
4948
<div>
5049
<label for="urlInput" class="input-labels">Image URL:</label>
5150
<span class="input-image">
@@ -74,6 +73,7 @@ <h1 id="uploadText">Upload Your Image Here:</h1>
7473
<button id="loadDiscordBtn">Load Discord Avatar</button>
7574
</div>
7675
</div>
76+
<h1 class="uploadText">Now select the options you want on the image</h1>
7777
<div class="input-container">
7878
<div class="input-group">
7979
<label for="zetaCount">Zetas:</label>
@@ -109,6 +109,7 @@ <h1 id="uploadText">Upload Your Image Here:</h1>
109109
<br>
110110
<button onclick="stackImages()" id="generateButton">Generate!</button>
111111
<br><br>
112+
<h1 class="uploadText">Move it around until you are happy</h1>
112113
<canvas id="canvas"></canvas>
113114
<div style="height: 30px;"></div>
114115
<div class="imgControlers">
@@ -126,6 +127,8 @@ <h1 id="uploadText">Upload Your Image Here:</h1>
126127
</div>
127128
<button id="resetAll" style="display: none;" onclick="fakeRefresh()">Reset Page</button>
128129
<div style="height: 30px;"></div>
130+
<h1 class="uploadText" id="imageDownloadText" style="display: none;">Now download your image!</h1>
131+
<div style="height: 40px;"></div>
129132
<a id="downloadLink" style="display: none; text-decoration: none;">Download Result(PC)</a>
130133
<div style="height: 50px;"></div>
131134
<a id="downloadLinkM" onclick="mobileDownload()" style="display: none;">Download Result(Mobile)</a>

swgoh-portrait-maker/script.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const uploadInput = document.getElementById('upload');
44
const downloadLink = document.getElementById('downloadLink');
55
const downloadLinkM = document.getElementById('downloadLinkM');
66
const downloadLinkMDesc = document.getElementById('downloadLinkMDesc');
7+
const downloadLinkText = document.getElementById('imageDownloadText');
78
const resetAll = document.getElementById('resetAll');
89
const urlInput = document.getElementById('urlInput');
910
const loadUrlBtn = document.getElementById('loadUrlBtn');
@@ -29,11 +30,11 @@ const discordServerStartUrl = "https://legofan9-discord-hash-getter.onrender.com
2930
fetch(discordServerStartUrl)
3031

3132
const unwantedEntries = {
32-
'dismissedAnnouncementVersion': ['1.0.0'],
33+
'dismissedAnnouncementVersion': ['1.0.0', '1.1.0'],
3334
"agreedToTerms": ['1.0.0']
3435
};
3536

36-
const CURRENT_ANNOUNCEMENT_VERSION = '1.1.0';
37+
const CURRENT_ANNOUNCEMENT_VERSION = '1.1.1';
3738
const CURRENT_TERMS_VERSION = '1.1.0';
3839

3940
Object.entries(unwantedEntries).forEach(([key, valuesToRemove]) => {
@@ -311,12 +312,13 @@ async function doGenerate() {
311312
ctx.drawImage(img, 0, 0);
312313
// will add back later canvas.classList.add('loaded')
313314

314-
downloadLink.href = canvas.toDataURL();
315-
downloadLink.download = "swgoh-portrait-image.png";
315+
downloadLink.href = canvas.toDataURL('image/webp');
316+
downloadLink.download = "swgoh-portrait-image.webp";
316317
downloadLink.textContent = "Download Result (PC)";
317318
downloadLink.style.display = "inline";
318319
downloadLinkM.style.display = "inline";
319320
downloadLinkM.textContent = "Download Result (Mobile)";
321+
downloadLinkText.style.display = "inline";
320322
resetAll.style.display = "inline";
321323
}
322324

@@ -327,7 +329,7 @@ function mobileDownload() {
327329
if (oldPreview) oldPreview.remove();
328330

329331
const imgPreview = document.createElement('img');
330-
imgPreview.src = canvas.toDataURL();
332+
imgPreview.src = canvas.toDataURL('image/webp');
331333
imgPreview.style.maxWidth = "100%";
332334
imgPreview.id = "imgPreview";
333335
mainEl.appendChild(imgPreview);
@@ -432,7 +434,7 @@ async function renderCanvasFromDOM() {
432434
ctx.clearRect(0, 0, canvas.width, canvas.height);
433435
ctx.drawImage(img, 0, 0);
434436

435-
downloadLink.href = canvas.toDataURL();
437+
downloadLink.href = canvas.toDataURL('image/webp');
436438
}
437439

438440
function zoomIn() {
@@ -518,7 +520,7 @@ function fakeRefresh() {
518520
downloadLink.style.display = "none";
519521
downloadLink.href = "#";
520522
downloadLink.textContent = "";
521-
523+
downloadLinkText.style.display = "none";
522524
downloadLinkM.style.display = "none";
523525
downloadLinkM.textContent = "";
524526
downloadLinkMDesc.style.display = "none";

swgoh-portrait-maker/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ h1 {
1010
color: #333;
1111
}
1212

13-
#uploadText {
13+
.uploadText {
1414
font-size: 20px
1515
}
1616

swgoh-updates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7-
<meta name="description" content="A basic HTML template with meta tags and favicon.">
7+
<meta name="description" content="SWGoH Updates - A automatic datamine tool for SWGoH">
88
<meta name="author" content="LegoFan9">
99
<link rel="icon" href="swgoh-updates-icon.webp">
1010
<title>SWGoH Updates</title>

0 commit comments

Comments
 (0)