{"id":19746811,"url":"https://github.com/massimo-cassandro/cookie-consent","last_synced_at":"2025-04-30T08:31:49.783Z","repository":{"id":32160195,"uuid":"35733351","full_name":"massimo-cassandro/cookie-consent","owner":"massimo-cassandro","description":"Small and customizable script to display a cookie consent banner","archived":false,"fork":false,"pushed_at":"2024-06-17T06:46:33.000Z","size":152,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-28T14:24:47.926Z","etag":null,"topics":["cookies","gdpr","privacy"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/massimo-cassandro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-16T17:33:26.000Z","updated_at":"2024-06-17T06:46:30.000Z","dependencies_parsed_at":"2024-06-17T07:55:14.062Z","dependency_job_id":"88ed1335-8def-4b9e-8808-48b3ccf6c6b1","html_url":"https://github.com/massimo-cassandro/cookie-consent","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-cassandro%2Fcookie-consent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-cassandro%2Fcookie-consent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-cassandro%2Fcookie-consent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/massimo-cassandro%2Fcookie-consent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/massimo-cassandro","download_url":"https://codeload.github.com/massimo-cassandro/cookie-consent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224202778,"owners_count":17272807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cookies","gdpr","privacy"],"created_at":"2024-11-12T02:15:58.159Z","updated_at":"2024-11-12T02:15:58.776Z","avatar_url":"https://github.com/massimo-cassandro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cookie consent banner\n\n**v.3 (was “consenso-cookie” in v.1)**\n\n\u003chttps://github.com/massimo-cassandro/cookie-consent\u003e\n\nSmall and customizable script to display a cookie consent banner\n\n## Installation\n\n```\nnpm i --save @massimo-cassandro/cookie-consent\n```\n\n## Using Cookie consent banner\nImport `cookie-consent.js` as es6 module to your project and add\n`cookie-consent.scss` to your styles (you can also use the compiled css version in the demo folder).\n\n```javascript\nimport {cookie_consent} from '@massimo-cassandro/cookie-consent';\n```\n\nMany elements of scss can be customized:\n\n```scss\n$mcc-font-family: false; // set to false to inherit document font-family\n$mcc-banner-bg-color: #444;\n$mcc-banner-text-color: color-yiq($mcc-banner-bg-color);\n\n$mcc-link-color: #fc0;\n$mcc-link-hover-color: darken($mcc-link-color, 10);\n$mcc-link-text-decoration: none;\n$mcc-link-hover-text-decoration: underline;\n\n$mcc-button-bg-color: #fc0;\n$mcc-button-text-color: #000;\n$mcc-button-hover-bg-color: darken($mcc-button-bg-color, 10);\n$mcc-button-hover-text-color: #000;\n\n$mcc-border-radius: 0;\n\n$mcc-box-shadow: 0 0 4px rgba(#000, .6); // set to false or none to disable\n\n@import '@massimo-cassandro/cookie-consent';\n```\n\nTo activate the banner, invoke the function adding some parameter:\n\n```javascript\ncookie_consent({\n  message: '...',\n  btn_text: '...',\n  banner_aria_label: '...',\n  btn_aria_label: '...',\n  btn_class: '...' \n});\n```\n\nWhere:\n\n* `message` is the text to be displayed in the banner (html allowed). It may contain the link to your privacy policy page\n* `btn_text` is the text of the dismiss button (html allowed)\n* `banner_aria_label` and `btn_aria_label` are text for ARIA label attributes\n* `btn_class` is an optional class(es) to be added to the dismiss button\n\nThe banner is positioned at page bottom right. To change this behavior you have to change the scss/css file.\n\nIf the banner is displayed, a `div.cookie-consent` element is appended to your page.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmassimo-cassandro%2Fcookie-consent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmassimo-cassandro%2Fcookie-consent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmassimo-cassandro%2Fcookie-consent/lists"}