#obfuscation

leptos-obfuscate

Simple email obfuscation component for Leptos

4 releases (2 breaking)

0.3.0 Jul 28, 2024
0.2.0 Feb 2, 2024
0.1.1 Dec 30, 2023
0.1.0 Dec 30, 2023

#741 in Web programming

Download history 124/week @ 2024-07-22 71/week @ 2024-07-29 32/week @ 2024-08-05 24/week @ 2024-08-12 24/week @ 2024-08-19 18/week @ 2024-08-26 14/week @ 2024-09-02 23/week @ 2024-09-09 26/week @ 2024-09-16 50/week @ 2024-09-23 30/week @ 2024-09-30 32/week @ 2024-10-07 39/week @ 2024-10-14 22/week @ 2024-10-21 32/week @ 2024-10-28 32/week @ 2024-11-04

129 downloads per month

MIT license

5KB

leptos-obfuscate

This is for easy email address obfuscation to prevent bots and spammers.

Add the following to your CSS stylesheet:

span.obfuscate {
    unicode-bidi: bidi-override;
    direction: rtl;
    cursor: pointer;
}

span.obfuscate > i {
    display: none;
}

span.obfuscate > span::after {
    content: '@';
}

The component accepts an optional honeypot email address / link you can use, if you want to have a sophisticated setup and blacklist any sender that sends an E-Mail to it.

The delay_seconds can be set as well. After this timeout, when mounted inside the browser, the honeypot address will be exchanged with the real one. This means the link will not work with HTML only, but there is no good way to prevent bots without Javascript / WASM.

Then just use it like this:

let (email, _) = create_signal("mail@example.com".to_string());
view! { <ObfuscateEmail email /> }

Panics

If the given String does not contain '@'

Leptos Compatibility

Leptos v0.7

leptos-obfuscate v0.3+

Leptos v0.6

leptos-obfuscate v0.2

Leptos v0.5

leptos-obfuscate v0.1

Dependencies

~21–33MB
~521K SLoC