-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
169 lines (161 loc) · 11.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<div class="row">
<!-- CONTEÚDO LATERAL ESQUERDO -->
<div class="col-md-12 col-sm-12">
<h1 class="form-page-title">Criando sua Assinatura</h1>
<div class="row">
<div class="col-md-12">
<p>Para criar a sua assinatura institucional realize os seguintes passos:</p>
<ul>
<li>Preencha os campos abaixo corretamente, usando letra maiúscula apenas na primeira letra de cada termo do nome e função.</li>
<li>Copie o código gerado na última caixa.</li>
<li>Após copiar o código, siga as instruções <a href="https://support.google.com/mail/answer/8395" target="_blank" rel="noopener noreferrer" role="link">deste tutorial</a>.</li>
</ul>
</div>
</div>
<div class="row" style="margin-top: 25px; margin-bottom: 25px">
<div class="col-sm-12 col-md-6 content__text">
<form action="" method="post" enctype="multipart/form-data">
<div class="form-group">
<input class="form-control" name="nome" id="nome" type="text" placeholder="Nome" required="">
</div>
<div class="form-group">
<input class="form-control" name="cargo" id="cargo" type="text" placeholder="Função" required="">
</div>
<div class="form-group">
<input class="form-control" name="telefone" id="telefone" type="text" placeholder="Telefone (Se você preferir, pode deixar em branco)">
</div>
</form>
</div>
<div class="col-sm-12 col-md-6 content__text">
<div class="text-center">
<p>Pré visualização</p>
</div>
<div id="preview">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
<table border="0" cellpadding="0" cellspacing="0" style="min-width: 380px;">
<tbody><tr>
<td rowspan="2"><img src="https://www.escoteiros.org.br/wp-content/themes/escoteiros-theme/img/logoAssinatura.png" width="80" height="104" alt="Logo Escoteiros do Brasil"></td>
<td height="81" style="vertical-align:middle;">
<div>
<p class="nome" id="nomePreview" style="margin: 0px 0px 0px 15px; max-width: 240px; line-height: 5px; font-family: 'Montserrat', sans-serif; color: rgb(44, 70, 121); font-size: 12px; font-weight: bold;"></p>
<p class="funcao" id="cargoPreview" style="margin: 15px 0px 0px 15px; max-width: 240px; line-height: 10px; font-family: 'Montserrat', sans-serif; color: rgb(86,146,206); font-size: 9px; font-style: italic;"></p>
<p class="tel" id="telefonePreview" style="margin: 15px 0px 0px 15px; line-height: 0px; color: rgb(44, 70, 121); font-size: 11px; font-family: 'Montserrat', sans-serif; font-style: italic;"></p>
</div>
</td>
<td rowspan="2" style="padding-left: 20px;">
<img src="https://www.escoteiros.org.br/wp-content/themes/escoteiros-theme/img/selo2021.png" width="50" alt="Selo Melhores ONGS 2021">
<img src="https://www.escoteiros.org.br/wp-content/themes/escoteiros-theme/img/doar.png" width="50" alt="Instituo Doar">
</td>
</tr>
</tbody></table>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<button onclick="copiar()" class="btn btn-primary" style="margin-bottom: 10px">Copiar Para Outlook/Gmail</button>
<button onclick="copiarApp()" class="btn btn-primary" style="margin-bottom: 10px">Copiar Para Thunderbird</button>
<div id="code" style="border: 1px solid grey; padding: 10px; max-height: 100px; overflow: auto">
<div id="codecode">
<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">
<table border="0" cellpadding="0" cellspacing="0" style="min-width: 380px;">
<tr>
<td rowspan="2"><img src="https://www.escoteiros.org.br/wp-content/themes/escoteiros-theme/img/logoAssinatura.png" width="80" height="104" alt="Logo Escoteiros do Brasil"/></td>
<td height="81" style="vertical-align:middle;">
<div>
<p style="margin: 0px 0px 0px 15px; max-width: 240px; line-height: 5px; font-family: 'Montserrat', sans-serif; color: rgb(44, 70, 121); font-size: 12px; font-weight: bold;"></p>
<p style="margin: 15px 0px 0px 15px; max-width: 240px; line-height: 10px; font-family: 'Montserrat', sans-serif; color: rgb(86,146,206); font-size: 9px; font-style: italic;"></p>
<p style="margin: 15px 0px 0px 15px; line-height: 0px; color: rgb(44, 70, 121); font-size: 11px; font-family: 'Montserrat', sans-serif; font-style: italic;"></p>
</div>
</td>
<td style="padding-left: 20px" rowspan="2">
<img src="https://www.escoteiros.org.br/wp-content/themes/escoteiros-theme/img/selo2021.png" alt="Selo Melhores ONGS 2021" width="50" />
<img src="https://www.escoteiros.org.br/wp-content/themes/escoteiros-theme/img/doar.png" alt="Instituo Doar" width="50" />
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
const atualizaPreview = () => {
const nome = document.getElementById('nome').value;
const cargo = document.getElementById('cargo').value;
const telefone = document.getElementById('telefone').value;
if (!nome && !cargo && !telefone) {
return;
}
document.getElementById('nomePreview').innerText = nome;
document.getElementById('cargoPreview').innerText = cargo;
document.getElementById('telefonePreview').innerText = telefone;
const codigo = '<link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,700;1,400&display=swap" rel="stylesheet">' +
'<table border="0" cellpadding="0" cellspacing="0" style="min-width: 380px;">' +
'<tr>' +
'<td rowspan="2" style="width: 80px" ><img src="https://www.escoteiros.org.br/wp-content/themes/escoteiros-theme/img/logoAssinatura.png" width="80" height="104" alt="Logo Escoteiros do Brasil"/></td>' +
'<td height="81" style="vertical-align:middle;">' +
'<div>' +
`<p style="margin: 0px 0px 0px 15px; max-width: 240px; line-height: 5px; font-family: 'Montserrat', sans-serif; color: rgb(44, 70, 121); font-size: 12px; font-weight: bold;">${nome}</p>` +
`<p style="margin: 15px 0px 0px 15px; max-width: 240px; line-height: 10px; font-family: 'Montserrat', sans-serif; color: rgb(86,146,206); font-size: 9px; font-style: italic;">${cargo}</p>` +
`<p style="margin: 15px 0px 0px 15px; line-height: 0px; color: rgb(44, 70, 121); font-size: 11px; font-family: 'Montserrat', sans-serif; font-style: italic;">${telefone}</p>` +
'</div>' +
'</td>' +
'<td rowspan="2" style="padding-left: 20px" >' +
'<img src="https://www.escoteiros.org.br/wp-content/themes/escoteiros-theme/img/selo2021.png" alt="Selo Melhores ONGS 2021" width="50"/>' +
'<img src="https://www.escoteiros.org.br/wp-content/themes/escoteiros-theme/img/doar.png" alt="Instituo Doar" width="50" />' +
'</td>' +
'</tr>' +
'</table>';
document.getElementById('codecode').innerHTML = codigo;
if (nome) {
document.getElementById('nomePreview').style.display = 'block';
} else {
document.getElementById('nomePreview').style.display = 'none';
}
if (cargo) {
document.getElementById('cargoPreview').style.display = 'block';
} else {
document.getElementById('cargoPreview').style.display = 'none';
}
if (telefone) {
document.getElementById('telefonePreview').style.display = 'block';
} else {
document.getElementById('telefonePreview').style.display = 'none';
}
};
window.onload = () => {
document.getElementById('nome').addEventListener('change', atualizaPreview);
document.getElementById('cargo').addEventListener('change', atualizaPreview);
document.getElementById('telefone').addEventListener('change', atualizaPreview);
}
function copiar() {
if (document.selection) {
const range = document.body.createTextRange();
range.moveToElementText(document.getElementById('preview'));
range.select().createTextRange();
console.log(document.execCommand("copy"));
} else if (window.getSelection) {
const range = document.createRange();
range.selectNode(document.getElementById('preview'));
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand("copy");
}
}
function copiarApp() {
if (document.selection) {
const range = document.body.createTextRange();
range.moveToElementText(document.getElementById('codecode'));
range.select().createTextRange();
document.execCommand("copy");
} else if (window.getSelection) {
const range = document.createRange();
range.selectNode(document.getElementById('codecode'));
window.getSelection().removeAllRanges();
window.getSelection().addRange(range);
document.execCommand("copy");
}
}
</script>