Coder Social home page Coder Social logo

trendingtechnology / react-obfuscate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coston/react-obfuscate

0.0 1.0 0.0 645 KB

An intelligent React component to obfuscate any contact link!

Home Page: https://react-obfuscate.coston.io

License: MIT License

CSS 8.28% JavaScript 86.06% HTML 5.66%

react-obfuscate's Introduction

react-obfuscate

Greenkeeper badge npm version npm code style: prettier

react-obfuscate

Demo & Examples

Live demo: react-obfuscate.coston.io

How it works

The user passes the contact link as an email, tel, sms, or facetime prop. The component obfuscates href data until an onClick event. Links are given their proper URL schemes (mailto, facetime, etc.) The link is rendered in reverse in the dom, but reversed again with css. This making the link useless for spammers, but user friendly on screen.

Why

The world needs obfuscated links that display the link in a friendly way.

Installation

npm install --save react-obfuscate

Input

import React from 'react'
import Obfuscate from 'react-obfuscate'

export default () => (
  <p>
    Phone: <Obfuscate tel="205-454-1234" />
    <br />
    Email:{' '}
    <Obfuscate
      email="[email protected]"
      headers={{
        subject: 'Question from the website',
        cc: '[email protected]',
      }}
    />
  </p>
)

Output

Robot Interaction

<p>
  Phone: <a href="obfuscated" style="direction: rtl; unicode-bidi: bidi-override;">4321-454-502</a><br>
  Email: <a href="obfuscated" style="direction: rtl; unicode-bidi: bidi-override;">looc.notsoc@olleh</a>
</p>

Human Interaction

<p>
  Phone: <a href="tel:205-454-1234">205-454-1234</a><br>
  Email: <a href="mailto:[email protected]&subject=Question%20from%20the%20website&[email protected]">[email protected]</a>
</p>

Options

Prop Type Argument Default Description
email string <optional> null email address of the intended recipient
tel string <optional> null telephone number of the intended recipient
sms string <optional> null sms number of the intended recipient
facetime string <optional> null facetime address of the intended recipient
headers object <optional> null subject, cc, bcc, body, etc
obfuscate boolean <optional> true set to false to disable obfuscation
linkText string <optional> obfuscated add custom obfuscated link text, like 'Email Me'

Development

npm run build

Contributors

react-obfuscate is awesome thanks to these community members:

Contributing

Please help make this react component better. Submit any issue and/or make a pull request!

License

Licensed under the MIT license.

react-obfuscate's People

Contributors

bostrom avatar coston avatar greenkeeper[bot] avatar mic avatar timmygee avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.