-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebd50dc
commit f50f60c
Showing
14 changed files
with
308 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
.cc--custom { | ||
color-scheme: dark; | ||
|
||
--cc-font-family: InterVariable, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'; | ||
|
||
--cc-bg: #000; | ||
/* .text-base-content-highlight */ | ||
--cc-primary-color: rgb(229 231 235); | ||
/* .text-base-content */ | ||
--cc-secondary-color: rgb(156 163 175); | ||
|
||
/* .text-base-content-highlight */ | ||
--cc-btn-primary-bg: rgb(229 231 235); | ||
--cc-btn-primary-color: #000; | ||
--cc-btn-primary-hover-bg: #ccd4d8; | ||
--cc-btn-primary-hover-color: #000; | ||
|
||
--cc-btn-secondary-bg: transparent; | ||
--cc-btn-secondary-color: var(--cc-primary-color); | ||
--cc-btn-secondary-border-color: #252729; | ||
--cc-btn-secondary-hover-bg: #252729; | ||
--cc-btn-secondary-hover-color: #fff; | ||
--cc-btn-secondary-hover-border-color: #252729; | ||
|
||
--cc-cookie-category-block-bg: #101111; | ||
--cc-cookie-category-block-border: #1d1e1f; | ||
--cc-cookie-category-block-hover-bg: #151516; | ||
--cc-cookie-category-block-hover-border: #1d1e1f; | ||
--cc-cookie-category-expanded-block-hover-bg: #1d1e1f; | ||
--cc-cookie-category-expanded-block-bg: #101111; | ||
|
||
--cc-overlay-bg: rgba(0, 0, 0, 0.9) !important; | ||
|
||
--cc-toggle-on-knob-bg: var(--cc-bg); | ||
--cc-toggle-readonly-bg: #2f3132; | ||
--cc-toggle-readonly-knob-bg: var(--cc-cookie-category-block-bg); | ||
|
||
--cc-separator-border-color: #252729; | ||
|
||
--cc-footer-border-color: #212529; | ||
--cc-footer-bg: #000; | ||
} | ||
|
||
.cc--custom #cc-main .cm, | ||
.cc--custom #cc-main .pm { | ||
border: 1px solid var(--cc-separator-border-color); | ||
} | ||
|
||
/* Body: Remove inner separator borders */ | ||
@media screen and (max-width: 640px) { | ||
.cc--custom #cc-main .cm__btns, | ||
.cc--custom #cc-main .cm__footer { | ||
border-top: none !important; | ||
} | ||
} | ||
|
||
/* Footer: padding */ | ||
.cc--custom #cc-main .cm__footer { | ||
padding: 0.6em 0 0.8em; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import {defineNuxtPlugin} from '#app' | ||
import type {PostHog} from 'posthog-js' | ||
import posthog from 'posthog-js' | ||
|
||
// TODO: Refactor so this is loaded only when the user has given consent | ||
export default defineNuxtPlugin(nuxtApp => { | ||
const runtimeConfig = useRuntimeConfig() | ||
const router = useRouter() | ||
|
||
let posthogClient: PostHog | null = null | ||
|
||
window.addEventListener('cc:onConsent', ({detail}) => { | ||
|
||
const cookie = detail.cookie | ||
|
||
if (!cookie.services.analytics.includes('posthog')) { | ||
return | ||
} | ||
|
||
// console.debug('PostHog consent given') | ||
|
||
if (!posthogClient) { | ||
posthogClient = posthog.init(runtimeConfig.public.POSTHOG_PUBLIC_KEY, | ||
{ | ||
api_host: runtimeConfig.public.POSTHOG_HOST, | ||
|
||
// we add manual pageview capturing below | ||
capture_pageview: false, | ||
|
||
// loaded: (posthog) => { | ||
// if (import.meta.env.MODE === 'development') posthog.debug() | ||
// } | ||
}) | ||
} | ||
}) | ||
|
||
// Make sure that pageviews are captured with each route change | ||
router.afterEach((to) => { | ||
if (!posthogClient) { | ||
return | ||
} | ||
|
||
nextTick(() => { | ||
posthog.capture('$pageview', { | ||
current_url: to.fullPath | ||
}) | ||
}) | ||
}) | ||
|
||
return { | ||
provide: { | ||
posthog: () => posthogClient | ||
} | ||
} | ||
}) |
Oops, something went wrong.