npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vivaprivacy/cookie-consent

v1.0.4

Published

Best GDPR banner

Downloads

21

Readme

Cookie notice with a lot of customization features

Examples

Installing

Using jsDelivr CDN:

<script src="https://cdn.jsdelivr.net/npm/@vivaprivacy/[email protected]/build/cookie-consent.min.js"></script>

Classic

const CC = window.CookieConsent
Initialization:
const cc = new CC({
  //...options
})

| Prop | Type | Description |Values| | ------ | ------ | ------ |------| | theme | string | Name of preset theme | "CodGrayWhite" (default), "BigStoneTurquoise", "SeaweedAtlantis", "CharadeJaffa", "RhinoShakespeare", "CloudBurstGorse", "SanJuanGold", "BlueChillCanary", "AffairBrightSun", "PorcelainMalibu", "AliceBlueCornflowerBlue", "LinkWaterChathamsBlue", "SazeracTuscany", "CatskillWhiteAquaForest", "WhiteMineShaft"| |cookieName|string|Name of a cookie stored in a browser.|"cookie-banner"(default)| |type|string|Type of a banner. confirm: Two buttons(let visitors accept/decline cookies). alert: One button(inform visitors)|"confirm" (default), "alert"| |blockType|string|Display banner as block or line|"line" (default), "block" | |blockPosition|string|Banner position on the screen|"bottom" (default), "bottom-left", "bottom-right", "top-left", "top-right", "center", "top", "top-scroll", "bottom-scroll"| |buttonType|string|Button styles|"round-fill" (default), "round", "rectangle", "rectangle-fill", "rectangle-round", "rectangle-round-fill"| |buttonDirection|string|Display buttons in a row or one after another|"row" (default), "column"| |showPoweredBy|boolean|Display credentials|true (default), false| |blind.visible|boolean|Display screen overlay to force banner interaction|false (default), true| |blind.bgColor|string|Overlay color|"black" (default)| |blind.opacity|string|Overlay opacity|".5" (default)| |animation.type|string|Render a banner with animation.|"no" (default), "slide-top", "slide-bottom", "slide-left", "slide-right", "fade"| |animation.delay |string|Animation delay in milliseconds.|"5000" (default)| |animation.duration|string|Animation duration in milliseconds.|"500" (default)| |link.html|string|Text in the link positioned after the banner message.|"Learn more" (default)| |link.href|string|Learn more link href|"https://gdprinfo.eu" (default)| |message.html|string|Message displayed inside the banner. |"This website uses cookies to ensure you get the best experience on our website." (default)| |accept.byScroll |string|Auto accept and hide banner after user scrolls for x amount of pixels. Provide a number of pixels. |"none" (default)| |accept.byTime|number|Auto accept and hide banner after x amount of milliseconds. Provide a number of milliseconds. |"-1" (default)| |accept.byClick|boolean|Auto accept and hide banner after a user clicks anywhere on the screen|false (default), true| |refreshonallow|boolean|Refresh a page after user accepts cookies.|false (default),true| |cookieName|string|Cookie name.|"cookie-banner" (default)| |ignoreAllow|boolean|Ignores a previous choice of a user and display the banner anyway. Use for testing purposes only.|false (default), true| |popupStyles|object|Change popup CSS|Accepted parameters: {"background-color", "color", "padding", "border-radius", "border-color", "border-width", "border-style", "font-size", "font-family", "border", "box-shadow", "width"}| |messageStyles|object|Change message CSS|Accepted parameters: {"color", "font-size", "font-family", "margin"}| |linkStyle|object|Change link CSS |{"background-color", "color", "padding", "border-radius", "border-color", "border-width", "border-style", "box-shadow", "background", "font-size", "font-family", "border", "text-decoration", "margin", "display"}| |linkStyleHover|object|Change link hover CSS |{"background-color", "color", "padding", "border-radius", "border-color", "border-width", "border-style", "box-shadow", "background", "font-size", "font-family", "border", "text-decoration", "margin", "display"}| |allowHtml|string|Accept button HTML|"Accept" (default)| |allowStyle|object|Accept button CSS|{"background-color", "color", "padding", "border-radius", "border-color", "border-width", "border-style", "font-size", "font-family", "box-shadow", "background", "border"}| |allowStyleHover|object|Accept button hover CSS|{"background-color", "color", "padding", "border-radius", "border-color", "border-width", "border-style", "font-size", "font-family", "box-shadow", "background", "border"}| |dismissHtml|string|Dismiss button HTML|"Dismiss" (default)| |dismissStyle|object|Dismiss button hover CSS|{"background-color", "color", "padding", "border-radius", "border-color", "border-width", "border-style", "font-size", "font-family", "box-shadow", "background", "border"}| |dismissStyleHover|object|Dismiss button hover CSS|{"background-color", "color", "padding", "border-radius", "border-color", "border-width", "border-style", "font-size", "font-family", "box-shadow", "background", "border"}| |declineHtml|string|Decline button HTML|"Decline" (default)| |declineStyle|object|Decline button hover CSS|{"background-color", "color", "padding", "border-radius", "border-color", "border-width", "border-style", "font-size", "font-family", "box-shadow", "background", "border"}| |declineStyleHover|object|Decline button hover CSS|{"background-color", "color", "padding", "border-radius", "border-color", "border-width", "border-style", "font-size", "font-family", "box-shadow", "background", "border"}| |onAllow|function|Function to call after a user clicks on the allow button|Example: function() { console.log("clicked allow button"); }| |onDecline|function|Function to call after a user clicks on the decline button|Example: function() {console.log("clicked decline button");}| |onDismiss|function|Function to call after a user clicks on the dismiss button|Example: function() {console.log("clicked dismiss button");}| |onRestore|function|Function to call after the banner is shown again|Example: function() {console.log("restores");}| |onInit|function(onAllow)|Function to call on banner initizalization|Example: function(isAllow) {console.log("plugin has been initialzed", isAllow);}| |onUpdate|function(onAllow)|Function to call on banner update|Example: function(isAllow) {console.log("updated", isAllow);}|