Commit 0255cefb authored by Luc Didry's avatar Luc Didry
Browse files

Add snow background

parent cee4298a
Pipeline #26734 passed with stage
in 54 seconds
......@@ -385,6 +385,7 @@
<option value="telechat">Téléchat</option>
<option value="uyuni">Uyuni</option>
<option value="bark">Tree bark</option>
<option value="snow">Snow</option>
</select>
</div>
</div>
......
......@@ -132,7 +132,7 @@ function translate(userLang, languages) {
}
['plain', 'gradient', 'rainbow', 'img', 'lr', 'rl', 'tb', 'bt', 'r', 'beer', 'glitter',
'rainbow-flag', 'sky', 'field', 'bridge', 'regular', 'bold', 'italic', 'italic bold',
'bark'
'bark', 'snow'
].forEach(function(e) {
if (locale[e] !== undefined) {
$('option[value="'+e+'"]').text(locale[e]);
......
......@@ -7,7 +7,7 @@ void 0!==a&&null!==a&&e.push(a)
for(var t=navigator.languages,r=0;r<t.length;r++)e.push(t[r])
if(0!==e.length)translate(e.shift(),e)
else{console.log("Using old style language detection.")
translate(navigator.language||navigator.userLanguage)}}function translate(e,a){$.get({url:"locales/"+e+".json",dataType:"json",error:function(){void 0!==a&&null!==a&&0!==a.length&&translate(a.shift(),a)},success:function(a){toggleI18n(e),"groot"===e&&($("#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"].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"].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"]&&$(".form-check-label 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"].forEach(function(e){void 0!==a[e]&&$('option[value="'+e+'"]').text(a[e])}),["donate-dpdn","i18n-dpdn","settings-dpdn","toggle-svg","download","reset","switch-colors","make-text-center","print","save"].forEach(function(e){void 0!==a[e]&&("download"===e&&(download=a[e]),$("#"+e).text(a[e]))}),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)}})}function getParameters(){window.location.hash&&$("#porn").val(decodeURIComponent(window.location.hash.substr(1)))
translate(navigator.language||navigator.userLanguage)}}function translate(e,a){$.get({url:"locales/"+e+".json",dataType:"json",error:function(){void 0!==a&&null!==a&&0!==a.length&&translate(a.shift(),a)},success:function(a){toggleI18n(e),"groot"===e&&($("#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"].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"].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"]&&$(".form-check-label 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"].forEach(function(e){void 0!==a[e]&&$('option[value="'+e+'"]').text(a[e])}),["donate-dpdn","i18n-dpdn","settings-dpdn","toggle-svg","download","reset","switch-colors","make-text-center","print","save"].forEach(function(e){void 0!==a[e]&&("download"===e&&(download=a[e]),$("#"+e).text(a[e]))}),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)}})}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("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("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"))}function bindEvents(){$('input[type="text"]').each(function(e){"filename"!==this.id&&($(this).keyup(function(){refreshText(),refreshFilename()}),$(this).on("paste",function(){refreshText(),refreshFilename()}))}),$('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()&&$("#rect-alpha").val(100),refreshText()}):"bg-img"===this.id?$(this).change(function(){"telechat"===$(this).val()&&$("#rect-alpha").val(100),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()}),$("#download").click(function(e){this.download=$("#filename").val(),$("#svg").hasClass("d-none")?this.href=document.getElementById("canvas").toDataURL().replace("image/png","image/octet-stream"):this.href="data:image/octet-stream;base64,"+btoa(svg.getSerializedSvg(!0))}),$("[data-setting]").click(function(e){e.preventDefault()
var a=$(this)
......
......@@ -70,5 +70,6 @@
"gallery": "Gallery",
"sorry-no-gallery": "Sorry, but you haven't saved any image yet",
"load": "Load",
"delete": "Delete"
"delete": "Delete",
"snow": "Snow"
}
......@@ -70,5 +70,6 @@
"gallery": "Galerie",
"sorry-no-gallery": "Désolé, mais vous n’avez pas encore enregistré d’image",
"load": "Charger",
"delete": "Supprimer"
"delete": "Supprimer",
"snow": "Neige"
}
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