Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sebadob/leptos-obfuscate

Tiny crate with a Leptos component for obfuscating email addresses
https://github.com/sebadob/leptos-obfuscate

email-obfuscation leptos rust wasm

Last synced: 3 months ago
JSON representation

Tiny crate with a Leptos component for obfuscating email addresses

Awesome Lists containing this project

README

        

# leptos-obfuscate

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

Add the following to your CSS stylesheet:

```css
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:

```notest
let (email, _) = create_signal("[email protected]".to_string());
view! { }
```

# 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