Need a disclaimer/notice to prevent offensive content? Well, you fount it! π€
This Adult Disclaimer is a vanilla JavaScript one (which means it doesn't depend from any libraries such as jQuery), and allows you to use it on any websites.
Super lightweight library (just ~4KB), delivered with an elegant, simple and responsive design (adjusts its size depending of the screen resolution).
Under the hood, it uses the client HTML5 browser's sessionStorage to remember the user consentement (agreed/disagreed to see the website).
Copy the assets
folder into your project, and add the following in your HTML header (in <head></head>
section).
<link rel="stylesheet" href="assets/css/disclaimer.css" />
<script src="assets/js/Disclaimer.js"></script>
<script src="assets/js/common.js"></script>
That's all! πͺ Enjoy! π
Edit Disclaimer.js
file, and change the values in the const strings = {}
array located at the top of the file.
For instance, to update the headline from "Welcome!" to "Hi there...", change welcome: 'Welcome!'
to welcome: 'Hi there...'
In the common.js
file, you can change the disagreedRedirectLink
URL where the visitor is redirected when disagreed to continue the visit on the site.
Any problems or suggestions, please just Open an Issue on GitHub π
Have a look to pH7Builder, open source dating solution π