Skip to content

michsch/antispammail

Repository files navigation

antiSpamMail

Release Issues


Build Status Code Climate devDependency Status Built with Grunt

How to use

Just include the antispammail.js file in your documents header or just before the closing body tag. If you use the span Tags with classname crypt than you should load the CSS file too or copy the styles inside your stylesheet.

If you only want to use the script for decrypting you don't have to load the complete version. Just use antispammail-decrypt.js instead.

Encrypt your email here!

Examples

HTML with normal mailto link

<a href="mailto:my@email.com">
  my@email.com
</a>

HTML with easy encryption (no CSS needed)

<a href="javascript:antiSpamMail.linkDecrypt('nbjmup;nzAfnbjm/dpn');">
  my [at] email [dot] com
</a>
<a href="javascript:antiSpamMail.linkDecrypt('nbjmup;nzAfnbjm/dpn');">
  Write me an email!
</a>

HTML with advanced encryption (CSS needed to hide dots)

<a href="javascript:antiSpamMail.linkDecrypt('nbjmup;nzAfnbjm/dpn');">
  my<span class="crypt" aria-hidden="true">.</span>@<span class="crypt" aria-hidden="true">.</span>email<span class="crypt" aria-hidden="true">.</span>.<span class="crypt" aria-hidden="true">.</span>com
</a>

CSS for advanced encryption

I use the image replacement method by Nicolas Gallagher:

.crypt {
  font: 0/0 a;
  text-shadow: none;
  color: transparent;
  border: 0;
  background-color: transparent;
}

License

Please be aware of the licenses of each component we use in this project. Everything else that has been developed by the contributions to this project is under MIT License.

Made with love in cologne