Giter Site home page Giter Site logo

kilimanjaro-a2 / censored-style-js Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 725 KB

censored-style.js is a Web Component that allows you to easily apply styles that look as if they are being censored

Home Page: https://kilimanjaro-a2.github.io/censored-style-js/

License: MIT License

JavaScript 7.45% TypeScript 71.79% HTML 20.76%
web-components style censored-words redacted

censored-style-js's Introduction

censored-style.js

censored-style.js is a Web Component that allows you to easily apply styles that look as if they are being censored

Description

This is a script that makes areas marked up with certain tags look as if they are being censored.

Notes

This script is intended to change the style, not to really censor and remove strings. It only applies styles and does not actually delete information, so censored information can be easily restored. Do not use it for sensitive information.

Demo

https://kilimanjaro-a2.github.io/censored-style-js/

Requirement

In order to use this script, the user's browser must support Web Components.

Usage

In order to use scripts, you must first load the script, for example, in the head tag.

<head>
  <script src="https://cdn.jsdelivr.net/gh/Kilimanjaro-a2/censored-style-js@gh-pages/censored-style.js"></script>
</head>

Within the area enclosed by the censored-style tag, the censored-style style can be applied by using specific tags. By default, enclosing text with the censored tag will cause the enclosed text to be censored.

<censored-style>
  <p>This is a normal text.</p>
  <p>This is a <censored>censored text</censored>.</p>
</censored-style>

You can set the options by specifying arguments to the censored-style tag.

<censored-style
  censorship-tag="c"
  censorship-type="blur"
  replace-text="*"
  replace-repeat="true"
>
  <p>This is a normal text.</p>
  <p>This is a <c>censored text</c>.</p>
</censored-style>

Licence

MIT License

Author

Kilimanjaro-a2

censored-style-js's People

Contributors

kilimanjaro-a2 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.