contact.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. <div class="no-js">
  2. <h2>JavaScript is off</h2>
  3. <p>Encryption requires that JavaScript be on. It’s <a href="https://notabug.org/apiote/website">Software Libre.</a></p>
  4. </div>
  5. <div class="contact-form">
  6. <span class="label">Reply-to email address</span>
  7. <input type="email" id="reply-to">
  8. <span class="label">Message</span>
  9. <textarea id="message" required rows="12"></textarea>
  10. <div class="validate validate-message">
  11. <p><span class="error">error:</span> Message cannot be empty</p>
  12. </div>
  13. <span class="label anti-bots">leave blank</span>
  14. <input type="text" id="hidden" class="anti-bots">
  15. <button><i class="material-icons">send</i></button>
  16. <div id="fail">
  17. <p><span class="error">error:</span> The message wasn’t sent</p>
  18. </div>
  19. <hr>
  20. <p class="note">While email address is not required, mind that I won’t be able to respond if You don’t provide it</p>
  21. <p class="note">All of the fields are encrypted locally with my public key so only whoever holds my private key (hopefully, that’s me) will be able to decrypt Your email address, and the message.</p>
  22. </div>
  23. <div class="sent">
  24. <h1>Thank You!</h1>
  25. <h2>Your message has been sent</h2>
  26. </div>
  27. <script>
  28. // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt GNU-AGPL-v3.0
  29. $(function() {
  30. $('#message').keypress(function() {
  31. $('.validate-message').css('display', 'none');
  32. });
  33. $('button').click(function() {
  34. let email = $('#reply-to').val();
  35. let message = $('#message').val();
  36. let botDetection = $('#hidden').val();
  37. if (botDetection != '') {
  38. return false;
  39. }
  40. if (message == '') {
  41. $('.validate-message').css('display', 'block');
  42. return false;
  43. }
  44. var msg = `email: ${email}\n\nmessage:\n${message})`;
  45. let publicKeyString = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +
  46. "\n" +
  47. "mQENBFambncBCAC6+jFaReHRLmMSVk5nKBDsAeJIxzbcQQRxTHHGLyxu0Wr17GEO\n" +
  48. "f9GI4nnN2qheMSaxswU9CtTCa0noKQU7mt6J+yUQFpzZteRbQ/7WWmtRSwDmr3kq\n" +
  49. "/7rMIwIe7aCWzNL6bZAsWfwOnAgx1mm5Ugwm3hBohDJZGnAulFINQMJoP/fH2Ym7\n" +
  50. "n2AFka+zTFE/NGnpJTgd6Hu3XS9lbeGBoY4/7K8cjIYrXuaIMeOk/hsIWGKtKqE1\n" +
  51. "uYrvoVEI731c/KI7sh3QZjxFVXgOdO6H+Sp+Y5KLkT5OgIrVgblrwkUqBhVhvWeq\n" +
  52. "N5jAQErPGcocKRALjBbSIPk6qh3O4k4+BSKDABEBAAG0O2FkYW0ucGlvdGVyZWtA\n" +
  53. "cHJvdG9ubWFpbC5jb20gPGFkYW0ucGlvdGVyZWtAcHJvdG9ubWFpbC5jb20+iQE1\n" +
  54. "BBABCAApBQJY3pUhBgsJBwgDAgkQJELid3bgpXgEFQgKAgMWAgECGQECGwMCHgEA\n" +
  55. "AMfFCACixW1beJdUcVOoUEZJ1xy3PN+LXU+l9nRw8lOfSs1zN7hocAPoW0LafMRQ\n" +
  56. "cO8M1d8MYgU/EuG2Z8c974GZwJYhUWWshvudPk64bot6Ts9+w42q/izvOthN4kay\n" +
  57. "MCCTo4SOD7dUESwupIxkWRjnbRg7OpHOy9xvuldMGsGRn1qgAL0rn72bdxKor0TY\n" +
  58. "XRNa48d8pO+TVKPV4tXnLB5VuU3zyHsIfNzoN7F5VdhTaNJU1Cc+Fs79PGDkpwTU\n" +
  59. "atwhIOijHeLxGR1Kye9xtJ576DfoVEwud35aAQecRslnhumdx1v9Fr0dwGGezoiS\n" +
  60. "r/xoq4NT0zDbGLZV0Wv86rGbxrrziQIzBBMBCAAdFiEEe/v5UGjIsgYWkz5dNL7a\n" +
  61. "odYiuJEFAlriXl8ACgkQNL7aodYiuJE2mQ//dtHZ6qEGaTDK89Qo+X0n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FqlrKL6UeU2K01qkNxIlhBJT8ba2poKicsgQw+CFrny9\n" +
  77. "+RgQZBc7jiqIEhJnbncKKXcRrXPJiZRmLnO+D19lWfztx0knf170t7qViLpQQKg9\n" +
  78. "H3jPvfn3bA55z6fNX/ye+HbVcVAvwUBv+XHMM34TKamQtm4n8QYXQHpNz8gpZj3F\n" +
  79. "60r5ZHbl9sbFVkshX06JAjMEEwEIAB0WIQR7+/lQaMiyBhaTPl00vtqh1iK4kQUC\n" +
  80. "WuJeXwAKCRA0vtqh1iK4kUOzEACF7ruZtvMzVCh77cqiyPf7QPJ03/tIEwuLj7I+\n" +
  81. "TgVTcvsllKfI1Rl8SlxPfvrs8yYzpy0M18fiMMepTv4TOXHZ4Q7QXf+lNzj4+LfY\n" +
  82. "4dQCkepdpUW3PjLuLzpbuLFKEketrXmeKpc4f9+WPsP8dh3e3BdfYmeFa0ZDP2bW\n" +
  83. "RfhxyB8gh5dptoJsClePBbe8c+Z5cmLRyQdAaKcMj7TymHO7Tdjix8M4yFOp6hyR\n" +
  84. "LuFDbcvciNIqsuePwT9U5y4hYbRzTrRMAEvKdX8UbDHY8SRI9G0L5mYYbKLb3IaC\n" +
  85. "2IMp23di8tmCxYts4Cjh40ItCFNdtDzgh3vuPpNni89Xp8OszTwUYZFvWIz1RWou\n" +
  86. "ZcehVPOugWtKyKn5RoN066OrJ4KBhjTMAir2+9GyBA/AN1GcfXMg30VfedZKS+Go\n" +
  87. "Cz74fQwH7VAJhYZxz42xdG+ilqB9b8qBY3uSoaoWwjZSuOisU4y4DVzuSjPNxDMB\n" +
  88. "HgSInb0JGeLvYKaD236nXYEDkptsqF+L4AT+szuDuMJeAWWyjfu8tz9TYcTu3rT+\n" +
  89. "QOfyc4iiz38t0MUUcJjWDlAfxt03+OHmSz1umXmEuaJbvGsfv6oylXC8vSGNpjdm\n" +
  90. "xgjg/+JYP8oDkx7h6t6ag4uEv7z/HFceMQ9YjDMTEd40lohcwRR6z9AHodrnlJsX\n" +
  91. "XaLEpLQrQWRhbSBQaW90ZXJlayA8YWRhbS5waW90ZXJla0Bwcm90b25tYWlsLmNo\n" +
  92. "PokBTgQTAQgAOBYhBJTz0F6hy365a6xPvyRC4nd24KV4BQJZZk/uAhsDBQsJCAcC\n" +
  93. "BhUICQoLAgQWAgMBAh4BAheAAAoJECRC4nd24KV4ANsH/jjwP1maFrFK/2LLDKO6\n" +
  94. "Gzp4Gn9fF0QhfQn6/4vv5packd5arLUyiCGrPVBlGGxEpkniv+lNf2ph3doSWGbg\n" +
  95. "3DiNVEpF05rMPBEOihlsE2AqgOsFJymVfYj/r3HibpkNyhKNSQ/WGHZZzMPdk/eA\n" +
  96. "aq0luvtHDzPMHStyQEZWmgChWFsjzY0XfZU3bok7bJrqOiNfDMAZsgsxSmn9zjPk\n" +
  97. "vihQvAywl7ilIunxmMy8T+b3By5MkHXKsQYdBLlB+jZPBebZHcSs6xJOlmM856Fs\n" +
  98. "etoP5XBz7+UuyPVqGp6a1O5Lg61DWnHwhSjlWVE4Fz2upzd2q70Ep1uFlhmsnIKm\n" +
  99. "0R+JAjMEEwEIAB0WIQR7+/lQaMiyBhaTPl00vtqh1iK4kQUCWuJeXwAKCRA0vtqh\n" +
  100. "1iK4kVxDD/9dFF9K4Lx8TRsZ7HpODaZskL2vGuJY9jhAWDlNIGTCddqGVDUXBEa6\n" +
  101. "pRG7OK0P+a2Ty/rH1pvKQWunWoiCOW2LTLT4y9eWwmKHj9f8Hak8V1sAuto7FWUB\n" +
  102. "btNr9+JYM6eyp7v/kyUreJ5DoSSLtgN1DSKtETi5oGhIxHmGPFlyhzv3XkkASAek\n" +
  103. "c53uk1H+KO464LtED4t1gb/o03G53V6A0wAte1BbopJsYgTXyKuMRmaFrE2Yxlb2\n" +
  104. "yC4rh8kUDJa0uIzmjD5qNgvcAFF1MIznOkeBsTmPUYBSypLvRRqq+38A+gYI7ZZt\n" +
  105. "N8GzTJAWNaia6BY3DW40mGxu7ziZsR3wyObdHquiOMonI9v1VDt+7OgrpBul/FGt\n" +
  106. "+HY9SDl4JeQeypQdWEbodQjfcIRPWezHOpxD1xsJP5xUTPPZaMiX4+gLY/CHliCq\n" +
  107. "7HzZ0OlRjvtRd493eibYfqQhsGwamZH00Qr8WujtyQyPg5M008RZingk8RMF7uWj\n" +
  108. "lKWe2Wf+CIYDCnWrK7wRWUI2GTu18Fv7UhN6AFtnqRU61rwjeWWmVWzcKq6zcUta\n" +
  109. "GllZLtVtfAFGAaNaiVPcQZ4eB9LWFe59gZm04tb6uevl5/V/Hz6mYJl06kq2pE7A\n" +
  110. "H2WrmEXPYGsC6IYaywfAq4smEdQPBJA82LuognpsiMnATaEWBgyhErkBDQRWpm53\n" +
  111. "AQgAs5ZKn4jgoZ45I9EGSaq1hIG7uF9gvGLi30o8oVMxY0pHAuSWrZEd/vStCl+1\n" +
  112. "/yM5Y9+pMxsuhFwE01BymaWGd2BGKg9zW1nFWxCfAck+f4Mh6tZblK1nJuNYOvcv\n" +
  113. "Ls7rY54jM/6ky/27GkQfS3zNDtJ+l9VByHj1qfbk3DDiJJhEjvacun701pW9eTK+\n" +
  114. "A1ZmPd8+3MiBUkdLu9mQcJzJt3RMnOjB+CYo22r3V5Xnq4Zs3na4uhSs95gkW8+G\n" +
  115. "fE4A8hn+TXFw+VxImyyHj1/fZDGD84Q5xarnEZbdoAy4/8gl5BO607/LAY3VycJL\n" +
  116. "+mRAjPzxJvBG+EoiVYY6dr5eUwARAQABiQEfBBgBCAATBQJY3pUiCRAkQuJ3duCl\n" +
  117. "eAIbDAAAJPcH/jpfkmzBg/MJKYKH02BhIm8ScEa5oB/8FjIbj5hg0stUFFA1TejW\n" +
  118. "noDNjnI4owcP3BMMLsC65c/94EZr040i3NCG9uyQfVtCO868RD8gP5Xk3xCCXm2o\n" +
  119. "ZbT8i7VFT3NYYvwMCrym9mNT9fgA/CU878Gr2sXFrwl6p5X+/xASV9mxrVeU+sL5\n" +
  120. "xFpuuFRIzKAjSNtGu4+0Li+Z8WNUkpXdH+HptJSQApuc//9MNgj1YnxydDb5esjA\n" +
  121. "apC5zPnTQ/xsJl1yjTEtzbZjymOFDRLc395wxx8u0YkA6BPYlimbvubUgpQ//3Fb\n" +
  122. "+xmIIwWFaLqxGfv00z/VKZIr+W3FmVX5IhI=\n" +
  123. "=LPxI\n" +
  124. "-----END PGP PUBLIC KEY BLOCK-----\n";
  125. $('#fail').css('display', 'none');
  126. var options = {
  127. data: msg,
  128. publicKeys: openpgp.key.readArmored(publicKeyString).keys
  129. };
  130. openpgp.encrypt(options).then(function(ciphertext) {
  131. $('#message').val(ciphertext.data);
  132. $('#reply-to').val('');
  133. $.ajax({
  134. data: JSON.stringify({ email: ciphertext.data }),
  135. contentType: "application/json; charset=utf-8",
  136. method: "POST",
  137. url: "/send.php",
  138. }).done(function(msg) {
  139. setTimeout(function() {
  140. $('#message').val('');
  141. $('.sent').css('display', 'block');
  142. $('.contact-form').css('display', 'none');
  143. }, 1000);
  144. }).fail(function(msg) {
  145. $('#fail').css('display', 'block');
  146. });
  147. });
  148. });
  149. });
  150. // @license-end
  151. </script>
  152. <script>
  153. // @license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt GNU-AGPL-v3.0
  154. $(function() {
  155. $('.no-js').css('display', 'none');
  156. $('.contact-form').css('display', 'block');
  157. $('textarea').val('');
  158. $('input').val('');
  159. });
  160. // @license-end
  161. </script>