]> git.lizzy.rs Git - antifa-generator.git/blob - index.html
Adiciona formulario
[antifa-generator.git] / index.html
1 <!DOCTYPE html>
2 <html lang="en">
3
4 <head>
5     <meta charset="UTF-8">
6     <meta name="viewport" content="width=device-width, initial-scale=1.0">
7     <script src="dist/circletext.js"></script>
8     <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
9     <link rel="stylesheet" href="css/styles.css">
10     <link rel="stylesheet" href="css/forms.css">
11     <title>Antifa Generator</title>
12 </head>
13
14 <body>
15     <div class="container">
16         <form>
17             <h1>Antifa Generator</h1>
18             <div class="form-group">
19                 <input id="antifa-group" type="text" required="required" />
20                 <label for="input" class="control-label">Digite o grupo a qual você pertence</label><i class="bar"></i>
21             </div>
22             <div class="form-group">
23                 <select id='antifa-label'>
24                     <option>Antifacista</option>
25                     <option>Antifacistas</option>
26                 </select>
27                 <label for="select" class="control-label"></label><i class="bar"></i>
28             </div>
29         </form>
30         <div class="button-container">
31             <button type="button" class="button" onClick="generateImage()"><span>Gerar imagem</span></button>
32         </div>
33     </div>
34
35     <canvas id="logo" height="500" width="500">
36         Seu navegador não suporta canvas
37     </canvas>
38
39     <script>
40
41     </script>
42     <script>
43         const button = document.querySelector('.button');
44         button.onclick = function generateImage() {
45             antifaGroup = document.getElementById('antifa-group')
46             antifaLabel = document.getElementById('antifa-label')
47             console.log('antifaGropup.value :>> ', antifaGroup.value);
48             console.log('antifaLabel.value :>> ', antifaLabel.value);
49
50             const logoCanvas = document.getElementById('logo')
51             ctx = logoCanvas.getContext("2d");
52             const background = new Image();
53             background.src = 'https://raw.githubusercontent.com/BambataTech/antifa-generator/master/img/antifascist-action.png';
54             background.onload = function () {
55                 ctx.drawImage(background, 0, 0, 500, 500);
56                 writeTopCircle(antifaGroup.value, "logo", 510, "white")
57                 writeBottomCircle(antifaLabel.value, "logo", 510, "white")
58             }
59             document.querySelector('.container').remove()
60         };
61
62
63     </script>
64
65 </body>
66
67 </html>