@@ -4,6 +4,7 @@ const uploadInput = document.getElementById('upload');
44const downloadLink = document . getElementById ( 'downloadLink' ) ;
55const downloadLinkM = document . getElementById ( 'downloadLinkM' ) ;
66const downloadLinkMDesc = document . getElementById ( 'downloadLinkMDesc' ) ;
7+ const downloadLinkText = document . getElementById ( 'imageDownloadText' ) ;
78const resetAll = document . getElementById ( 'resetAll' ) ;
89const urlInput = document . getElementById ( 'urlInput' ) ;
910const loadUrlBtn = document . getElementById ( 'loadUrlBtn' ) ;
@@ -29,11 +30,11 @@ const discordServerStartUrl = "https://legofan9-discord-hash-getter.onrender.com
2930fetch ( discordServerStartUrl )
3031
3132const 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 ' ;
3738const CURRENT_TERMS_VERSION = '1.1.0' ;
3839
3940Object . 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
438440function 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" ;
0 commit comments