Skip to content

Commit

Permalink
kirillive
Browse files Browse the repository at this point in the history
  • Loading branch information
Kirilllive committed Apr 23, 2022
1 parent a717117 commit efb7428
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
Binary file modified .DS_Store
Binary file not shown.
34 changes: 33 additions & 1 deletion ascii_paint.html
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,23 @@
</table>
<div class="button" style="margin:14px;width:calc(100% - 28px);" onclick="replaces(replaces_what.value,replaces_than.value)">Replace symbols</div>
</div>
<div style="width:100%;text-align:center;border-top:1px solid var(--cb);">

<table style="margin:14px;width:calc(100% - 28px);">
<tbody>
<tr>
<td style="padding-right:10px;width:33%;" align="right">Width</td>
<td style="" align="center"><input type="text" id="imgWidth" onchange="this.value=correct_value(this.value);" class="input_text palette_simbols"></td>
</tr>
<tr>
<td style="padding-right:10px;" align="right">Height</td>
<td style="" align="center"><input type="text" id="imgHeight" onchange="this.value=correct_value(this.value);" class="input_text palette_simbols"></td>
</tr>
</tbody>
</table>

<div class="button" style="margin:14px;width:calc(100% - 28px);" onclick="save_png()">Save image/png</div>
</div>
</div>
</td></tr><tr><td style="height:40px;border-top:1px solid var(--cb);background-color:var(--wn);" align="center">
<table style="width:256px;">
Expand Down Expand Up @@ -435,7 +452,6 @@
<td width='25%' align='center'>Arne Krause</td>
</tr></tbody></table><br><br>
<p><a href='https://www.patreon.com/tuesday_js' target='_blank'><svg height='40' width='198' viewBox='0 0 1000 200' xmlns='http://www.w3.org/2000/svg'><rect width='1000' height='200' fill='#FF424D'/><path d='M310 129V72h19c7 0 12 1 15 4 4 2 5 6 5 11 0 3 0 5-2 7-1 3-3 4-6 5a13 13 0 0110 13c0 6-2 10-6 13-3 2-8 4-14 4zm10-26v18h11l7-2c2-2 3-4 3-7 0-6-3-9-9-9zm0-7h10l7-2c2-2 2-4 2-6 0-3 0-5-2-6l-8-2h-9zm58 34c-6 0-11-2-14-6-4-4-6-9-6-15v-1l2-12c2-3 4-6 7-7 3-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m59-14v21h-10V72h22c7 0 12 2 15 5 4 3 6 8 6 13 0 6-2 10-6 13-3 3-8 5-15 5zm0-8h12c4 0 6-1 8-3 2-1 3-4 3-7s-1-5-3-7-4-3-7-3h-13zm66 29l-1-4c-3 3-7 5-11 5s-8-2-11-4c-2-2-4-5-4-9s2-8 5-10c4-3 9-4 15-4h6v-3l-2-5-6-2-5 2c-2 1-2 2-2 4h-10c0-3 1-5 3-7 1-2 3-3 6-4 2-2 5-2 9-2 5 0 9 1 12 4 2 2 4 6 4 10v19l2 9v1zm-10-7l5-1 4-4v-8h-6l-8 2-2 5c0 2 0 3 2 4 1 1 2 2 5 2zm40-46v11h7v7h-7v23l1 4 3 1 4-1v8l-7 1c-7 0-11-4-11-12V94h-7v-7h7V76zm37 19h-4c-5 0-7 2-9 5v29h-9V87h9v4c2-3 5-5 9-5h4zm4 12l2-11c2-3 4-6 7-7 3-2 7-3 11-3 5 0 10 2 13 5 4 4 6 9 6 15v2l-2 11c-2 4-4 6-7 8s-6 3-10 3c-6 0-11-2-15-6-3-4-5-10-5-16zm9 1c0 5 1 8 3 10 2 3 4 4 8 4 3 0 5-1 7-4 2-2 3-6 3-11 0-4-1-7-3-10-2-2-4-4-7-4-4 0-6 2-8 4-2 3-3 6-3 11zm47-21v4c3-3 8-5 13-5 8 0 13 5 13 15v28h-9v-28l-2-5c-1-2-3-2-6-2-4 0-7 1-8 5v30h-10V87z' fill='#fff'/><path d='M165 39c-25 0-45 21-45 46s20 46 45 46 45-21 45-46-20-46-45-46' fill='#fff'/><path d='M83 161V39h23v122z' fill='#fff'/></svg></a></p><br>
<p><a href='https://paypal.me/KiriIILive' target='_blank'><svg width='128' version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 124 33'><path fill='#3c66b5' d='M46.2,6.7h-6.8c-0.4,0-0.8,0.3-0.9,0.8l-2.7,17.5c-0.0,0.3,0.2,0.6,0.5,0.6 h3.2c0.4,0,0.8-0.3,0.9-0.8l0.7-4.7c0.0-0.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4-1.8,2c-0.6,0.4-1.5,0.8-2.4,1.1c-0.9,0.2-1.9,0.3-3.0,0.3h-0.7 c-0.5,0-1.0,0.1-1.4,0.5c-0.3,0.3-0.6,0.8-0.7,1.3l-0.0,0.2l-0.9,5.8l-0.0,0.2 c-0.0,0.0-0.0,0.1-0.0,0.1c-0.0,0.0-0.0,0.0-0.0,0.0H7.2z'/><path fill='#179BD7' d='M23.048,7.667L23.048,7.667L23.048,7.667c-0.028,0.179-0.06,0.362-0.096,0.55 c-1.237,6.351-5.469,8.545-10.874,8.545H9.326c-0.661,0-1.218,0.48-1.321,1.132l0,0l0,0L6.596,26.83l-0.399,2.533 c-0.067,0.428,0.263,0.814,0.695,0.814h4.881c0.578,0,1.069-0.42,1.16-0.99l0.048-0.248l0.919-5.832l0.059-0.32 c0.09-0.572,0.582-0.992,1.16-0.992h0.73c4.729,0,8.431-1.92,9.513-7.476c0.452-2.321,0.218-4.259-0.978-5.622 C24.022,8.286,23.573,7.945,23.048,7.667z'/><path fill='#334c7c' d='M21.754,7.151c-0.189-0.055-0.384-0.105-0.584-0.15c-0.201-0.044-0.407-0.083-0.619-0.117 c-0.742-0.12-1.555-0.177-2.426-0.177h-7.352c-0.181,0-0.353,0.041-0.507,0.115C9.927,6.985,9.675,7.306,9.614,7.699L8.05,17.605 l-0.045,0.289c0.103-0.652,0.66-1.132,1.321-1.132h2.752c5.405,0,9.637-2.195,10.874-8.545c0.037-0.188,0.068-0.371,0.096-0.55 c-0.313-0.166-0.652-0.308-1.017-0.429C21.941,7.208,21.848,7.179,21.754,7.151z'/><path fill='#3c66b5' d='M9.614,7.699c0.061-0.393,0.313-0.714,0.652-0.876c0.155-0.074,0.326-0.115,0.507-0.115h7.352 c0.871,0,1.684,0.057,2.426,0.177c0.212,0.034,0.418,0.073,0.619,0.117c0.2,0.045,0.395,0.095,0.584,0.15 c0.094,0.028,0.187,0.057,0.278,0.086c0.365,0.121,0.704,0.264,1.017,0.429c0.368-2.347-0.003-3.945-1.272-5.392 C20.378,0.682,17.853,0,14.622,0h-9.38c-0.66,0-1.223,0.48-1.325,1.133L0.01,25.898c-0.077,0.49,0.301,0.932,0.795,0.932h5.791 l1.454-9.225L9.614,7.699z'/></svg></a></p>
</div>
</div></div>
<div id='text_edit' style="display:none">
Expand Down Expand Up @@ -865,11 +881,27 @@
for(y=0;y<tr.length;y++){td=tr[y].getElementsByTagName('td');for(x=0;x<td.length;x++){text+=td[x].textContent};if(y<tr.length-1){text+="\n";};}
canvasWidth.value=td.length
canvasHeight.value=tr.length
imgWidth.value=td.length*8
imgHeight.value=tr.length*14
cells.innerHTML=td.length*tr.length
arr_size.innerHTML=td.length+" X "+tr.length
back_up.unshift(text);
if(back_up.length>100){back_up.pop();}
}
function save_png(){
tr=canvas.getElementsByTagName('tr');
td=tr[0].getElementsByTagName('td');
var iw=imgWidth.value,ih=imgHeight.value,cw=iw/td.length,ch=ih/tr.length;
const preview=document.getElementById("preview"),context=preview.getContext("2d");
preview.width=iw;preview.height=ih;
context.font=ch+'px var(--font),monospace';
if(!get_selected()){x1=0;x2=tr[0].getElementsByTagName('td').length-1;y1=0;y2=tr.length;}else{y2++;}
for(y=y1;y<y2;y++){td=tr[y].getElementsByTagName('td');for(x=x1;x<x2+1;x++){if(td[x]){context.fillText(td[x].textContent,cw*x,ch*(y+1));}};}
var a=document.getElementById("get_file");
a.setAttribute("href",preview.toDataURL("image/png"));
a.setAttribute("download","text_art.png");
a.click();
}
function correct_value(name){if(name.includes("+")||name.includes("-")||name.includes("*")||name.includes("/")){return parseInt(eval(name))}else{return parseInt(name)}}
function state_back(n){state_num+=n;if(state_num<0){state_num=0}else if(state_num>=back_up.length-1){state_num=back_up.length-1};db=back_up[state_num].split("\n");buildWorld();}
document.addEventListener('DOMContentLoaded',function(){createPalette();active_brush.innerHTML=brush;if(localStorage.getItem("range_font")){range_font=JSON.parse(localStorage.getItem("range_font"))};if(localStorage.getItem("palette")){palette=localStorage.getItem("palette");createPalette();}})
Expand Down

0 comments on commit efb7428

Please sign in to comment.