mirror of
https://github.com/BeardedTek/flowbite-beardedtek.com.git
synced 2025-12-06 05:31:52 +00:00
Add Plausible Banner
This commit is contained in:
22
static/js/plausible-exclude.js
Normal file
22
static/js/plausible-exclude.js
Normal file
@@ -0,0 +1,22 @@
|
||||
// Plausible Exclude
|
||||
const plausibleBanner = document.getElementById('plausible-banner');
|
||||
var hidePlausibleBanner = window.localStorage.getItem('hidePlausibleBanner');
|
||||
|
||||
function disablePlausible(e) {
|
||||
window.localStorage.setItem('plausible_ignore', 'true');
|
||||
window.localStorage.setItem('hidePlausibleBanner','true');
|
||||
plausibleBanner.classList.add('hidden');
|
||||
}
|
||||
|
||||
function enablePlausible(e) {
|
||||
window.localStorage.removeItem('plausible_ignore');
|
||||
window.localStorage.setItem('hidePlausibleBanner','true');
|
||||
plausibleBanner.classList.add('hidden');
|
||||
}
|
||||
|
||||
|
||||
if ( hidePlausibleBanner){
|
||||
plausibleBanner.classList.add('hidden');
|
||||
} else {
|
||||
plausibleBanner.classList.remove('hidden');
|
||||
}
|
||||
Reference in New Issue
Block a user