--- /dev/null
+@import url(https://fonts.googleapis.com/css?family=Roboto);
+body,
+input,
+select,
+textarea,
+body * {
+ font-family: 'Roboto', sans-serif;
+ box-sizing: border-box;
+}
+body::after,
+body::before,
+input::after,
+input::before,
+select::after,
+select::before,
+textarea::after,
+textarea::before,
+body *::after,
+body *::before {
+ box-sizing: border-box;
+}
+
+body {
+ background-image: #e6e6e6;
+}
+
+h1 {
+ font-size: 2rem;
+ text-align: center;
+ margin: 0 0 2em;
+}
+
+.container {
+ position: relative;
+ max-width: 40rem;
+ margin: 5rem auto;
+ background: #fff;
+ width: 100%;
+ padding: 3rem 5rem 0;
+ border-radius: 1px;
+}
+.container::before {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14),
+ 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);
+ -webkit-transform: scale(0.98);
+ transform: scale(0.98);
+ -webkit-transition: -webkit-transform 0.28s ease-in-out;
+ transition: -webkit-transform 0.28s ease-in-out;
+ transition: transform 0.28s ease-in-out;
+ transition: transform 0.28s ease-in-out, -webkit-transform 0.28s ease-in-out;
+ z-index: -1;
+}
+.container:hover::before {
+ -webkit-transform: scale(1);
+ transform: scale(1);
+}
+
+.button-container {
+ text-align: center;
+}
+
+fieldset {
+ margin: 0 0 3rem;
+ padding: 0;
+ border: none;
+}
+
+.form-group {
+ position: relative;
+ margin-top: 2.25rem;
+ margin-bottom: 2.25rem;
+}
+
+.form-inline > .form-group,
+.form-inline > .btn {
+ display: inline-block;
+ margin-bottom: 0;
+}
+
+.form-help {
+ margin-top: 0.125rem;
+ margin-left: 0.125rem;
+ color: #b3b3b3;
+ font-size: 0.8rem;
+}
+
+.form-group .form-help {
+ position: absolute;
+ width: 100%;
+}
+
+.form-group input {
+ height: 1.9rem;
+}
+
+.form-group textarea {
+ resize: none;
+}
+.form-group select {
+ width: 100%;
+ font-size: 1rem;
+ height: 1.6rem;
+ padding: 0.125rem 0.125rem 0.0625rem;
+ background: none;
+ border: none;
+ line-height: 1.6;
+ box-shadow: none;
+}
+.form-group .control-label {
+ position: absolute;
+ top: 0.25rem;
+ pointer-events: none;
+ padding-left: 0.125rem;
+ z-index: 1;
+ color: #b3b3b3;
+ font-size: 1rem;
+ font-weight: normal;
+ -webkit-transition: all 0.28s ease;
+ transition: all 0.28s ease;
+}
+.form-group .bar {
+ position: relative;
+ border-bottom: 0.0625rem solid #999;
+ display: block;
+}
+.form-group .bar::before {
+ content: '';
+ height: 0.125rem;
+ width: 0;
+ left: 50%;
+ bottom: -0.0625rem;
+ position: absolute;
+ background: #337ab7;
+ -webkit-transition: left 0.28s ease, width 0.28s ease;
+ transition: left 0.28s ease, width 0.28s ease;
+ z-index: 2;
+}
+.form-group input,
+.form-group textarea {
+ display: block;
+ background: none;
+ padding: 0.125rem 0.125rem 0.0625rem;
+ font-size: 1rem;
+ border-width: 0;
+ border-color: transparent;
+ line-height: 1.9;
+ width: 100%;
+ color: transparent;
+ -webkit-transition: all 0.28s ease;
+ transition: all 0.28s ease;
+ box-shadow: none;
+}
+.form-group input[type='file'] {
+ line-height: 1;
+}
+.form-group input[type='file'] ~ .bar {
+ display: none;
+}
+.form-group select,
+.form-group input:focus,
+.form-group input:valid,
+.form-group input.form-file,
+.form-group input.has-value,
+.form-group textarea:focus,
+.form-group textarea:valid,
+.form-group textarea.form-file,
+.form-group textarea.has-value {
+ color: #333;
+}
+.form-group select ~ .control-label,
+.form-group input:focus ~ .control-label,
+.form-group input:valid ~ .control-label,
+.form-group input.form-file ~ .control-label,
+.form-group input.has-value ~ .control-label,
+.form-group textarea:focus ~ .control-label,
+.form-group textarea:valid ~ .control-label,
+.form-group textarea.form-file ~ .control-label,
+.form-group textarea.has-value ~ .control-label {
+ font-size: 0.8rem;
+ color: gray;
+ top: -1rem;
+ left: 0;
+}
+.form-group select:focus,
+.form-group input:focus,
+.form-group textarea:focus {
+ outline: none;
+}
+.form-group select:focus ~ .control-label,
+.form-group input:focus ~ .control-label,
+.form-group textarea:focus ~ .control-label {
+ color: #337ab7;
+}
+.form-group select:focus ~ .bar::before,
+.form-group input:focus ~ .bar::before,
+.form-group textarea:focus ~ .bar::before {
+ width: 100%;
+ left: 0;
+}
+
+.checkbox label,
+.form-radio label {
+ position: relative;
+ cursor: pointer;
+ padding-left: 2rem;
+ text-align: left;
+ color: #333;
+ display: block;
+}
+.checkbox input,
+.form-radio input {
+ width: auto;
+ opacity: 0.00000001;
+ position: absolute;
+ left: 0;
+}
+
+.has-error .legend.legend,
+.has-error.form-group .control-label.control-label {
+ color: #d9534f;
+}
+.has-error.form-group .form-help,
+.has-error.form-group .helper,
+.has-error.checkbox .form-help,
+.has-error.checkbox .helper,
+.has-error.radio .form-help,
+.has-error.radio .helper,
+.has-error.form-radio .form-help,
+.has-error.form-radio .helper {
+ color: #d9534f;
+}
+.has-error .bar::before {
+ background: #d9534f;
+ left: 0;
+ width: 100%;
+}
+
+.button {
+ position: relative;
+ background: currentColor;
+ border: 1px solid currentColor;
+ font-size: 1.1rem;
+ color: #4f93ce;
+ margin: 3rem 0;
+ padding: 0.75rem 3rem;
+ cursor: pointer;
+ -webkit-transition: background-color 0.28s ease, color 0.28s ease,
+ box-shadow 0.28s ease;
+ transition: background-color 0.28s ease, color 0.28s ease,
+ box-shadow 0.28s ease;
+ overflow: hidden;
+ box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 3px 1px -2px rgba(0, 0, 0, 0.2),
+ 0 1px 5px 0 rgba(0, 0, 0, 0.12);
+}
+.button span {
+ color: #fff;
+ position: relative;
+ z-index: 1;
+}
+.button::before {
+ content: '';
+ position: absolute;
+ background: #071017;
+ border: 50vh solid #1d4567;
+ width: 30vh;
+ height: 30vh;
+ border-radius: 50%;
+ display: block;
+ top: 50%;
+ left: 50%;
+ z-index: 0;
+ opacity: 1;
+ -webkit-transform: translate(-50%, -50%) scale(0);
+ transform: translate(-50%, -50%) scale(0);
+}
+.button:hover {
+ color: #337ab7;
+ box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12),
+ 0 3px 5px -1px rgba(0, 0, 0, 0.2);
+}
+.button:active::before,
+.button:focus::before {
+ -webkit-transition: opacity 0.28s ease 0.364s, -webkit-transform 1.12s ease;
+ transition: opacity 0.28s ease 0.364s, -webkit-transform 1.12s ease;
+ transition: transform 1.12s ease, opacity 0.28s ease 0.364s;
+ transition: transform 1.12s ease, opacity 0.28s ease 0.364s,
+ -webkit-transform 1.12s ease;
+ -webkit-transform: translate(-50%, -50%) scale(1);
+ transform: translate(-50%, -50%) scale(1);
+ opacity: 0;
+}
+.button:focus {
+ outline: none;
+}
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="dist/circletext.js"></script>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@500&display=swap" rel="stylesheet">
- <link rel="stylesheet" href="styles.css">
+ <link rel="stylesheet" href="css/styles.css">
+ <link rel="stylesheet" href="css/forms.css">
<title>Antifa Generator</title>
</head>
<body>
- <canvas id="logo" width="500" height="500">
- Your browser does not support the canvas element.
+ <div class="container">
+ <form>
+ <h1>Antifa Generator</h1>
+ <div class="form-group">
+ <input id="antifa-group" type="text" required="required" />
+ <label for="input" class="control-label">Digite o grupo a qual você pertence</label><i class="bar"></i>
+ </div>
+ <div class="form-group">
+ <select id='antifa-label'>
+ <option>Antifacista</option>
+ <option>Antifacistas</option>
+ </select>
+ <label for="select" class="control-label"></label><i class="bar"></i>
+ </div>
+ </form>
+ <div class="button-container">
+ <button type="button" class="button" onClick="generateImage()"><span>Gerar imagem</span></button>
+ </div>
+ </div>
+
+ <canvas id="logo" height="500" width="500">
+ Seu navegador não suporta canvas
</canvas>
+
+ <script>
+
+ </script>
<script>
+ const button = document.querySelector('.button');
+ button.onclick = function generateImage() {
+ antifaGroup = document.getElementById('antifa-group')
+ antifaLabel = document.getElementById('antifa-label')
+ console.log('antifaGropup.value :>> ', antifaGroup.value);
+ console.log('antifaLabel.value :>> ', antifaLabel.value);
+
+ const logoCanvas = document.getElementById('logo')
+ ctx = logoCanvas.getContext("2d");
+ const background = new Image();
+ background.src = 'https://raw.githubusercontent.com/BambataTech/antifa-generator/master/img/antifascist-action.png';
+ background.onload = function () {
+ ctx.drawImage(background, 0, 0, 500, 500);
+ writeTopCircle(antifaGroup.value, "logo", 510, "white")
+ writeBottomCircle(antifaLabel.value, "logo", 510, "white")
+ }
+ document.querySelector('.container').remove()
+ };
+
- const canvas = document.getElementById("logo");
- ctx = canvas.getContext("2d");
- const background = new Image();
- background.src = 'https://raw.githubusercontent.com/BambataTech/antifa-generator/master/img/antifascist-action.png';
- background.onload = function () {
- ctx.drawImage(background, 0, 0, 500, 500);
- writeTopCircle("Programadores", "logo", 510, "white")
- writeBottomCircle("Antifacistas", "logo", 510, "white")
- }
</script>
+
</body>
</html>