Verified Commit 6f346300 authored by Luc Didry's avatar Luc Didry
Browse files

💰 — Remove donation links

parent e10524d0
Pipeline #402313 passed with stage
in 21 seconds
......@@ -42,13 +42,6 @@
<li class="nav-item">
<a class="nav-link author" href="https://fiat-tux.fr">Author</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="donate-dpdn" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Donate</a>
<div class="dropdown-menu" aria-labelledby="donate-dpdn">
<a class="dropdown-item" href="https://liberapay.com/sky/">Liberapay</a>
<a class="dropdown-item" href="https://tipeee.com/fiat-tux">Tipeee</a>
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="i18n-dpdn" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="icon-language" aria-hidden="true" title="Language"></i>
......
......@@ -125,7 +125,7 @@ function translate(userLang, languages) {
refreshFilename();
refreshText();
}
['get-source', 'donate-dpdn', 'license', 'author', 'wemake', 'porn', 'border-txt',
['get-source', 'license', 'author', 'wemake', 'porn', 'border-txt',
'color', 'transparency', 'x-position', 'y-position', 'font', 'style', 'text-size',
'text-width', 'outline-color', 'outline-size'
].forEach(function(e) {
......@@ -165,7 +165,7 @@ function translate(userLang, languages) {
$('option[value="'+e+'"]').text(locale[e]);
}
});
['donate-dpdn', 'settings-dpdn', 'toggle-svg', 'download', 'reset', 'switch-colors',
['settings-dpdn', 'toggle-svg', 'download', 'reset', 'switch-colors',
'make-text-center', 'print', 'save', 'import', 'export'
].forEach(function(e) {
if (locale[e] !== undefined) {
......
var svg,customImg,workCanvas="Work with canvas",workSvg="Work with SVG",customImgText="Custom image",sorryNoGallery="Sorry, but you haven't saved any image yet",load="Load",deleteText="Delete",download="Download",downloadClic='Please, right-click on the sticker and select "Save as" to download the sticker',importOk="Your file has been successfully imported",fonts={Amarante:{regular:"fonts/amarante/Amarante.woff2",bold:"fonts/amarante/Amarante.woff2",italic:"fonts/amarante/Amarante.woff2","italic bold":"fonts/amarante/Amarante.woff2"},"Comic Neue":{regular:"fonts/comic-neue/ComicNeue-Regular.woff2",bold:"fonts/comic-neue/ComicNeue-Bold.woff2",italic:"fonts/comic-neue/ComicNeue-Regular-Oblique.woff2","italic bold":"fonts/comic-neue/ComicNeue-Bold-Oblique.woff2"},"Comic Spice":{regular:"fonts/comic-spice/ComicSpice.woff2",bold:"fonts/comic-spice/ComicSpice.woff2",italic:"fonts/comic-spice/ComicSpice.woff2","italic bold":"fonts/comic-spice/ComicSpice.woff2"},Hack:{regular:"fonts/hack/hack-regular-webfont.woff2",bold:"fonts/hack/hack-bold-webfont.woff2",italic:"fonts/hack/hack-italic-webfont.woff2","italic bold":"fonts/hack/hack-bolditalic-webfont.woff2"},"Open Sans":{regular:"fonts/open-sans/OpenSans-Regular.woff2",bold:"fonts/open-sans/OpenSans-Bold.woff2",italic:"fonts/open-sans/OpenSans-Italic.woff2","italic bold":"fonts/open-sans/OpenSans-BoldItalic.woff2"},"Some Time Later":{regular:"fonts/some-time-later/Some-Time-Later.woff2",bold:"fonts/some-time-later/Some-Time-Later.woff2",italic:"fonts/some-time-later/Some-Time-Later.woff2","italic bold":"fonts/some-time-later/Some-Time-Later.woff2"},Nosifer:{regular:"fonts/nosifer/nosifer.woff2",bold:"fonts/nosifer/nosifer.woff2",italic:"fonts/nosifer/nosifer.woff2","italic bold":"fonts/nosifer/nosifer.woff2"},UnifrakturMaguntia:{regular:"fonts/unifraktur-maguntia/UnifrakturMaguntia.woff2",bold:"fonts/unifraktur-maguntia/UnifrakturMaguntia.woff2",italic:"fonts/unifraktur-maguntia/UnifrakturMaguntia.woff2","italic bold":"fonts/unifraktur-maguntia/UnifrakturMaguntia.woff2"},Xolonium:{regular:"fonts/xolonium/Xolonium-Regular.woff2",bold:"fonts/xolonium/Xolonium-Bold.woff2",italic:"fonts/xolonium/Xolonium-Regular.woff2","italic bold":"fonts/xolonium/Xolonium-Bold.woff2"}},loadedFonts={};function detectLang(){var e=[],a=readCookie("lang");null!=a&&e.push(a);for(var t=navigator.languages,r=0;r<t.length;r++)e.push(t[r]);0!==e.length?translate(e.shift(),e):(console.log("Using old style language detection."),translate(navigator.language||navigator.userLanguage))}function translate(t,e){$.get({url:"locales/"+t+".json",dataType:"json",error:function(){null!=e&&0!==e.length&&translate(e.shift(),e)},success:function(a){var e;toggleI18n(t),"groot"===t&&($("#wemake").val("I am"),$("#porn").val("Groot"),$("#bg-type").val("img"),$("#bg-img").val("bark"),$("#wemake-color").val("#ffffff"),$("#porn-color").val("#ffffff"),$("#rect-color").val("#ffffff"),toggleBgSettings(),refreshFilename(),refreshText()),["get-source","donate-dpdn","license","author","wemake","porn","border-txt","color","transparency","x-position","y-position","font","style","text-size","text-width","outline-color","outline-size"].forEach(function(e){void 0!==a[e]&&$("."+e).text(a[e])}),["hide-settings","set-corner-shape","set-colors","set-fonts","set-bg","set-positions","set-img-size","gallery"].forEach(function(e){void 0!==a[e]&&$('[data-setting="'+e+'"]').text(a[e])}),["wemake","porn","filename","corners","bg-type","bgu-color","bgr-color","egr-color","gr-orientation","bg-img","custom-img","custom-x","custom-y","custom-size","border-thickness","img-width","img-height","custom-img-url","rick-size","rick-x","rick-y","rick-rad"].forEach(function(e){void 0!==a[e]&&$('label[for="'+e+'"]').text(a[e])}),void 0!==a["corners-rounded"]&&$('#corners option[value="20"]').text(a["corners-rounded"]),void 0!==a["corners-square"]&&$('#corners option[value="0"]').text(a["corners-square"]),void 0!==a["add-glitter"]&&$(".glitter span").text(a["add-glitter"]),["plain","gradient","rainbow","img","lr","rl","tb","bt","r","beer","glitter","rainbow-flag","sky","field","bridge","regular","bold","italic","italic bold","bark","snow","whale"].forEach(function(e){void 0!==a[e]&&$('option[value="'+e+'"]').text(a[e])}),["donate-dpdn","settings-dpdn","toggle-svg","download","reset","switch-colors","make-text-center","print","save","import","export"].forEach(function(e){void 0!==a[e]&&("download"===e&&(download=a[e]),$("#"+e).text(a[e]))}),void 0!==a["i18n-dpdn"]&&$("#i18n-dpdn i").attr("title",a["i18n-dpdn"]),void 0!==a["import-n-export"]&&$("#import-n-export").attr("title",a["import-n-export"]),void 0!==a["toggle-canvas"]&&(workCanvas=a["toggle-canvas"]),void 0!==a["toggle-svg"]&&(workSvg=a["toggle-svg"]),void 0!==a["sorry-no-gallery"]&&(sorryNoGallery=a["sorry-no-gallery"]),void 0!==a.load&&(load=a.load),void 0!==a.delete&&(deleteText=a.delete),void 0!==a["custom-img-text"]&&(customImgText=a["custom-img-text"],0!==(e=$('option[value="custom"]')).length&&e.text(customImgText)),void 0!==a["import-ok"]&&(importOk=a["import-ok"]),void 0!==a["download-clic"]&&(downloadClic=a["download-clic"]),void 0!==a["add-rick"]&&$(".rick span").text(a["add-rick"])}})}function getParameters(){window.location.hash&&$("#porn").val(decodeURIComponent(window.location.hash.substr(1)));var e=new URL(window.location);null!==e.searchParams.get("w")&&$("#wemake").val(e.searchParams.get("w")),null!==e.searchParams.get("wx")&&$("#wemake-x").val(e.searchParams.get("wx")),null!==e.searchParams.get("wy")&&$("#wemake-y").val(e.searchParams.get("wy")),null!==e.searchParams.get("ws")&&$("#wemake-size").val(e.searchParams.get("ws")),null!==e.searchParams.get("wc")&&$("#wemake-color").val(e.searchParams.get("wc")),null!==e.searchParams.get("wa")&&$("#wemake-alpha").val(e.searchParams.get("wa")),null!==e.searchParams.get("wf")&&$("#wemake-font").val(e.searchParams.get("wf")),null!==e.searchParams.get("wfs")&&$("#wemake-font-style").val(e.searchParams.get("wfs")),null!==e.searchParams.get("ww")&&$("#wemake-width").val(e.searchParams.get("ww")),null!==e.searchParams.get("p")&&$("#porn").val(e.searchParams.get("p")),null!==e.searchParams.get("px")&&$("#porn-x").val(e.searchParams.get("px")),null!==e.searchParams.get("py")&&$("#porn-y").val(e.searchParams.get("py")),null!==e.searchParams.get("ps")&&$("#porn-size").val(e.searchParams.get("ps")),null!==e.searchParams.get("pc")&&$("#porn-color").val(e.searchParams.get("pc")),null!==e.searchParams.get("pa")&&$("#porn-alpha").val(e.searchParams.get("pa")),null!==e.searchParams.get("pf")&&$("#porn-font").val(e.searchParams.get("pf")),null!==e.searchParams.get("pfs")&&$("#porn-font-style").val(e.searchParams.get("pfs")),null!==e.searchParams.get("pw")&&$("#porn-width").val(e.searchParams.get("pw")),null!==e.searchParams.get("co")&&$("#bgu-color").val(e.searchParams.get("co")),null!==e.searchParams.get("gli")&&$("#add-glitter").prop("checked","true"===e.searchParams.get("gli")),null!==e.searchParams.get("bgt")&&$("#bg-type").val(e.searchParams.get("bgt")),null!==e.searchParams.get("rc")&&$("#rect-color").val(e.searchParams.get("rc")),null!==e.searchParams.get("ra")&&$("#rect-alpha").val(e.searchParams.get("ra")),null!==e.searchParams.get("bgr")&&$("#bgr-color").val(e.searchParams.get("bgr")),null!==e.searchParams.get("egr")&&$("#egr-color").val(e.searchParams.get("egr")),null!==e.searchParams.get("or")&&$("#gr-orientation").val(e.searchParams.get("or")),null!==e.searchParams.get("bgi")&&"custom"!==e.searchParams.get("bgi")?$("#bg-img").val(e.searchParams.get("bgi")):$("#bg-img").val("beer"),null!==e.searchParams.get("cor")&&$("#corners").val(e.searchParams.get("cor")),null!==e.searchParams.get("f")&&$("#filename").val(e.searchParams.get("f")),null!==e.searchParams.get("width")&&$("#img-width").val(e.searchParams.get("width")),null!==e.searchParams.get("height")&&$("#img-height").val(e.searchParams.get("height")),null!==e.searchParams.get("bth")&&$("#border-thickness").val(e.searchParams.get("bth")),null!==e.searchParams.get("x")&&$("#custom-x").val(e.searchParams.get("x")),null!==e.searchParams.get("y")&&$("#custom-y").val(e.searchParams.get("y")),null!==e.searchParams.get("s")&&$("#custom-size").val(e.searchParams.get("s")),null!==e.searchParams.get("bgu")&&""!==e.searchParams.get("bgu")&&($("#custom-img-url").val(e.searchParams.get("bgu")),handleImageURL(!1)),null!==e.searchParams.get("r")&&$("#add-rick").prop("checked","true"===e.searchParams.get("r")),null!==e.searchParams.get("rx")&&$("#rick-x").val(e.searchParams.get("rx")),null!==e.searchParams.get("ry")&&$("#rick-y").val(e.searchParams.get("ry")),null!==e.searchParams.get("rs")&&$("#rick-size").val(e.searchParams.get("rs")),null!==e.searchParams.get("rr")&&$("#rick-rad").val(e.searchParams.get("rr")),null!==e.searchParams.get("woc")&&$("#wemake-outline-color").val(e.searchParams.get("woc")),null!==e.searchParams.get("wos")&&$("#wemake-outline-size").val(e.searchParams.get("wos")),null!==e.searchParams.get("poc")&&$("#porn-outline-color").val(e.searchParams.get("poc")),null!==e.searchParams.get("pos")&&$("#porn-outline-size").val(e.searchParams.get("pos"))}function bindEvents(){$('input[type="text"]').each(function(e){"filename"!==this.id&&($(this).keyup(function(){refreshText(),refreshFilename()}),$(this).on("paste",function(){refreshText(),refreshFilename()}))}),$("#custom-img-url").keyup(function(){this.checkValidity()&&!$(this).val().match(/^ *$/)&&(handleImageURL(!0),refreshText())}),$("#custom-img-url").on("paste",function(){this.checkValidity()&&!$(this).val().match(/^ *$/)&&(handleImageURL(!0),refreshText())}),$('select,input[type="number"],input[type="color"],input[type="checkbox"]').each(function(e){"wemake-font"!==this.id&&"wemake-font-style"!==this.id&&"porn-font"!==this.id&&"porn-font-style"!==this.id?"bg-type"===this.id?$(this).change(function(){("img"===$(this).val()&&"telechat"===$("#bg-img").val()||"peanuts-nouka"===$("#bg-img").val())&&($("#rect-alpha").val(100),"peanuts-nouka"===$("#bg-img").val()&&($("#wemake-x").val("400"),$("#wemake-y").val("100"),$("#wemake-size").val("90"),$("#wemake-color").val("#FFFFFF"),$("#wemake-outline-color").val("#000000"),$("#wemake-outline-size").val(5),$("#porn-x").val("400"),$("#porn-y").val("385"),$("#porn-size").val("90"),$("#porn-color").val("#FFFFFF"),$("#porn-outline-color").val("#000000"),$("#porn-outline-size").val(5))),"img"===$(this).val()&&"custom"!==$("#bg-img").val()&&$("#custom-img-url").val(""),refreshText()}):"bg-img"===this.id?$(this).change(function(){"telechat"!==$(this).val()&&"peanuts-nouka"!==$("#bg-img").val()||($("#rect-alpha").val(100),"peanuts-nouka"===$("#bg-img").val()&&($("#wemake-x").val("400"),$("#wemake-y").val("100"),$("#wemake-size").val("90"),$("#wemake-color").val("#FFFFFF"),$("#wemake-outline-color").val("#000000"),$("#wemake-outline-size").val(5),$("#porn-x").val("400"),$("#porn-y").val("385"),$("#porn-size").val("90"),$("#porn-color").val("#FFFFFF"),$("#porn-outline-color").val("#000000"),$("#porn-outline-size").val(5))),"custom"!==$(this).val()&&($("#custom-x").val(0),$("#custom-y").val(0),$("#custom-size").val(1),$("#custom-img-url").val("")),refreshText()}):$(this).change(refreshText):$(this).change(function(){waitForfont(this.id)})}),$("#bg-type").change(toggleBgSettings),$("#toggle-svg").click(function(e){e.preventDefault(),$("#svg").hasClass("d-none")?($(this).removeClass("btn-info"),$(this).addClass("btn-primary"),hide("canvas"),show("svg"),this.text=workCanvas):($(this).removeClass("btn-primary"),$(this).addClass("btn-info"),hide("svg"),show("canvas"),this.text=workSvg),refreshText(),refreshFilename()}),$("#import").click(function(e){e.preventDefault(),$("#import-file").click()}),$("#export").click(exportData),$("#download").click(function(e){var a;this.download=$("#filename").val(),$("#svg").hasClass("d-none")?null==(a=$("#custom-img-url").val())||a.match(/^ *$/)||!$("#custom-img-url")[0].checkValidity()?this.href=document.getElementById("canvas").toDataURL("image/octet-stream"):(e.preventDefault(),alert(downloadClic)):this.href="data:image/octet-stream;base64,"+btoa(svg.getSerializedSvg(!0))}),$("[data-setting]").click(function(e){e.preventDefault();var a=$(this);$("[data-setting]").removeClass("active"),a.addClass("active"),"hide-settings"===a.data("setting")?(hide("gallery"),show("main-tool"),["settings","set-corner-shape","set-colors","set-fonts","set-bg","set-positions","set-img-size","set-rick"].forEach(function(e){hide(e)})):"gallery"===a.data("setting")?(hide("main-tool"),show("gallery"),fillGallery()):(hide("gallery"),show("main-tool"),["set-corner-shape","set-colors","set-fonts","set-bg","set-positions","set-img-size","set-rick"].forEach(function(e){(e!==a.data("setting")?hide:show)(e),show("settings")}))}),$("#reset").click(function(e){e.preventDefault(),reset()}),$("#switch-colors").click(function(e){e.preventDefault(),switchTextColors(),refreshText()}),$("#make-text-center").click(centerText),$("#custom-img").change(handleImage),null==customImg&&$("#custom-img").val(null),$("[data-i18n]").click(function(e){e.preventDefault(),createCookie("lang",$(this).data("i18n"),30),translate($(this).data("i18n"))}),$("#print").click(function(e){e.preventDefault(),window.print()}),$("#save").click(function(e){e.preventDefault(),addItem()})}function handleImageURL(e){$("#bg-type").val("img");var a=$("<option>"),t=$("#bg-img"),r=$('option[value="custom"]');0!==r.length&&r.remove(),a.attr("value","custom"),a.text(customImgText),t.append(a),t.val("custom"),e&&($("#custom-x").val(0),$("#custom-y").val(0),$("#custom-size").val(0)),toggleBgSettings()}function toggleBgSettings(){switch($("#bg-type").val()){case"plain":show("bg-color"),hide("gradient-settings"),hide("bg-img-settings"),hide("bg-custom-img-settings");break;case"gradient":hide("bg-color"),show("gradient-settings"),hide("bg-img-settings"),hide("bg-custom-img-settings");break;case"img":hide("bg-color"),hide("gradient-settings"),show("bg-img-settings"),show("bg-custom-img-settings");break;default:hide("bg-color"),hide("gradient-settings"),hide("bg-img-settings"),hide("bg-custom-img-settings")}}function refreshFilename(){var e=$("#wemake"),a=$("#porn"),t=$("#filename"),r="png";$("#svg").hasClass("d-none")||(r="svg");r=e.val()+" "+a.val()+"."+r;t.val(r.replace(/ /g,"_"))}function waitForfont(e,a){null==a&&(a=refreshText),e=e.replace("-style","");var t=$("#"+e).val(),r=$("#"+e+"-style").val();"sans-serif"===t||void 0!==loadedFonts[t]&&void 0!==loadedFonts[t][r]||void 0===fonts[t]||void 0===fonts[t][r]?("sans-serif"!==t&&(void 0===fonts[t]&&console.log(t+" is not a valid font"),void 0===fonts[t][r]&&console.log(r+" is not a valid style for font "+t)),a()):new FontFace(t,"url("+fonts[t][r]+")").load().then(function(e){console.log("font "+t+" "+r+" loaded"),document.fonts.add(e),void 0!==loadedFonts[t]?loadedFonts[t][r]=!0:loadedFonts[t]={s:!0},a()})}function toggleI18n(e){$("[data-i18n]").removeClass("active"),$('[data-i18n="'+e+'"]').addClass("active")}function handleImage(e){var a=new FileReader;a.onload=function(e){var r=new Image;r.onload=function(){var e=$("<option>"),a=$("#bg-img"),t=$('option[value="custom"]');0!==t.length&&t.remove(),e.attr("value","custom"),e.text(customImgText),a.append(e),a.val("custom"),customImg=r,$("#custom-x").val(0),$("#custom-y").val(0),$("#custom-size").val(0),refreshText()},r.src=e.target.result},a.readAsDataURL(e.target.files[0])}function switchTextColors(){var e=$("#wemake-color"),a=$("#porn-color"),t=e.val(),r=a.val();e.val(r),a.val(t)}function reset(){$("#wemake-x").val("400"),$("#wemake-y").val("160"),$("#wemake-size").val("150"),$("#wemake-color").val("#000000"),$("#wemake-alpha").val("0"),$("#wemake-font").val("Open Sans"),$("#wemake-font-style").val("bold"),$("#wemake-width").val("725"),$("#porn-x").val("400"),$("#porn-y").val("350"),$("#porn-size").val("220"),$("#porn-color").val("#000000"),$("#porn-alpha").val("0"),$("#porn-font").val("Open Sans"),$("#porn-font-style").val("bold"),$("#porn-width").val("725"),$("#bgu-color").val("#fcd205"),$("#rect-color").val("#000000"),$("#rect-alpha").val("0"),$("#add-glitter").prop("checked",!1),$("#bg-type").val("plain"),$("#gr-orientation").val("lr"),$("#bg-img").val("beer"),$("#corners").val("20"),$("#custom-img").val(null),$("#custom-x").val(0),$("#custom-y").val(0),$("#custom-size").val(0),$("#img-width").val(800),$("#img-height").val(400),$("#border-thickness").val(20),$("#custom-img-url").val(null),$("#add-rick").prop("checked",!1),$("#rick-x").val(0),$("#rick-y").val(0),$("#rick-size").val(100),$("#rick-rad").val(0),$("#wemake-outline-color").val("#FFFFFF"),$("#wemake-outline-size").val(0),$("#porn-outline-color").val("#FFFFFF"),$("#porn-outline-size").val(0),show("bg-color"),hide("gradient-settings"),hide("bg-img-settings"),hide("bg-custom-img-settings"),refreshText()}function refreshText(){var e=$("#wemake").val(),a=$("#wemake-x").val(),t=$("#wemake-y").val(),r=$("#wemake-size").val(),o=$("#wemake-color").val(),s=$("#wemake-alpha").val(),l=$("#wemake-font").val(),n=$("#wemake-font-style").val(),i=$("#wemake-width").val(),c=$("#porn").val(),g=$("#porn-x").val(),m=$("#porn-y").val(),d=$("#porn-size").val(),h=$("#porn-color").val(),v=$("#porn-alpha").val(),u=$("#porn-font").val(),f=$("#porn-font-style").val(),p=$("#porn-width").val(),w=$("#bgu-color").val(),k=$("#add-glitter").prop("checked"),b=$("#bg-type").val(),P=$("#rect-color").val(),y=$("#rect-alpha").val(),x=$("#bgr-color").val(),S=$("#egr-color").val(),C=$("#gr-orientation").val(),I=$("#bg-img").val(),F=$("#corners").val(),T=$("#border-thickness").val(),z=$("#custom-x").val(),R=$("#custom-y").val(),L=$("#custom-size").val(),O=$("#custom-img-url")[0].checkValidity()?$("#custom-img-url").val():"",U=$("#add-rick").prop("checked"),D=$("#rick-x").val(),A=$("#rick-y").val(),G=$("#rick-size").val(),B=$("#rick-rad").val(),N=$("#wemake-outline-color").val(),E=$("#wemake-outline-size").val(),M=$("#porn-outline-color").val(),W=$("#porn-outline-size").val(),J=$("#img-width").val(),j=$("#img-height").val();$("#canvas").remove();var q=document.createElement("canvas");q.id="canvas",q.classList.add("img-fluid"),q.width=J,q.height=j,document.getElementById("canvas-container").appendChild(q);var V=q.getContext("2d"),q=$("#svg");svg=new C2S(J,j),!1===q.hasClass("d-none")&&(V=svg);q=new URL(window.location);window.history.pushState("change","WemaWema",createUrl(q,e,a,t,r,o,s,l,n,i,c,g,m,d,h,v,u,f,p,w,y,k,b,P,x,S,C,I,F,T,J,j,z,R,L,O,U,D,A,G,B,N,E,M,W)),drawCtx(!1,V,P,y,r,o,s,l,n,e,a,t,d,h,v,u,f,c,g,m,k,J,j,T,b,w,F,I,L,x,S,C,z,R,O,U,D,A,G,B,i,p,N,E,M,W)}function drawCtx(o,s,l,n,i,c,g,m,d,h,v,u,f,p,w,k,b,P,y,x,S,C,I,F,T,z,R,L,O,U,D,A,G,B,N,E,M,W,J,j,q,V,X,H,Y,_){switch(s.clearRect(0,0,C,I),T){case"plain":s.fillStyle=z;break;case"gradient":switch(A){case"lr":Q=s.createLinearGradient(0,I/2,C,I/2);break;case"rl":Q=s.createLinearGradient(C,I/2,0,I/2);break;case"tb":Q=s.createLinearGradient(C/2,0,C/2,I);break;case"bt":Q=s.createLinearGradient(C/2,I,C/2,0);break;case"r":Q=s.createRadialGradient(C/2,I/2,25,C/2,I/2,C/2)}Q.addColorStop(0,U),Q.addColorStop(1,D),s.fillStyle=Q;break;case"img":var e,a,t,r,K;return void(!0!==o&&"custom"===L&&null!=customImg?(t=scalePreserveAspectRatio(e=customImg.width,a=customImg.height,C,I),0===parseFloat(O)?(O=Math.round(1e3*t)/1e3,!0!==o&&$("#custom-size").val(O)):t=O,!0!==o&&(r=new URL(window.location),window.history.pushState("change","WemaWema",createUrl(r,h,v,u,i,c,g,m,d,q,P,y,x,f,p,w,k,b,V,z,n,S,T,l,U,D,A,L,R,F,C,I,G,B,O,N,E,M,W,J,j,X,H,Y,_))),s.drawImage(customImg,0,0,e,a,G,B,e*t,a*t),drawOver(s,l,n,i,c,g,m,d,h,v,u,f,p,w,k,b,P,y,x,S,C,I,F,E,M,W,J,j,q,V,X,H,Y,_)):(""!==L&&("custom"!==L||null!=N&&""!==N)||(L="beer",!0===o||null!=N&&""!==N||$("#bg-img").val("beer")),K=new Image,Z="img/"+L,20===parseInt(R)&&(Z+="-round"),null==N||""===N?Z+=".png":Z=N,K.src=Z,K.onload=function(){var e,a=K.width,t=K.height,r=scalePreserveAspectRatio(a,t,C,I);0===parseFloat(O)?(O=Math.round(1e3*r)/1e3,!0!==o&&$("#custom-size").val(O)):r=O,!0!==o&&(e=new URL(window.location),window.history.pushState("change","WemaWema",createUrl(e,h,v,u,i,c,g,m,d,q,P,y,x,f,p,w,k,b,V,z,n,S,T,l,U,D,A,L,R,F,C,I,G,B,O,N,E,M,W,J,j,X,H,Y,_))),s.drawImage(K,0,0,a,t,G,B,a*r,t*r),drawOver(s,l,n,i,c,g,m,d,h,v,u,f,p,w,k,b,P,y,x,S,C,I,F,E,M,W,J,j,q,V,X,H,Y,_)}));case"rainbow":var Q=s.createLinearGradient(C/2,0,C/2,I),Z=svg.createLinearGradient(C/2,0,C/2,I);Q.addColorStop(0,"#e50000"),Q.addColorStop(.2,"#ff8d00"),Q.addColorStop(.4,"#ffee00"),Q.addColorStop(.6,"#008121"),Q.addColorStop(.8,"#004cff"),Q.addColorStop(1,"#760188"),Z.addColorStop(0,"#e50000"),Z.addColorStop(.2,"#ff8d00"),Z.addColorStop(.4,"#ffee00"),Z.addColorStop(.6,"#008121"),Z.addColorStop(.8,"#004cff"),Z.addColorStop(1,"#760188"),s.fillStyle=Q,svg.fillStyle=Z}roundRect(s,0,0,C,I,parseInt(R),!0,!1),drawOver(s,l,n,i,c,g,m,d,h,v,u,f,p,w,k,b,P,y,x,S,C,I,F,E,M,W,J,j,q,V,X,H,Y,_)}function drawOver(r,e,a,t,o,s,l,n,i,c,g,m,d,h,v,u,f,p,w,k,b,P,y,x,S,C,I,F,T,z,R,L,O,U){0<y&&(r.lineWidth=y,r.strokeStyle=colorToRGBA(e,a),roundRect(r,+b/32,+P/16,15*b/16,7*P/8,20,!1)),r.textAlign="center";var D,A,n="regular"===n?"":n+" ";r.font=n+parseInt(t)+"px '"+l+"'",r.fillStyle=colorToRGBA(o,s),0<L&&(r.strokeStyle=R,r.lineWidth=L,r.strokeText(i,parseInt(c),parseInt(g),T)),r.fillText(i,parseInt(c),parseInt(g),T),r.font=(n="regular"===u?"":u+" ")+parseInt(m)+"px '"+v,r.fillStyle=colorToRGBA(d,h),0<U&&(r.strokeStyle=O,r.lineWidth=U,r.strokeText(f,parseInt(p),parseInt(w),z)),r.fillText(f,parseInt(p),parseInt(w),z),x?((D=new Image).src="img/Rick.png",D.onload=function(){S=parseInt(S),C=parseInt(C);var e,a=D.width*I/100,t=D.height*I/100;console.log(a),console.log(t),r.translate(S+a/2,C+t/2),r.rotate(F*Math.PI/180),r.drawImage(D,-a/2,-t/2,a,t),r.rotate(-F*Math.PI/180),r.translate(-(S+a/2),-(C+t/2)),k?((e=new Image).src="img/glitter-calc.png",e.onload=function(){r.drawImage(e,0,0),$("#svg").html(svg.getSerializedSvg())}):$("#svg").html(svg.getSerializedSvg())}):k?((A=new Image).src="img/glitter-calc.png",A.onload=function(){r.drawImage(A,0,0),$("#svg").html(svg.getSerializedSvg())}):$("#svg").html(svg.getSerializedSvg())}function roundRect(e,a,t,r,o,s,l,n){if(void 0===n&&(n=!0),"number"==typeof(s=void 0===s?5:s))s={tl:s,tr:s,br:s,bl:s};else{var i,c={tl:0,tr:0,br:0,bl:0};for(i in c)s[i]=s[i]||c[i]}e.beginPath(),e.moveTo(a+s.tl,t),e.lineTo(a+r-s.tr,t),e.quadraticCurveTo(a+r,t,a+r,t+s.tr),e.lineTo(a+r,t+o-s.br),e.quadraticCurveTo(a+r,t+o,a+r-s.br,t+o),e.lineTo(a+s.bl,t+o),e.quadraticCurveTo(a,t+o,a,t+o-s.bl),e.lineTo(a,t+s.tl),e.quadraticCurveTo(a,t,a+s.tl,t),e.closePath(),l&&e.fill(),n&&e.stroke()}function addItem(){for(var e=null===(e=localStorage.getItem("wemas"))?{}:JSON.parse(e),a=$("#filename").val().replace(/\.(png|svg)$/,""),t=1,r=a;void 0!==e[r]&&null!==e[r];)r=a+"-"+t,t++;e[r]={w:$("#wemake").val(),wx:$("#wemake-x").val(),wy:$("#wemake-y").val(),ws:$("#wemake-size").val(),wc:$("#wemake-color").val(),wa:$("#wemake-alpha").val(),wf:$("#wemake-font").val(),wfs:$("#wemake-font-style").val(),ww:$("#wemake-width").val(),p:$("#porn").val(),px:$("#porn-x").val(),py:$("#porn-y").val(),ps:$("#porn-size").val(),pc:$("#porn-color").val(),pa:$("#porn-alpha").val(),pf:$("#porn-font").val(),pfs:$("#porn-font-style").val(),pw:$("#porn-width").val(),co:$("#bgu-color").val(),gli:$("#add-glitter").prop("checked"),bgt:$("#bg-type").val(),rc:$("#rect-color").val(),ra:$("#rect-alpha").val(),bgr:$("#bgr-color").val(),egr:$("#egr-color").val(),or:$("#gr-orientation").val(),bgi:$("#bg-img").val(),cor:$("#corners").val(),bth:$("#border-thickness").val(),width:$("#img-width").val(),height:$("#img-height").val(),x:$("#custom-x").val(),y:$("#custom-y").val(),s:$("#custom-size").val(),bgu:$("#custom-img-url").val(),r:$("#add-rick").prop("checked"),rx:$("#rick-x").val(),ry:$("#rick-y").val(),rs:$("#rick-size").val(),rr:$("#rick-rad").val(),woc:$("#wemake-outline-color").val(),wos:$("#wemake-outline-size").val(),poc:$("#porn-outline-color").val(),pos:$("#porn-outline-size").val()},localStorage.setItem("wemas",JSON.stringify(e))}function deleteItem(e){var a=localStorage.getItem("wemas");null===a?a={}:void 0!==(a=JSON.parse(a))[e]&&null!==a[e]&&delete a[e],localStorage.setItem("wemas",JSON.stringify(a))}function fillGallery(){var i=$("#gallery"),c=localStorage.getItem("wemas");null===c?(c={},localStorage.setItem("wemas",JSON.stringify(c))):c=JSON.parse(c),i.empty();var e=Object.keys(c).sort();0===e.length?i.html("<h1>"+sorryNoGallery+"</h1>"):e.forEach(function(a){var t=c[a],e=$("<div>");e.addClass("card"),e.attr("data-item",a);var r=document.createElement("canvas");r.classList.add("img-fluid"),r.setAttribute("width",t.width),r.setAttribute("height",t.height),drawCtx(!0,r.getContext("2d"),t.rc,t.ra,t.ws,t.wc,t.wa,t.wf,t.wfs,t.w,t.wx,t.wy,t.ps,t.pc,t.pa,t.pf,t.pfs,t.p,t.px,t.py,t.gli,t.width,t.height,t.bth,t.bgt,t.co,t.cor,t.bgi,t.s,t.bgr,t.egr,t.org,t.x,t.y,t.bgu,t.r,t.rx,t.ry,t.rs,t.rr,t.ww,t.pw,t.woc,t.wos,t.poc,t.pos),e.html(r);var o=$("<div>");o.addClass("row text-center");var s=$("<div>");s.addClass("col-sm-12 col-md-4");var l=$("<a>");l.addClass("btn btn-info btn-block");var n=createUrl(new URL(window.location),t.w,t.wx,t.wy,t.ws,t.wc,t.wa,t.wf,t.wfs,t.ww,t.p,t.px,t.py,t.ps,t.pc,t.pa,t.pf,t.pfs,t.pw,t.co,t.ra,t.gli,t.bgt,t.rc,t.bgr,t.egr,t.or,t.bgi,t.cor,t.bth,t.width,t.height,t.x,t.y,t.s,t.bgu,t.r,t.rx,t.ry,t.rs,t.rr,t.woc,t.wos,t.poc,t.pos);l.attr("href",n),l.text(load),s.append(l);r=$("<div>");r.addClass("col-sm-12 col-md-4");n=$("<a>");n.addClass("btn btn-info btn-block"),n.attr("href","#"),n.click(function(e){this.download=$("#filename").val(),void 0===t.bgu||null===t.bgu||t.bgu.match(/^ *$/)?this.href=$('[data-item="'+a+'"] canvas')[0].toDataURL("image/octet-stream"):(e.preventDefault(),alert(downloadClic))}),n.text(download),r.append(n);l=$("<div>");l.addClass("col-sm-12 col-md-4");n=$("<a>");n.addClass("btn btn-info btn-block"),n.attr("href","#"),n.click(function(e){e.preventDefault(),deleteItem(a),$('[data-item="'+a+'"]').remove()}),n.text(deleteText),l.append(n),o.append(s,r,l),e.append(o),i.append(e)})}function show(e){e=$("#"+e);e.hasClass("d-none")&&e.removeClass("d-none")}function hide(e){e=$("#"+e);e.hasClass("d-none")||e.addClass("d-none")}function scalePreserveAspectRatio(e,a,t,r){return Math.min(t/e,r/a)}function colorToRGBA(e,a){e=e.split("");return r=parseInt(""+e[1]+e[2],16),g=parseInt(""+e[3]+e[4],16),b=parseInt(""+e[5]+e[6],16),"rgba("+r+","+g+","+b+","+(1-a/100)+")"}function createCookie(e,a,t){var r;r=t?((r=new Date).setTime(r.getTime()+24*t*60*60*1e3),"; expires="+r.toGMTString()):"",document.cookie=e+"="+a+r+"; path=/"}function readCookie(e){for(var a=e+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(a))return o.substring(a.length,o.length)}return null}function centerText(e){e.preventDefault();var a=$("#wemake-x"),t=$("#wemake-y"),r=$("#porn-x"),o=$("#porn-y"),s=$("#img-width").val(),e=$("#img-height").val();a.val(s/2),t.val(e/4+3*e/20),r.val(s/2),o.val(3*e/4+e/8),refreshText()}function createUrl(e,a,t,r,o,s,l,n,i,c,g,m,d,h,v,u,f,p,$,w,k,b,P,y,x,S,C,I,F,T,z,R,L,O,U,D,A,G,B,N,E,M,W,J,j){return e.searchParams.set("w",a),e.searchParams.set("wx",t),e.searchParams.set("wy",r),e.searchParams.set("ws",o),e.searchParams.set("wc",s),e.searchParams.set("wa",l),e.searchParams.set("wf",n),e.searchParams.set("wfs",i),e.searchParams.set("ww",c),e.searchParams.set("p",g),e.searchParams.set("px",m),e.searchParams.set("py",d),e.searchParams.set("ps",h),e.searchParams.set("pc",v),e.searchParams.set("pa",u),e.searchParams.set("pf",f),e.searchParams.set("pfs",p),e.searchParams.set("pw",$),e.searchParams.set("co",w),e.searchParams.set("ra",k),e.searchParams.set("gli",b),e.searchParams.set("bgt",P),e.searchParams.set("rc",y),e.searchParams.set("bgr",x),e.searchParams.set("egr",S),e.searchParams.set("or",C),e.searchParams.set("bgi",I),e.searchParams.set("cor",F),e.searchParams.set("bth",T),e.searchParams.set("width",z),e.searchParams.set("height",R),e.searchParams.set("x",L),e.searchParams.set("y",O),e.searchParams.set("s",U),e.searchParams.set("bgu",D),e.searchParams.set("r",A),e.searchParams.set("rx",G),e.searchParams.set("ry",B),e.searchParams.set("rs",N),e.searchParams.set("rr",E),e.searchParams.set("woc",M),e.searchParams.set("wos",W),e.searchParams.set("poc",J),e.searchParams.set("pos",j),e}function importData(e){var t=new FileReader;t.addEventListener("loadend",function(){try{var e=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t.result))),a=localStorage.getItem("wemas");null===a?localStorage.setItem("wemas",JSON.stringify(e)):(a=JSON.parse(a),$.extend(a,e),localStorage.setItem("wemas",JSON.stringify(a))),fillGallery(),alert(importOk)}catch(e){alert(e)}}),t.readAsArrayBuffer(e[0])}function exportData(e){e.preventDefault();var a=$('<a id="export-data-json">');a.hide(),$("body").append(a);e=[localStorage.getItem("wemas")],e=new Blob(e,{type:"application/json"}),e=window.URL.createObjectURL(e);a.attr("href",e),a.attr("download","export-data.json"),$("#export-data-json")[0].click(),$("#export-data-json").remove()}$(document).ready(function(){detectLang(),getParameters(),bindEvents(),toggleBgSettings(),refreshFilename(),waitForfont("wemake-font",function(){waitForfont("porn-font")})});
\ No newline at end of file
var svg,customImg,workCanvas="Work with canvas",workSvg="Work with SVG",customImgText="Custom image",sorryNoGallery="Sorry, but you haven't saved any image yet",load="Load",deleteText="Delete",download="Download",downloadClic='Please, right-click on the sticker and select "Save as" to download the sticker',importOk="Your file has been successfully imported",fonts={Amarante:{regular:"fonts/amarante/Amarante.woff2",bold:"fonts/amarante/Amarante.woff2",italic:"fonts/amarante/Amarante.woff2","italic bold":"fonts/amarante/Amarante.woff2"},"Comic Neue":{regular:"fonts/comic-neue/ComicNeue-Regular.woff2",bold:"fonts/comic-neue/ComicNeue-Bold.woff2",italic:"fonts/comic-neue/ComicNeue-Regular-Oblique.woff2","italic bold":"fonts/comic-neue/ComicNeue-Bold-Oblique.woff2"},"Comic Spice":{regular:"fonts/comic-spice/ComicSpice.woff2",bold:"fonts/comic-spice/ComicSpice.woff2",italic:"fonts/comic-spice/ComicSpice.woff2","italic bold":"fonts/comic-spice/ComicSpice.woff2"},Hack:{regular:"fonts/hack/hack-regular-webfont.woff2",bold:"fonts/hack/hack-bold-webfont.woff2",italic:"fonts/hack/hack-italic-webfont.woff2","italic bold":"fonts/hack/hack-bolditalic-webfont.woff2"},"Open Sans":{regular:"fonts/open-sans/OpenSans-Regular.woff2",bold:"fonts/open-sans/OpenSans-Bold.woff2",italic:"fonts/open-sans/OpenSans-Italic.woff2","italic bold":"fonts/open-sans/OpenSans-BoldItalic.woff2"},"Some Time Later":{regular:"fonts/some-time-later/Some-Time-Later.woff2",bold:"fonts/some-time-later/Some-Time-Later.woff2",italic:"fonts/some-time-later/Some-Time-Later.woff2","italic bold":"fonts/some-time-later/Some-Time-Later.woff2"},Nosifer:{regular:"fonts/nosifer/nosifer.woff2",bold:"fonts/nosifer/nosifer.woff2",italic:"fonts/nosifer/nosifer.woff2","italic bold":"fonts/nosifer/nosifer.woff2"},UnifrakturMaguntia:{regular:"fonts/unifraktur-maguntia/UnifrakturMaguntia.woff2",bold:"fonts/unifraktur-maguntia/UnifrakturMaguntia.woff2",italic:"fonts/unifraktur-maguntia/UnifrakturMaguntia.woff2","italic bold":"fonts/unifraktur-maguntia/UnifrakturMaguntia.woff2"},Xolonium:{regular:"fonts/xolonium/Xolonium-Regular.woff2",bold:"fonts/xolonium/Xolonium-Bold.woff2",italic:"fonts/xolonium/Xolonium-Regular.woff2","italic bold":"fonts/xolonium/Xolonium-Bold.woff2"}},loadedFonts={};function detectLang(){var e=[],a=readCookie("lang");null!=a&&e.push(a);for(var t=navigator.languages,r=0;r<t.length;r++)e.push(t[r]);0!==e.length?translate(e.shift(),e):(console.log("Using old style language detection."),translate(navigator.language||navigator.userLanguage))}function translate(t,e){$.get({url:"locales/"+t+".json",dataType:"json",error:function(){null!=e&&0!==e.length&&translate(e.shift(),e)},success:function(a){var e;toggleI18n(t),"groot"===t&&($("#wemake").val("I am"),$("#porn").val("Groot"),$("#bg-type").val("img"),$("#bg-img").val("bark"),$("#wemake-color").val("#ffffff"),$("#porn-color").val("#ffffff"),$("#rect-color").val("#ffffff"),toggleBgSettings(),refreshFilename(),refreshText()),["get-source","license","author","wemake","porn","border-txt","color","transparency","x-position","y-position","font","style","text-size","text-width","outline-color","outline-size"].forEach(function(e){void 0!==a[e]&&$("."+e).text(a[e])}),["hide-settings","set-corner-shape","set-colors","set-fonts","set-bg","set-positions","set-img-size","gallery"].forEach(function(e){void 0!==a[e]&&$('[data-setting="'+e+'"]').text(a[e])}),["wemake","porn","filename","corners","bg-type","bgu-color","bgr-color","egr-color","gr-orientation","bg-img","custom-img","custom-x","custom-y","custom-size","border-thickness","img-width","img-height","custom-img-url","rick-size","rick-x","rick-y","rick-rad"].forEach(function(e){void 0!==a[e]&&$('label[for="'+e+'"]').text(a[e])}),void 0!==a["corners-rounded"]&&$('#corners option[value="20"]').text(a["corners-rounded"]),void 0!==a["corners-square"]&&$('#corners option[value="0"]').text(a["corners-square"]),void 0!==a["add-glitter"]&&$(".glitter span").text(a["add-glitter"]),["plain","gradient","rainbow","img","lr","rl","tb","bt","r","beer","glitter","rainbow-flag","sky","field","bridge","regular","bold","italic","italic bold","bark","snow","whale"].forEach(function(e){void 0!==a[e]&&$('option[value="'+e+'"]').text(a[e])}),["settings-dpdn","toggle-svg","download","reset","switch-colors","make-text-center","print","save","import","export"].forEach(function(e){void 0!==a[e]&&("download"===e&&(download=a[e]),$("#"+e).text(a[e]))}),void 0!==a["i18n-dpdn"]&&$("#i18n-dpdn i").attr("title",a["i18n-dpdn"]),void 0!==a["import-n-export"]&&$("#import-n-export").attr("title",a["import-n-export"]),void 0!==a["toggle-canvas"]&&(workCanvas=a["toggle-canvas"]),void 0!==a["toggle-svg"]&&(workSvg=a["toggle-svg"]),void 0!==a["sorry-no-gallery"]&&(sorryNoGallery=a["sorry-no-gallery"]),void 0!==a.load&&(load=a.load),void 0!==a.delete&&(deleteText=a.delete),void 0!==a["custom-img-text"]&&(customImgText=a["custom-img-text"],0!==(e=$('option[value="custom"]')).length&&e.text(customImgText)),void 0!==a["import-ok"]&&(importOk=a["import-ok"]),void 0!==a["download-clic"]&&(downloadClic=a["download-clic"]),void 0!==a["add-rick"]&&$(".rick span").text(a["add-rick"])}})}function getParameters(){window.location.hash&&$("#porn").val(decodeURIComponent(window.location.hash.substr(1)));var e=new URL(window.location);null!==e.searchParams.get("w")&&$("#wemake").val(e.searchParams.get("w")),null!==e.searchParams.get("wx")&&$("#wemake-x").val(e.searchParams.get("wx")),null!==e.searchParams.get("wy")&&$("#wemake-y").val(e.searchParams.get("wy")),null!==e.searchParams.get("ws")&&$("#wemake-size").val(e.searchParams.get("ws")),null!==e.searchParams.get("wc")&&$("#wemake-color").val(e.searchParams.get("wc")),null!==e.searchParams.get("wa")&&$("#wemake-alpha").val(e.searchParams.get("wa")),null!==e.searchParams.get("wf")&&$("#wemake-font").val(e.searchParams.get("wf")),null!==e.searchParams.get("wfs")&&$("#wemake-font-style").val(e.searchParams.get("wfs")),null!==e.searchParams.get("ww")&&$("#wemake-width").val(e.searchParams.get("ww")),null!==e.searchParams.get("p")&&$("#porn").val(e.searchParams.get("p")),null!==e.searchParams.get("px")&&$("#porn-x").val(e.searchParams.get("px")),null!==e.searchParams.get("py")&&$("#porn-y").val(e.searchParams.get("py")),null!==e.searchParams.get("ps")&&$("#porn-size").val(e.searchParams.get("ps")),null!==e.searchParams.get("pc")&&$("#porn-color").val(e.searchParams.get("pc")),null!==e.searchParams.get("pa")&&$("#porn-alpha").val(e.searchParams.get("pa")),null!==e.searchParams.get("pf")&&$("#porn-font").val(e.searchParams.get("pf")),null!==e.searchParams.get("pfs")&&$("#porn-font-style").val(e.searchParams.get("pfs")),null!==e.searchParams.get("pw")&&$("#porn-width").val(e.searchParams.get("pw")),null!==e.searchParams.get("co")&&$("#bgu-color").val(e.searchParams.get("co")),null!==e.searchParams.get("gli")&&$("#add-glitter").prop("checked","true"===e.searchParams.get("gli")),null!==e.searchParams.get("bgt")&&$("#bg-type").val(e.searchParams.get("bgt")),null!==e.searchParams.get("rc")&&$("#rect-color").val(e.searchParams.get("rc")),null!==e.searchParams.get("ra")&&$("#rect-alpha").val(e.searchParams.get("ra")),null!==e.searchParams.get("bgr")&&$("#bgr-color").val(e.searchParams.get("bgr")),null!==e.searchParams.get("egr")&&$("#egr-color").val(e.searchParams.get("egr")),null!==e.searchParams.get("or")&&$("#gr-orientation").val(e.searchParams.get("or")),null!==e.searchParams.get("bgi")&&"custom"!==e.searchParams.get("bgi")?$("#bg-img").val(e.searchParams.get("bgi")):$("#bg-img").val("beer"),null!==e.searchParams.get("cor")&&$("#corners").val(e.searchParams.get("cor")),null!==e.searchParams.get("f")&&$("#filename").val(e.searchParams.get("f")),null!==e.searchParams.get("width")&&$("#img-width").val(e.searchParams.get("width")),null!==e.searchParams.get("height")&&$("#img-height").val(e.searchParams.get("height")),null!==e.searchParams.get("bth")&&$("#border-thickness").val(e.searchParams.get("bth")),null!==e.searchParams.get("x")&&$("#custom-x").val(e.searchParams.get("x")),null!==e.searchParams.get("y")&&$("#custom-y").val(e.searchParams.get("y")),null!==e.searchParams.get("s")&&$("#custom-size").val(e.searchParams.get("s")),null!==e.searchParams.get("bgu")&&""!==e.searchParams.get("bgu")&&($("#custom-img-url").val(e.searchParams.get("bgu")),handleImageURL(!1)),null!==e.searchParams.get("r")&&$("#add-rick").prop("checked","true"===e.searchParams.get("r")),null!==e.searchParams.get("rx")&&$("#rick-x").val(e.searchParams.get("rx")),null!==e.searchParams.get("ry")&&$("#rick-y").val(e.searchParams.get("ry")),null!==e.searchParams.get("rs")&&$("#rick-size").val(e.searchParams.get("rs")),null!==e.searchParams.get("rr")&&$("#rick-rad").val(e.searchParams.get("rr")),null!==e.searchParams.get("woc")&&$("#wemake-outline-color").val(e.searchParams.get("woc")),null!==e.searchParams.get("wos")&&$("#wemake-outline-size").val(e.searchParams.get("wos")),null!==e.searchParams.get("poc")&&$("#porn-outline-color").val(e.searchParams.get("poc")),null!==e.searchParams.get("pos")&&$("#porn-outline-size").val(e.searchParams.get("pos"))}function bindEvents(){$('input[type="text"]').each(function(e){"filename"!==this.id&&($(this).keyup(function(){refreshText(),refreshFilename()}),$(this).on("paste",function(){refreshText(),refreshFilename()}))}),$("#custom-img-url").keyup(function(){this.checkValidity()&&!$(this).val().match(/^ *$/)&&(handleImageURL(!0),refreshText())}),$("#custom-img-url").on("paste",function(){this.checkValidity()&&!$(this).val().match(/^ *$/)&&(handleImageURL(!0),refreshText())}),$('select,input[type="number"],input[type="color"],input[type="checkbox"]').each(function(e){"wemake-font"!==this.id&&"wemake-font-style"!==this.id&&"porn-font"!==this.id&&"porn-font-style"!==this.id?"bg-type"===this.id?$(this).change(function(){("img"===$(this).val()&&"telechat"===$("#bg-img").val()||"peanuts-nouka"===$("#bg-img").val())&&($("#rect-alpha").val(100),"peanuts-nouka"===$("#bg-img").val()&&($("#wemake-x").val("400"),$("#wemake-y").val("100"),$("#wemake-size").val("90"),$("#wemake-color").val("#FFFFFF"),$("#wemake-outline-color").val("#000000"),$("#wemake-outline-size").val(5),$("#porn-x").val("400"),$("#porn-y").val("385"),$("#porn-size").val("90"),$("#porn-color").val("#FFFFFF"),$("#porn-outline-color").val("#000000"),$("#porn-outline-size").val(5))),"img"===$(this).val()&&"custom"!==$("#bg-img").val()&&$("#custom-img-url").val(""),refreshText()}):"bg-img"===this.id?$(this).change(function(){"telechat"!==$(this).val()&&"peanuts-nouka"!==$("#bg-img").val()||($("#rect-alpha").val(100),"peanuts-nouka"===$("#bg-img").val()&&($("#wemake-x").val("400"),$("#wemake-y").val("100"),$("#wemake-size").val("90"),$("#wemake-color").val("#FFFFFF"),$("#wemake-outline-color").val("#000000"),$("#wemake-outline-size").val(5),$("#porn-x").val("400"),$("#porn-y").val("385"),$("#porn-size").val("90"),$("#porn-color").val("#FFFFFF"),$("#porn-outline-color").val("#000000"),$("#porn-outline-size").val(5))),"custom"!==$(this).val()&&($("#custom-x").val(0),$("#custom-y").val(0),$("#custom-size").val(1),$("#custom-img-url").val("")),refreshText()}):$(this).change(refreshText):$(this).change(function(){waitForfont(this.id)})}),$("#bg-type").change(toggleBgSettings),$("#toggle-svg").click(function(e){e.preventDefault(),$("#svg").hasClass("d-none")?($(this).removeClass("btn-info"),$(this).addClass("btn-primary"),hide("canvas"),show("svg"),this.text=workCanvas):($(this).removeClass("btn-primary"),$(this).addClass("btn-info"),hide("svg"),show("canvas"),this.text=workSvg),refreshText(),refreshFilename()}),$("#import").click(function(e){e.preventDefault(),$("#import-file").click()}),$("#export").click(exportData),$("#download").click(function(e){var a;this.download=$("#filename").val(),$("#svg").hasClass("d-none")?null==(a=$("#custom-img-url").val())||a.match(/^ *$/)||!$("#custom-img-url")[0].checkValidity()?this.href=document.getElementById("canvas").toDataURL("image/octet-stream"):(e.preventDefault(),alert(downloadClic)):this.href="data:image/octet-stream;base64,"+btoa(svg.getSerializedSvg(!0))}),$("[data-setting]").click(function(e){e.preventDefault();var a=$(this);$("[data-setting]").removeClass("active"),a.addClass("active"),"hide-settings"===a.data("setting")?(hide("gallery"),show("main-tool"),["settings","set-corner-shape","set-colors","set-fonts","set-bg","set-positions","set-img-size","set-rick"].forEach(function(e){hide(e)})):"gallery"===a.data("setting")?(hide("main-tool"),show("gallery"),fillGallery()):(hide("gallery"),show("main-tool"),["set-corner-shape","set-colors","set-fonts","set-bg","set-positions","set-img-size","set-rick"].forEach(function(e){(e!==a.data("setting")?hide:show)(e),show("settings")}))}),$("#reset").click(function(e){e.preventDefault(),reset()}),$("#switch-colors").click(function(e){e.preventDefault(),switchTextColors(),refreshText()}),$("#make-text-center").click(centerText),$("#custom-img").change(handleImage),null==customImg&&$("#custom-img").val(null),$("[data-i18n]").click(function(e){e.preventDefault(),createCookie("lang",$(this).data("i18n"),30),translate($(this).data("i18n"))}),$("#print").click(function(e){e.preventDefault(),window.print()}),$("#save").click(function(e){e.preventDefault(),addItem()})}function handleImageURL(e){$("#bg-type").val("img");var a=$("<option>"),t=$("#bg-img"),r=$('option[value="custom"]');0!==r.length&&r.remove(),a.attr("value","custom"),a.text(customImgText),t.append(a),t.val("custom"),e&&($("#custom-x").val(0),$("#custom-y").val(0),$("#custom-size").val(0)),toggleBgSettings()}function toggleBgSettings(){switch($("#bg-type").val()){case"plain":show("bg-color"),hide("gradient-settings"),hide("bg-img-settings"),hide("bg-custom-img-settings");break;case"gradient":hide("bg-color"),show("gradient-settings"),hide("bg-img-settings"),hide("bg-custom-img-settings");break;case"img":hide("bg-color"),hide("gradient-settings"),show("bg-img-settings"),show("bg-custom-img-settings");break;default:hide("bg-color"),hide("gradient-settings"),hide("bg-img-settings"),hide("bg-custom-img-settings")}}function refreshFilename(){var e=$("#wemake"),a=$("#porn"),t=$("#filename"),r="png";$("#svg").hasClass("d-none")||(r="svg");r=e.val()+" "+a.val()+"."+r;t.val(r.replace(/ /g,"_"))}function waitForfont(e,a){null==a&&(a=refreshText),e=e.replace("-style","");var t=$("#"+e).val(),r=$("#"+e+"-style").val();"sans-serif"===t||void 0!==loadedFonts[t]&&void 0!==loadedFonts[t][r]||void 0===fonts[t]||void 0===fonts[t][r]?("sans-serif"!==t&&(void 0===fonts[t]&&console.log(t+" is not a valid font"),void 0===fonts[t][r]&&console.log(r+" is not a valid style for font "+t)),a()):new FontFace(t,"url("+fonts[t][r]+")").load().then(function(e){console.log("font "+t+" "+r+" loaded"),document.fonts.add(e),void 0!==loadedFonts[t]?loadedFonts[t][r]=!0:loadedFonts[t]={s:!0},a()})}function toggleI18n(e){$("[data-i18n]").removeClass("active"),$('[data-i18n="'+e+'"]').addClass("active")}function handleImage(e){var a=new FileReader;a.onload=function(e){var r=new Image;r.onload=function(){var e=$("<option>"),a=$("#bg-img"),t=$('option[value="custom"]');0!==t.length&&t.remove(),e.attr("value","custom"),e.text(customImgText),a.append(e),a.val("custom"),customImg=r,$("#custom-x").val(0),$("#custom-y").val(0),$("#custom-size").val(0),refreshText()},r.src=e.target.result},a.readAsDataURL(e.target.files[0])}function switchTextColors(){var e=$("#wemake-color"),a=$("#porn-color"),t=e.val(),r=a.val();e.val(r),a.val(t)}function reset(){$("#wemake-x").val("400"),$("#wemake-y").val("160"),$("#wemake-size").val("150"),$("#wemake-color").val("#000000"),$("#wemake-alpha").val("0"),$("#wemake-font").val("Open Sans"),$("#wemake-font-style").val("bold"),$("#wemake-width").val("725"),$("#porn-x").val("400"),$("#porn-y").val("350"),$("#porn-size").val("220"),$("#porn-color").val("#000000"),$("#porn-alpha").val("0"),$("#porn-font").val("Open Sans"),$("#porn-font-style").val("bold"),$("#porn-width").val("725"),$("#bgu-color").val("#fcd205"),$("#rect-color").val("#000000"),$("#rect-alpha").val("0"),$("#add-glitter").prop("checked",!1),$("#bg-type").val("plain"),$("#gr-orientation").val("lr"),$("#bg-img").val("beer"),$("#corners").val("20"),$("#custom-img").val(null),$("#custom-x").val(0),$("#custom-y").val(0),$("#custom-size").val(0),$("#img-width").val(800),$("#img-height").val(400),$("#border-thickness").val(20),$("#custom-img-url").val(null),$("#add-rick").prop("checked",!1),$("#rick-x").val(0),$("#rick-y").val(0),$("#rick-size").val(100),$("#rick-rad").val(0),$("#wemake-outline-color").val("#FFFFFF"),$("#wemake-outline-size").val(0),$("#porn-outline-color").val("#FFFFFF"),$("#porn-outline-size").val(0),show("bg-color"),hide("gradient-settings"),hide("bg-img-settings"),hide("bg-custom-img-settings"),refreshText()}function refreshText(){var e=$("#wemake").val(),a=$("#wemake-x").val(),t=$("#wemake-y").val(),r=$("#wemake-size").val(),o=$("#wemake-color").val(),s=$("#wemake-alpha").val(),l=$("#wemake-font").val(),n=$("#wemake-font-style").val(),i=$("#wemake-width").val(),c=$("#porn").val(),g=$("#porn-x").val(),m=$("#porn-y").val(),d=$("#porn-size").val(),h=$("#porn-color").val(),v=$("#porn-alpha").val(),u=$("#porn-font").val(),f=$("#porn-font-style").val(),p=$("#porn-width").val(),w=$("#bgu-color").val(),k=$("#add-glitter").prop("checked"),b=$("#bg-type").val(),P=$("#rect-color").val(),y=$("#rect-alpha").val(),x=$("#bgr-color").val(),S=$("#egr-color").val(),C=$("#gr-orientation").val(),I=$("#bg-img").val(),F=$("#corners").val(),T=$("#border-thickness").val(),z=$("#custom-x").val(),R=$("#custom-y").val(),L=$("#custom-size").val(),O=$("#custom-img-url")[0].checkValidity()?$("#custom-img-url").val():"",U=$("#add-rick").prop("checked"),D=$("#rick-x").val(),A=$("#rick-y").val(),G=$("#rick-size").val(),B=$("#rick-rad").val(),N=$("#wemake-outline-color").val(),E=$("#wemake-outline-size").val(),M=$("#porn-outline-color").val(),W=$("#porn-outline-size").val(),J=$("#img-width").val(),j=$("#img-height").val();$("#canvas").remove();var q=document.createElement("canvas");q.id="canvas",q.classList.add("img-fluid"),q.width=J,q.height=j,document.getElementById("canvas-container").appendChild(q);var V=q.getContext("2d"),q=$("#svg");svg=new C2S(J,j),!1===q.hasClass("d-none")&&(V=svg);q=new URL(window.location);window.history.pushState("change","WemaWema",createUrl(q,e,a,t,r,o,s,l,n,i,c,g,m,d,h,v,u,f,p,w,y,k,b,P,x,S,C,I,F,T,J,j,z,R,L,O,U,D,A,G,B,N,E,M,W)),drawCtx(!1,V,P,y,r,o,s,l,n,e,a,t,d,h,v,u,f,c,g,m,k,J,j,T,b,w,F,I,L,x,S,C,z,R,O,U,D,A,G,B,i,p,N,E,M,W)}function drawCtx(o,s,l,n,i,c,g,m,d,h,v,u,f,p,w,k,b,P,y,x,S,C,I,F,T,z,R,L,O,U,D,A,G,B,N,E,M,W,J,j,q,V,X,H,Y,_){switch(s.clearRect(0,0,C,I),T){case"plain":s.fillStyle=z;break;case"gradient":switch(A){case"lr":Q=s.createLinearGradient(0,I/2,C,I/2);break;case"rl":Q=s.createLinearGradient(C,I/2,0,I/2);break;case"tb":Q=s.createLinearGradient(C/2,0,C/2,I);break;case"bt":Q=s.createLinearGradient(C/2,I,C/2,0);break;case"r":Q=s.createRadialGradient(C/2,I/2,25,C/2,I/2,C/2)}Q.addColorStop(0,U),Q.addColorStop(1,D),s.fillStyle=Q;break;case"img":var e,a,t,r,K;return void(!0!==o&&"custom"===L&&null!=customImg?(t=scalePreserveAspectRatio(e=customImg.width,a=customImg.height,C,I),0===parseFloat(O)?(O=Math.round(1e3*t)/1e3,!0!==o&&$("#custom-size").val(O)):t=O,!0!==o&&(r=new URL(window.location),window.history.pushState("change","WemaWema",createUrl(r,h,v,u,i,c,g,m,d,q,P,y,x,f,p,w,k,b,V,z,n,S,T,l,U,D,A,L,R,F,C,I,G,B,O,N,E,M,W,J,j,X,H,Y,_))),s.drawImage(customImg,0,0,e,a,G,B,e*t,a*t),drawOver(s,l,n,i,c,g,m,d,h,v,u,f,p,w,k,b,P,y,x,S,C,I,F,E,M,W,J,j,q,V,X,H,Y,_)):(""!==L&&("custom"!==L||null!=N&&""!==N)||(L="beer",!0===o||null!=N&&""!==N||$("#bg-img").val("beer")),K=new Image,Z="img/"+L,20===parseInt(R)&&(Z+="-round"),null==N||""===N?Z+=".png":Z=N,K.src=Z,K.onload=function(){var e,a=K.width,t=K.height,r=scalePreserveAspectRatio(a,t,C,I);0===parseFloat(O)?(O=Math.round(1e3*r)/1e3,!0!==o&&$("#custom-size").val(O)):r=O,!0!==o&&(e=new URL(window.location),window.history.pushState("change","WemaWema",createUrl(e,h,v,u,i,c,g,m,d,q,P,y,x,f,p,w,k,b,V,z,n,S,T,l,U,D,A,L,R,F,C,I,G,B,O,N,E,M,W,J,j,X,H,Y,_))),s.drawImage(K,0,0,a,t,G,B,a*r,t*r),drawOver(s,l,n,i,c,g,m,d,h,v,u,f,p,w,k,b,P,y,x,S,C,I,F,E,M,W,J,j,q,V,X,H,Y,_)}));case"rainbow":var Q=s.createLinearGradient(C/2,0,C/2,I),Z=svg.createLinearGradient(C/2,0,C/2,I);Q.addColorStop(0,"#e50000"),Q.addColorStop(.2,"#ff8d00"),Q.addColorStop(.4,"#ffee00"),Q.addColorStop(.6,"#008121"),Q.addColorStop(.8,"#004cff"),Q.addColorStop(1,"#760188"),Z.addColorStop(0,"#e50000"),Z.addColorStop(.2,"#ff8d00"),Z.addColorStop(.4,"#ffee00"),Z.addColorStop(.6,"#008121"),Z.addColorStop(.8,"#004cff"),Z.addColorStop(1,"#760188"),s.fillStyle=Q,svg.fillStyle=Z}roundRect(s,0,0,C,I,parseInt(R),!0,!1),drawOver(s,l,n,i,c,g,m,d,h,v,u,f,p,w,k,b,P,y,x,S,C,I,F,E,M,W,J,j,q,V,X,H,Y,_)}function drawOver(r,e,a,t,o,s,l,n,i,c,g,m,d,h,v,u,f,p,w,k,b,P,y,x,S,C,I,F,T,z,R,L,O,U){0<y&&(r.lineWidth=y,r.strokeStyle=colorToRGBA(e,a),roundRect(r,+b/32,+P/16,15*b/16,7*P/8,20,!1)),r.textAlign="center";var D,A,n="regular"===n?"":n+" ";r.font=n+parseInt(t)+"px '"+l+"'",r.fillStyle=colorToRGBA(o,s),0<L&&(r.strokeStyle=R,r.lineWidth=L,r.strokeText(i,parseInt(c),parseInt(g),T)),r.fillText(i,parseInt(c),parseInt(g),T),r.font=(n="regular"===u?"":u+" ")+parseInt(m)+"px '"+v,r.fillStyle=colorToRGBA(d,h),0<U&&(r.strokeStyle=O,r.lineWidth=U,r.strokeText(f,parseInt(p),parseInt(w),z)),r.fillText(f,parseInt(p),parseInt(w),z),x?((D=new Image).src="img/Rick.png",D.onload=function(){S=parseInt(S),C=parseInt(C);var e,a=D.width*I/100,t=D.height*I/100;console.log(a),console.log(t),r.translate(S+a/2,C+t/2),r.rotate(F*Math.PI/180),r.drawImage(D,-a/2,-t/2,a,t),r.rotate(-F*Math.PI/180),r.translate(-(S+a/2),-(C+t/2)),k?((e=new Image).src="img/glitter-calc.png",e.onload=function(){r.drawImage(e,0,0),$("#svg").html(svg.getSerializedSvg())}):$("#svg").html(svg.getSerializedSvg())}):k?((A=new Image).src="img/glitter-calc.png",A.onload=function(){r.drawImage(A,0,0),$("#svg").html(svg.getSerializedSvg())}):$("#svg").html(svg.getSerializedSvg())}function roundRect(e,a,t,r,o,s,l,n){if(void 0===n&&(n=!0),"number"==typeof(s=void 0===s?5:s))s={tl:s,tr:s,br:s,bl:s};else{var i,c={tl:0,tr:0,br:0,bl:0};for(i in c)s[i]=s[i]||c[i]}e.beginPath(),e.moveTo(a+s.tl,t),e.lineTo(a+r-s.tr,t),e.quadraticCurveTo(a+r,t,a+r,t+s.tr),e.lineTo(a+r,t+o-s.br),e.quadraticCurveTo(a+r,t+o,a+r-s.br,t+o),e.lineTo(a+s.bl,t+o),e.quadraticCurveTo(a,t+o,a,t+o-s.bl),e.lineTo(a,t+s.tl),e.quadraticCurveTo(a,t,a+s.tl,t),e.closePath(),l&&e.fill(),n&&e.stroke()}function addItem(){for(var e=null===(e=localStorage.getItem("wemas"))?{}:JSON.parse(e),a=$("#filename").val().replace(/\.(png|svg)$/,""),t=1,r=a;void 0!==e[r]&&null!==e[r];)r=a+"-"+t,t++;e[r]={w:$("#wemake").val(),wx:$("#wemake-x").val(),wy:$("#wemake-y").val(),ws:$("#wemake-size").val(),wc:$("#wemake-color").val(),wa:$("#wemake-alpha").val(),wf:$("#wemake-font").val(),wfs:$("#wemake-font-style").val(),ww:$("#wemake-width").val(),p:$("#porn").val(),px:$("#porn-x").val(),py:$("#porn-y").val(),ps:$("#porn-size").val(),pc:$("#porn-color").val(),pa:$("#porn-alpha").val(),pf:$("#porn-font").val(),pfs:$("#porn-font-style").val(),pw:$("#porn-width").val(),co:$("#bgu-color").val(),gli:$("#add-glitter").prop("checked"),bgt:$("#bg-type").val(),rc:$("#rect-color").val(),ra:$("#rect-alpha").val(),bgr:$("#bgr-color").val(),egr:$("#egr-color").val(),or:$("#gr-orientation").val(),bgi:$("#bg-img").val(),cor:$("#corners").val(),bth:$("#border-thickness").val(),width:$("#img-width").val(),height:$("#img-height").val(),x:$("#custom-x").val(),y:$("#custom-y").val(),s:$("#custom-size").val(),bgu:$("#custom-img-url").val(),r:$("#add-rick").prop("checked"),rx:$("#rick-x").val(),ry:$("#rick-y").val(),rs:$("#rick-size").val(),rr:$("#rick-rad").val(),woc:$("#wemake-outline-color").val(),wos:$("#wemake-outline-size").val(),poc:$("#porn-outline-color").val(),pos:$("#porn-outline-size").val()},localStorage.setItem("wemas",JSON.stringify(e))}function deleteItem(e){var a=localStorage.getItem("wemas");null===a?a={}:void 0!==(a=JSON.parse(a))[e]&&null!==a[e]&&delete a[e],localStorage.setItem("wemas",JSON.stringify(a))}function fillGallery(){var i=$("#gallery"),c=localStorage.getItem("wemas");null===c?(c={},localStorage.setItem("wemas",JSON.stringify(c))):c=JSON.parse(c),i.empty();var e=Object.keys(c).sort();0===e.length?i.html("<h1>"+sorryNoGallery+"</h1>"):e.forEach(function(a){var t=c[a],e=$("<div>");e.addClass("card"),e.attr("data-item",a);var r=document.createElement("canvas");r.classList.add("img-fluid"),r.setAttribute("width",t.width),r.setAttribute("height",t.height),drawCtx(!0,r.getContext("2d"),t.rc,t.ra,t.ws,t.wc,t.wa,t.wf,t.wfs,t.w,t.wx,t.wy,t.ps,t.pc,t.pa,t.pf,t.pfs,t.p,t.px,t.py,t.gli,t.width,t.height,t.bth,t.bgt,t.co,t.cor,t.bgi,t.s,t.bgr,t.egr,t.org,t.x,t.y,t.bgu,t.r,t.rx,t.ry,t.rs,t.rr,t.ww,t.pw,t.woc,t.wos,t.poc,t.pos),e.html(r);var o=$("<div>");o.addClass("row text-center");var s=$("<div>");s.addClass("col-sm-12 col-md-4");var l=$("<a>");l.addClass("btn btn-info btn-block");var n=createUrl(new URL(window.location),t.w,t.wx,t.wy,t.ws,t.wc,t.wa,t.wf,t.wfs,t.ww,t.p,t.px,t.py,t.ps,t.pc,t.pa,t.pf,t.pfs,t.pw,t.co,t.ra,t.gli,t.bgt,t.rc,t.bgr,t.egr,t.or,t.bgi,t.cor,t.bth,t.width,t.height,t.x,t.y,t.s,t.bgu,t.r,t.rx,t.ry,t.rs,t.rr,t.woc,t.wos,t.poc,t.pos);l.attr("href",n),l.text(load),s.append(l);r=$("<div>");r.addClass("col-sm-12 col-md-4");n=$("<a>");n.addClass("btn btn-info btn-block"),n.attr("href","#"),n.click(function(e){this.download=$("#filename").val(),void 0===t.bgu||null===t.bgu||t.bgu.match(/^ *$/)?this.href=$('[data-item="'+a+'"] canvas')[0].toDataURL("image/octet-stream"):(e.preventDefault(),alert(downloadClic))}),n.text(download),r.append(n);l=$("<div>");l.addClass("col-sm-12 col-md-4");n=$("<a>");n.addClass("btn btn-info btn-block"),n.attr("href","#"),n.click(function(e){e.preventDefault(),deleteItem(a),$('[data-item="'+a+'"]').remove()}),n.text(deleteText),l.append(n),o.append(s,r,l),e.append(o),i.append(e)})}function show(e){e=$("#"+e);e.hasClass("d-none")&&e.removeClass("d-none")}function hide(e){e=$("#"+e);e.hasClass("d-none")||e.addClass("d-none")}function scalePreserveAspectRatio(e,a,t,r){return Math.min(t/e,r/a)}function colorToRGBA(e,a){e=e.split("");return r=parseInt(""+e[1]+e[2],16),g=parseInt(""+e[3]+e[4],16),b=parseInt(""+e[5]+e[6],16),"rgba("+r+","+g+","+b+","+(1-a/100)+")"}function createCookie(e,a,t){var r;r=t?((r=new Date).setTime(r.getTime()+24*t*60*60*1e3),"; expires="+r.toGMTString()):"",document.cookie=e+"="+a+r+"; path=/"}function readCookie(e){for(var a=e+"=",t=document.cookie.split(";"),r=0;r<t.length;r++){for(var o=t[r];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(a))return o.substring(a.length,o.length)}return null}function centerText(e){e.preventDefault();var a=$("#wemake-x"),t=$("#wemake-y"),r=$("#porn-x"),o=$("#porn-y"),s=$("#img-width").val(),e=$("#img-height").val();a.val(s/2),t.val(e/4+3*e/20),r.val(s/2),o.val(3*e/4+e/8),refreshText()}function createUrl(e,a,t,r,o,s,l,n,i,c,g,m,d,h,v,u,f,p,$,w,k,b,P,y,x,S,C,I,F,T,z,R,L,O,U,D,A,G,B,N,E,M,W,J,j){return e.searchParams.set("w",a),e.searchParams.set("wx",t),e.searchParams.set("wy",r),e.searchParams.set("ws",o),e.searchParams.set("wc",s),e.searchParams.set("wa",l),e.searchParams.set("wf",n),e.searchParams.set("wfs",i),e.searchParams.set("ww",c),e.searchParams.set("p",g),e.searchParams.set("px",m),e.searchParams.set("py",d),e.searchParams.set("ps",h),e.searchParams.set("pc",v),e.searchParams.set("pa",u),e.searchParams.set("pf",f),e.searchParams.set("pfs",p),e.searchParams.set("pw",$),e.searchParams.set("co",w),e.searchParams.set("ra",k),e.searchParams.set("gli",b),e.searchParams.set("bgt",P),e.searchParams.set("rc",y),e.searchParams.set("bgr",x),e.searchParams.set("egr",S),e.searchParams.set("or",C),e.searchParams.set("bgi",I),e.searchParams.set("cor",F),e.searchParams.set("bth",T),e.searchParams.set("width",z),e.searchParams.set("height",R),e.searchParams.set("x",L),e.searchParams.set("y",O),e.searchParams.set("s",U),e.searchParams.set("bgu",D),e.searchParams.set("r",A),e.searchParams.set("rx",G),e.searchParams.set("ry",B),e.searchParams.set("rs",N),e.searchParams.set("rr",E),e.searchParams.set("woc",M),e.searchParams.set("wos",W),e.searchParams.set("poc",J),e.searchParams.set("pos",j),e}function importData(e){var t=new FileReader;t.addEventListener("loadend",function(){try{var e=JSON.parse(String.fromCharCode.apply(null,new Uint8Array(t.result))),a=localStorage.getItem("wemas");null===a?localStorage.setItem("wemas",JSON.stringify(e)):(a=JSON.parse(a),$.extend(a,e),localStorage.setItem("wemas",JSON.stringify(a))),fillGallery(),alert(importOk)}catch(e){alert(e)}}),t.readAsArrayBuffer(e[0])}function exportData(e){e.preventDefault();var a=$('<a id="export-data-json">');a.hide(),$("body").append(a);e=[localStorage.getItem("wemas")],e=new Blob(e,{type:"application/json"}),e=window.URL.createObjectURL(e);a.attr("href",e),a.attr("download","export-data.json"),$("#export-data-json")[0].click(),$("#export-data-json").remove()}$(document).ready(function(){detectLang(),getParameters(),bindEvents(),toggleBgSettings(),refreshFilename(),waitForfont("wemake-font",function(){waitForfont("porn-font")})});
\ No newline at end of file
{
"get-source": "Hol dir die Sourcen",
"donate-dpdn": "Spende",
"license": "Lizenz",
"author": "Author",
"hide-settings": "Home",
......
{
"get-source": "Get the sources",
"donate-dpdn": "Donate",
"license": "License",
"author": "Author",
"hide-settings": "Home",
......
{
"get-source": "Obtenir le code",
"donate-dpdn": "Faire un don",
"license": "Licence",
"author": "L’auteur",
"hide-settings": "Accueil",
......
{
"get-source": "I am Groot",
"donate-dpdn": "I am Groot",
"license": "I am Groot",
"author": "I am Groot",
"hide-settings": "I am Groot",
......
{
"get-source": "Obténer lo còdi",
"donate-dpdn": "Donar",
"license": "Licéncia",
"author": "L’autor",
"hide-settings": "Acuèlh",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment