add 1x download support

This commit is contained in:
Brian Beck 2025-10-28 13:47:59 -07:00
parent 4fedfb8f46
commit ff6ce8adaf
22 changed files with 172 additions and 41 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
.gallery-module__zlwOTG__GalleryPage{flex-direction:column}.gallery-module__zlwOTG__Tools{text-align:center;z-index:2;background:rgba(0,0,0,.7);flex:none;grid-template-columns:1fr auto 1fr;justify-content:space-between;align-items:center;gap:10px;padding:10px;display:grid;position:-webkit-sticky;position:sticky;top:0}.gallery-module__zlwOTG__Tools select:focus{outline:none;box-shadow:0 0 1px 1px rgba(0,0,0,.5),0 0 2px 3px #98ffd4}.gallery-module__zlwOTG__HeaderEnd{justify-content:space-between;align-items:center;gap:20px;display:flex}.gallery-module__zlwOTG__DownloadSection{align-items:center;gap:8px;display:flex}.gallery-module__zlwOTG__PackVersion{color:rgba(127,180,166,.6);font-size:11px}.gallery-module__zlwOTG__DownloadButton{color:#f7ffdc;letter-spacing:-.03em;text-shadow:0 -1px rgba(25,39,34,.4);cursor:pointer;background:0 0,linear-gradient(#43a782,#0f5957);border:0;border-radius:4px;margin-left:3px;padding:4px 8px 5px;font-size:13px;font-weight:500;text-decoration:none;display:inline-block}.gallery-module__zlwOTG__DownloadButton:active{transform:translateY(1px)}.gallery-module__zlwOTG__Back{color:#fff;justify-self:start;align-items:center;gap:4px;font-size:14px;text-decoration:none;display:inline-flex}.gallery-module__zlwOTG__IconLink{color:rgba(255,255,255,.3);place-content:center;justify-self:end;margin-left:auto;display:grid}.gallery-module__zlwOTG__IconLink:hover{color:#fff}.gallery-module__zlwOTG__Gallery{background:#0c1f28;flex:none;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));width:100%;display:grid}.gallery-module__zlwOTG__Skin{text-align:center;padding-bottom:32px;font-size:12px;position:relative;overflow:hidden}.gallery-module__zlwOTG__Preview{width:100%;height:auto;display:block}.gallery-module__zlwOTG__DownloadHiRes{align-items:center;gap:.5em;margin-left:auto;font-size:11px;display:flex}.gallery-module__zlwOTG__HiResSelect{font-size:11px}.gallery-module__zlwOTG__Detail{background:rgba(0,0,0,.2);border-radius:6px;justify-content:space-between;align-items:center;gap:8px;padding:5px 9px;display:flex;position:absolute;bottom:8px;left:6px;right:6px;box-shadow:inset 0 1px 10px rgba(0,0,0,.3)}.gallery-module__zlwOTG__LoadInEditor,.gallery-module__zlwOTG__DownloadSkin{color:#28d9b2;visibility:hidden;place-content:center;font-size:24px;display:grid}.gallery-module__zlwOTG__DownloadSkin{cursor:pointer;background:0 0;border:0;margin:0;padding:0;font-size:17px}.gallery-module__zlwOTG__Detail:hover .gallery-module__zlwOTG__LoadInEditor,.gallery-module__zlwOTG__Detail:hover .gallery-module__zlwOTG__DownloadSkin{visibility:visible}.gallery-module__zlwOTG__Name{white-space:nowrap;color:rgba(158,192,209,.9);border-radius:9999px;padding:3px 10px}.gallery-module__zlwOTG__Detail:hover .gallery-module__zlwOTG__Name{color:#fff}@keyframes gallery-module__zlwOTG__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gallery-module__zlwOTG__Spinner{flex:none;margin:auto;font-size:64px;animation:2s linear infinite gallery-module__zlwOTG__spin}.gallery-module__zlwOTG__DownloadSpinner{flex:none;margin:auto;font-size:20px;animation:2s linear infinite gallery-module__zlwOTG__spin}@media (max-width:1023px){.gallery-module__zlwOTG__Tools{grid-template-columns:auto auto 1fr;justify-content:space-between}}@media (max-width:719px){.gallery-module__zlwOTG__PackVersion{display:none}}@media (max-width:639px){.gallery-module__zlwOTG__Back .gallery-module__zlwOTG__Label,.gallery-module__zlwOTG__DownloadButton,.gallery-module__zlwOTG__DownloadHiRes{display:none}.gallery-module__zlwOTG__Tools{grid-template-columns:1fr auto 1fr}}

View file

@ -1 +1 @@
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78631,(e,t,n)=>{!function(t,n){if("function"==typeof define&&define.amd){let t;void 0!==(t=n())&&e.v(t)}else n()}(e.e,function(){"use strict";function n(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){s(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function o(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:e.g.global===e.g?e.g:void 0,r=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!r?function(e,t,r){var s=i.URL||i.webkitURL,c=document.createElement("a");c.download=t=t||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?a(c):o(c.href)?n(e,t,r):a(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){a(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download","string"!=typeof e){var r;navigator.msSaveOrOpenBlob((void 0===(r=i)?r={autoBom:!1}:"object"!=typeof r&&(console.warn("Deprecated: Expected third argument to be a object"),r={autoBom:!r}),r.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),t)}else if(o(e))n(e,t,i);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout(function(){a(s)})}}:function(e,t,o,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,o);var s="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||r)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},u.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,d=f.createObjectURL(e);a?a.location=d:location.href=d,a=null,setTimeout(function(){f.revokeObjectURL(d)},4e4)}});i.saveAs=s.saveAs=s,t.exports=s})},69642,e=>{"use strict";e.s(["collectFiles",()=>r,"createZipFile",()=>o,"savePngFile",()=>i,"saveZipFile",()=>a]);var t=e.i(71315),n=e.i(78631);function o(e){let n=new t.default;for(let t of e)n.file("textures/skins/".concat(t.name),t.data);return n}async function a(e,t){let o=await e.generateAsync({type:"blob"});(0,n.saveAs)(o,t)}function i(e,t){(0,n.saveAs)(e,t)}async function r(e){let{skipNotFound:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await Promise.all(e.map(async e=>{let n="".concat("https://exogen.github.io/t2-skins/skins","/").concat(e),o=await fetch(n);if(!o.ok){if(t&&404===o.status)return null;throw Error("Response failed: ".concat(o.status," ").concat(o.statusText))}return{name:e,data:await o.arrayBuffer()}}))).filter(e=>null!=e)}}]);
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,78631,(e,t,n)=>{!function(t,n){if("function"==typeof define&&define.amd){let t;void 0!==(t=n())&&e.v(t)}else n()}(e.e,function(){"use strict";function n(e,t,n){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){s(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function o(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(n){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var i="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:e.g.global===e.g?e.g:void 0,r=i.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),s=i.saveAs||("object"!=typeof window||window!==i?function(){}:"download"in HTMLAnchorElement.prototype&&!r?function(e,t,r){var s=i.URL||i.webkitURL,c=document.createElement("a");c.download=t=t||e.name||"download",c.rel="noopener","string"==typeof e?(c.href=e,c.origin===location.origin?a(c):o(c.href)?n(e,t,r):a(c,c.target="_blank")):(c.href=s.createObjectURL(e),setTimeout(function(){s.revokeObjectURL(c.href)},4e4),setTimeout(function(){a(c)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,i){if(t=t||e.name||"download","string"!=typeof e){var r;navigator.msSaveOrOpenBlob((void 0===(r=i)?r={autoBom:!1}:"object"!=typeof r&&(console.warn("Deprecated: Expected third argument to be a object"),r={autoBom:!r}),r.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e),t)}else if(o(e))n(e,t,i);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout(function(){a(s)})}}:function(e,t,o,a){if((a=a||open("","_blank"))&&(a.document.title=a.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,o);var s="application/octet-stream"===e.type,c=/constructor/i.test(i.HTMLElement)||i.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||s&&c||r)&&"undefined"!=typeof FileReader){var u=new FileReader;u.onloadend=function(){var e=u.result;e=l?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),a?a.location.href=e:location=e,a=null},u.readAsDataURL(e)}else{var f=i.URL||i.webkitURL,d=f.createObjectURL(e);a?a.location=d:location.href=d,a=null,setTimeout(function(){f.revokeObjectURL(d)},4e4)}});i.saveAs=s.saveAs=s,t.exports=s})},69642,e=>{"use strict";e.s(["collectFiles",()=>r,"createZipFile",()=>o,"savePngFile",()=>i,"saveZipFile",()=>a]);var t=e.i(71315),n=e.i(78631);function o(e){let n=new t.default;for(let t of e)n.file("textures/skins/".concat(t.name),t.data);return n}async function a(e,t){let o=await e.generateAsync({type:"blob"});(0,n.saveAs)(o,t)}function i(e,t){(0,n.saveAs)(e,t)}async function r(e){let{skipNotFound:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(await Promise.all(e.map(async e=>{let n="".concat("https://exogen.github.io/t2-skins/skins","/").concat(e),o=await fetch(n);if(!o.ok){if(t&&404===o.status)return null;throw Error("Response failed: ".concat(o.status," ").concat(o.statusText))}let a=await o.arrayBuffer();return{name:e.replace(/@1x\.png$/,".png"),data:a}}))).filter(e=>null!=e)}}]);

File diff suppressed because one or more lines are too long

View file

@ -1 +0,0 @@
.gallery-module__zlwOTG__GalleryPage{flex-direction:column}.gallery-module__zlwOTG__Tools{text-align:center;z-index:2;background:rgba(0,0,0,.7);flex:none;grid-template-columns:1fr auto 1fr;align-items:center;padding:10px;display:grid;position:-webkit-sticky;position:sticky;top:0}.gallery-module__zlwOTG__Tools select:focus{outline:none;box-shadow:0 0 1px 1px rgba(0,0,0,.5),0 0 2px 3px #98ffd4}.gallery-module__zlwOTG__HeaderEnd{justify-content:space-between;align-items:center;margin-left:10px;display:flex}.gallery-module__zlwOTG__DownloadSection{align-items:center;gap:8px;display:flex}.gallery-module__zlwOTG__PackVersion{color:rgba(127,180,166,.6);font-size:11px}.gallery-module__zlwOTG__DownloadButton{color:#f7ffdc;letter-spacing:-.03em;text-shadow:0 -1px rgba(25,39,34,.4);cursor:pointer;background:0 0,linear-gradient(#43a782,#0f5957);border:0;border-radius:4px;margin-left:3px;padding:4px 8px 5px;font-size:13px;font-weight:500;text-decoration:none;display:inline-block}.gallery-module__zlwOTG__DownloadButton:active{transform:translateY(1px)}.gallery-module__zlwOTG__Back{color:#fff;justify-self:start;align-items:center;gap:4px;font-size:14px;text-decoration:none;display:inline-flex}.gallery-module__zlwOTG__IconLink{color:rgba(255,255,255,.3);place-content:center;justify-self:end;margin-left:auto;display:grid}.gallery-module__zlwOTG__IconLink:hover{color:#fff}.gallery-module__zlwOTG__Gallery{background:#0c1f28;flex:none;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));width:100%;display:grid}.gallery-module__zlwOTG__Skin{text-align:center;padding-bottom:32px;font-size:12px;position:relative;overflow:hidden}.gallery-module__zlwOTG__Preview{width:100%;height:auto;display:block}.gallery-module__zlwOTG__Detail{background:rgba(0,0,0,.2);border-radius:6px;justify-content:space-between;align-items:center;gap:8px;padding:5px 9px;display:flex;position:absolute;bottom:8px;left:6px;right:6px;box-shadow:inset 0 1px 10px rgba(0,0,0,.3)}.gallery-module__zlwOTG__LoadInEditor,.gallery-module__zlwOTG__DownloadSkin{color:#28d9b2;visibility:hidden;place-content:center;font-size:24px;display:grid}.gallery-module__zlwOTG__DownloadSkin{cursor:pointer;background:0 0;border:0;margin:0;padding:0;font-size:17px}.gallery-module__zlwOTG__Detail:hover .gallery-module__zlwOTG__LoadInEditor,.gallery-module__zlwOTG__Detail:hover .gallery-module__zlwOTG__DownloadSkin{visibility:visible}.gallery-module__zlwOTG__Name{white-space:nowrap;color:rgba(158,192,209,.9);border-radius:9999px;padding:3px 10px}.gallery-module__zlwOTG__Detail:hover .gallery-module__zlwOTG__Name{color:#fff}@keyframes gallery-module__zlwOTG__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.gallery-module__zlwOTG__Spinner{flex:none;margin:auto;font-size:64px;animation:2s linear infinite gallery-module__zlwOTG__spin}.gallery-module__zlwOTG__DownloadSpinner{flex:none;margin:auto;font-size:20px;animation:2s linear infinite gallery-module__zlwOTG__spin}@media (max-width:479px){.gallery-module__zlwOTG__Back .gallery-module__zlwOTG__Label,.gallery-module__zlwOTG__DownloadButton{display:none}}@media (max-width:719px){.gallery-module__zlwOTG__PackVersion{display:none}}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
2:I[39756,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"default"]
3:I[37457,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"default"]
4:I[47257,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"ClientPageRoot"]
5:I[25500,["/t2-model-skinner/_next/static/chunks/53296be44174b494.js","/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","/t2-model-skinner/_next/static/chunks/0c04e859c9299853.js","/t2-model-skinner/_next/static/chunks/2d0a1519f2fc6d9e.js"],"default"]
5:I[25500,["/t2-model-skinner/_next/static/chunks/64f1e5c6f9fa52f6.js","/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","/t2-model-skinner/_next/static/chunks/5ab6fafee44106c4.js","/t2-model-skinner/_next/static/chunks/e233a54f1de7eeb5.js"],"default"]
8:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"OutletBoundary"]
a:I[11533,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"AsyncMetadataOutlet"]
c:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"ViewportBoundary"]
@ -10,8 +10,8 @@ e:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-mode
f:"$Sreact.suspense"
11:I[68027,[],"default"]
:HL["/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","style"]
:HL["/t2-model-skinner/_next/static/chunks/c45ca2566aefbdb7.css","style"]
0:{"P":null,"b":"J9hUTJgCvSDMXCjR51slX","p":"/t2-model-skinner","c":["","gallery",""],"i":false,"f":[[["",{"children":["gallery",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["gallery",["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/c45ca2566aefbdb7.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/53296be44174b494.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/0c04e859c9299853.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-model-skinner/_next/static/chunks/2d0a1519f2fc6d9e.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true}
:HL["/t2-model-skinner/_next/static/chunks/185de9d007942943.css","style"]
0:{"P":null,"b":"HVLdZFp1rz0i50CxjnUcW","p":"/t2-model-skinner","c":["","gallery",""],"i":false,"f":[[["",{"children":["gallery",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["gallery",["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/185de9d007942943.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/64f1e5c6f9fa52f6.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/5ab6fafee44106c4.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-model-skinner/_next/static/chunks/e233a54f1de7eeb5.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true}
6:{}
7:"$0:f:0:1:2:children:2:children:1:props:children:0:props:params"
d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]

File diff suppressed because one or more lines are too long

View file

@ -2,7 +2,7 @@
2:I[39756,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"default"]
3:I[37457,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"default"]
4:I[47257,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"ClientPageRoot"]
5:I[52683,["/t2-model-skinner/_next/static/chunks/bd9a6468f03a9b31.js","/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","/t2-model-skinner/_next/static/chunks/43ceca71888c9b70.js","/t2-model-skinner/_next/static/chunks/e6e166ba82cc0d62.js","/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js"],"default"]
5:I[52683,["/t2-model-skinner/_next/static/chunks/502774dbda501837.js","/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","/t2-model-skinner/_next/static/chunks/43ceca71888c9b70.js","/t2-model-skinner/_next/static/chunks/d92306cd027784a6.js","/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js"],"default"]
8:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"OutletBoundary"]
a:I[11533,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"AsyncMetadataOutlet"]
c:I[97367,["/t2-model-skinner/_next/static/chunks/ff1a16fafef87110.js","/t2-model-skinner/_next/static/chunks/7dd66bdf8a7e5707.js"],"ViewportBoundary"]
@ -11,7 +11,7 @@ f:"$Sreact.suspense"
11:I[68027,[],"default"]
:HL["/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","style"]
:HL["/t2-model-skinner/_next/static/chunks/df18f9fdc6a3cb7c.css","style"]
0:{"P":null,"b":"J9hUTJgCvSDMXCjR51slX","p":"/t2-model-skinner","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/df18f9fdc6a3cb7c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/bd9a6468f03a9b31.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/43ceca71888c9b70.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-model-skinner/_next/static/chunks/e6e166ba82cc0d62.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true}
0:{"P":null,"b":"HVLdZFp1rz0i50CxjnUcW","p":"/t2-model-skinner","c":["",""],"i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]]}],{"children":["__PAGE__",["$","$1","c",{"children":[["$","$L4",null,{"Component":"$5","searchParams":{},"params":{},"promises":["$@6","$@7"]}],[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/df18f9fdc6a3cb7c.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-model-skinner/_next/static/chunks/502774dbda501837.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-model-skinner/_next/static/chunks/d63fc3798baf75bd.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-model-skinner/_next/static/chunks/43ceca71888c9b70.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-model-skinner/_next/static/chunks/d92306cd027784a6.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-model-skinner/_next/static/chunks/a55df98dcb3b60ad.js","async":true,"nonce":"$undefined"}]],["$","$L8",null,{"children":["$L9",["$","$La",null,{"promise":"$@b"}]]}]]}],{},null,false]},null,false],["$","$1","h",{"children":[null,[["$","$Lc",null,{"children":"$Ld"}],null],["$","$Le",null,{"children":["$","div",null,{"hidden":true,"children":["$","$f",null,{"fallback":null,"children":"$L10"}]}]}]]}],false]],"m":"$undefined","G":["$11",[["$","link","0",{"rel":"stylesheet","href":"/t2-model-skinner/_next/static/chunks/795c34bef1c92210.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}]]],"s":false,"S":true}
6:{}
7:"$0:f:0:1:2:children:1:props:children:0:props:params"
d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1"}]]

View file

@ -10,6 +10,8 @@
text-align: center;
display: grid;
grid-template-columns: 1fr auto 1fr;
gap: 10px;
justify-content: space-between;
align-items: center;
background: rgba(0, 0, 0, 0.7);
z-index: 2;
@ -24,7 +26,7 @@
display: flex;
align-items: center;
justify-content: space-between;
margin-left: 10px;
gap: 20px;
}
.DownloadSection {
@ -103,6 +105,18 @@
height: auto;
}
.DownloadHiRes {
display: flex;
align-items: center;
gap: 0.5em;
font-size: 11px;
margin-left: auto;
}
.HiResSelect {
font-size: 11px;
}
.Detail {
position: absolute;
bottom: 8px;
@ -176,13 +190,10 @@
animation: spin 2s linear infinite;
}
@media (max-width: 479px) {
.Back .Label {
display: none;
}
.DownloadButton {
display: none;
@media (max-width: 1023px) {
.Tools {
grid-template-columns: auto auto 1fr;
justify-content: space-between;
}
}
@ -191,3 +202,18 @@
display: none;
}
}
@media (max-width: 639px) {
.Back .Label {
display: none;
}
.DownloadButton,
.DownloadHiRes {
display: none;
}
.Tools {
grid-template-columns: 1fr auto 1fr;
}
}

View file

@ -1,9 +1,9 @@
"use client";
import { Suspense, useEffect, useMemo, useState } from "react";
import { Suspense, useEffect, useMemo, useRef, useState } from "react";
import { CgSpinnerTwo } from "react-icons/cg";
import { BsBadge3dFill } from "react-icons/bs";
import { FaDownload } from "react-icons/fa";
import { FaChevronLeft, FaGithub } from "react-icons/fa";
import { FaChevronLeft } from "react-icons/fa";
import { useRouter, usePathname, useSearchParams } from "next/navigation";
import orderBy from "lodash.orderby";
import useManifest from "../../useManifest";
@ -105,9 +105,13 @@ function Gallery() {
const router = useRouter();
const pathname = usePathname();
const searchParams = useSearchParams();
const hiResSelectRef = useRef<HTMLSelectElement>(null);
const [manifest, isLoaded] = useManifest();
const [selectedModel, setSelectedModel] = useState("lmale");
const [isPreparingDownload, setPreparingDownload] = useState(false);
const [hiResDownload, setHiResDownload] = useState<"prompt" | "yes" | "no">(
"prompt"
);
const actualModel = selectedModel === "hfemale" ? "hmale" : selectedModel;
const customSkins = manifest.customSkins?.[actualModel] ?? emptySkins;
@ -115,20 +119,59 @@ function Gallery() {
const pack = manifest?.packs?.[selectedModel];
const isPack = pack != null;
useEffect(() => {
const savedHiResDownload = localStorage.getItem("hiResDownload");
switch (savedHiResDownload) {
case "yes":
case "no":
setHiResDownload(savedHiResDownload);
break;
}
}, []);
useEffect(() => {
if (pack && isPreparingDownload) {
let ignore = false;
const download = async () => {
const files = await collectFiles(pack.files);
const fileNames = pack.files;
const hasHiRes = fileNames.some(
(fileName) => manifest.sizeMultiplier[fileName] > 1
);
if (hasHiRes && hiResDownload === "prompt") {
window.alert(
"This download contains HD textures, which require the QoL patch. Select “yes” or “no” for HD support, then try again."
);
if (hiResSelectRef.current) {
hiResSelectRef.current.focus();
}
setPreparingDownload(false);
return;
}
const collectFileNames =
hiResDownload === "yes"
? fileNames
: fileNames.map((fileName) => {
return manifest.sizeMultiplier[fileName] > 1
? fileName.replace(/\.png$/, "@1x.png")
: fileName;
});
let zipFileName = `zSkinPack-${selectedModel}-v${pack.version}.vl2`;
if (hasHiRes && hiResDownload === "no") {
zipFileName = zipFileName.replace(/\.vl2$/, "@1x.vl2");
}
const files = await collectFiles(collectFileNames);
if (!ignore) {
const zip = createZipFile(files);
await new Promise((resolve) => setTimeout(resolve, 500));
if (!ignore) {
await saveZipFile(
zip,
`zSkinPack-${selectedModel}-v${pack.version}.vl2`
);
await saveZipFile(zip, zipFileName);
}
if (!ignore) {
setPreparingDownload(false);
@ -143,7 +186,13 @@ function Gallery() {
setPreparingDownload(false);
};
}
}, [isPreparingDownload, pack, selectedModel]);
}, [
hiResDownload,
isPreparingDownload,
manifest.sizeMultiplier,
pack,
selectedModel,
]);
const packList = useMemo(() => {
return orderBy(
@ -261,12 +310,33 @@ function Gallery() {
)}
</div>
) : null}
<a
href="https://github.com/exogen/t2-model-skinner"
className={styles.IconLink}
>
<FaGithub size={32} />
</a>
<div className={styles.DownloadHiRes}>
<label htmlFor="hiResSelect">HD support?</label>
<select
id="hiResSelect"
className={styles.HiResSelect}
ref={hiResSelectRef}
value={hiResDownload}
disabled={isPreparingDownload}
onChange={(event) => {
switch (event.target.value) {
case "prompt":
setHiResDownload(event.target.value);
localStorage.removeItem("hiResDownload");
break;
case "yes":
case "no":
setHiResDownload(event.target.value);
localStorage.setItem("hiResDownload", event.target.value);
break;
}
}}
>
<option value="prompt">Ask</option>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</div>
</div>
</div>
{isLoaded ? (
@ -349,7 +419,37 @@ function Gallery() {
break;
}
if (fileNames.length) {
const files = await collectFiles(fileNames, {
const hasHiRes = fileNames.some(
(fileName) => manifest.sizeMultiplier[fileName] > 1
);
if (hasHiRes && hiResDownload === "prompt") {
window.alert(
"This download contains HD textures, which require the QoL patch. Select “yes” or “no” for HD support, then try again."
);
if (hiResSelectRef.current) {
hiResSelectRef.current.focus();
}
return;
}
const collectFileNames =
hiResDownload === "yes"
? fileNames
: fileNames.map((fileName) => {
return manifest.sizeMultiplier[fileName] > 1
? fileName.replace(/\.png$/, "@1x.png")
: fileName;
});
if (hasHiRes && hiResDownload === "no") {
zipFileName = zipFileName.replace(
/\.vl2$/,
"@1x.vl2"
);
}
const files = await collectFiles(collectFileNames, {
skipNotFound: true,
});
const zip = createZipFile(

View file

@ -4,7 +4,7 @@ import { saveAs } from "file-saver";
const basePath = `https://exogen.github.io/t2-skins/skins`;
export function createZipFile(
files: Array<{ name: string; data: ArrayBuffer }>
files: Array<{ name: string; data: ArrayBuffer | Blob }>
) {
const zip = new JSZip();
for (const file of files) {
@ -37,7 +37,10 @@ export async function collectFiles(
throw new Error(`Response failed: ${res.status} ${res.statusText}`);
}
const arrayBuffer = await res.arrayBuffer();
return { name: fileName, data: arrayBuffer };
return {
name: fileName.replace(/@1x\.png$/, ".png"),
data: arrayBuffer,
};
})
);
return results.filter((fileInfo) => fileInfo != null);

View file

@ -11,6 +11,7 @@ export type Manifest = {
files: string[];
}
>;
sizeMultiplier: Record<string, number>;
};
const baseManifestPath = `https://exogen.github.io/t2-skins`;
@ -18,6 +19,7 @@ export const defaultManifest: Manifest = {
customSkins: {},
newSkins: {},
packs: {},
sizeMultiplier: {},
};
export default function useManifest(): [Manifest, boolean] {