Verified Commit 92c7965f authored by Thibaut Broggi's avatar Thibaut Broggi
Browse files

Add "save" button

parent 03b21c2a
......@@ -40,16 +40,6 @@ let draw = function() {
ctx.fillStyle = fgColor;
ctx.fillText(fillText, width * 0.08, height * 0.2 + fontSize);
//Draw picto
get('/imgs/1.svg', function(res) {
let img = new Image;
let imgXml = res.replace(/#FFD201/g, fgColor);
img.src = 'data:image/svg+xml;base64,' + btoa(imgXml);
img.addEventListener('load', function() {
ctx.drawImage(img, 0, 0);
}, false);
});
// Add footer
ctx.fillStyle = 'white';
ctx.fillRect(0, height * 0.85, width, height * 0.15);
......@@ -74,6 +64,17 @@ let draw = function() {
offset += ctx.measureText('outenez ').width;
ctx.font = 'bold 16px FiraSans';
ctx.fillText('La Quadrature du Net !', offset, height * 0.9);
//Draw picto
get('/imgs/1.svg', function(res) {
let img = new Image;
let imgXml = res.replace(/#FFD201/g, fgColor);
img.src = 'data:image/svg+xml;base64,' + btoa(imgXml);
img.addEventListener('load', function() {
ctx.drawImage(img, 0, 0);
document.querySelector('#save-image').href = canvas.toDataURL();
}, false);
});
}
let bgColorElems = document.querySelectorAll('.colorpicker input[type="radio"], #step3 input[type="radio"]');
......
......@@ -177,7 +177,10 @@
</div>
</div>
<main>
<canvas id="output" width="600" height="413"></canvas>
<div>
<canvas id="output" width="600" height="413"></canvas>
<a id="save-image" download="lqdn-slogan.png">Enregistrer <span class="fa fa-save"></span></a>
</div>
<div id="credits">
<p><strong>Site hébergé par La Quadrature du Net</strong></p>
<p><strong>Crédits :</strong> Les policies utilisées viennnent de <strong>Velvetyne Type Foundry</strong>. Bluu par Jean Baptiste Morizot, Bilbo Inc par Hélène Marian Srodogora, Boeticher par Charles Paille, Combat par Martin Desinde, Gulax par Morgan Gilbert, Lineal par Frank Adebiaye, Resistance par Collective, Savate par Wech, Solide Mirage par Jérémy Landes-Nones, Steps mono par Jean Baptiste Morizot, Terminal par Rapaël Bastide et Jérémy Landes-Nones.</p>
......
......@@ -112,7 +112,7 @@ div.navButtons {
margin-top: 2em;
}
div.navButtons > a, button {
div.navButtons > a, a#save-image, button {
display: inline-block;
cursor: pointer;
height: 50px;
......@@ -144,12 +144,24 @@ main {
padding-left: 40px;
}
main > #output {
main > div:nth-child(1) {
text-align: right;
width: 600px;
}
main > div > #output {
margin-top: 7vw;
display: block;
}
a#save-image {
padding-left: 2em;
padding-right: 2em;
margin-top: 2em;
}
main > #credits {
margin-top: 100px;
margin-top: 50px;
}
div#step2 > textarea {
......
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