-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
19 changed files
with
290 additions
and
329 deletions.
There are no files selected for viewing
Binary file not shown.
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
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
5 changes: 5 additions & 0 deletions
5
src/ui/components/molecules/cookieConsent/CookieConsent.astro
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,5 @@ | ||
--- | ||
import 'vanilla-cookieconsent/dist/cookieconsent.css'; | ||
--- | ||
|
||
<button type="button" data-cc="show-preferencesModal">Show preferences modal</button> |
103 changes: 103 additions & 0 deletions
103
src/ui/components/molecules/cookieConsent/cookieConsent.config.ts
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,103 @@ | ||
import type { CookieConsentConfig } from 'vanilla-cookieconsent'; | ||
|
||
export const cookieConsentConfig: CookieConsentConfig = { | ||
cookie: { | ||
useLocalStorage: true, | ||
}, | ||
guiOptions: { | ||
consentModal: { | ||
layout: 'box inline', | ||
position: 'bottom left', | ||
}, | ||
preferencesModal: { | ||
layout: 'box', | ||
position: 'right', | ||
}, | ||
}, | ||
categories: { | ||
necessary: { | ||
readOnly: true, | ||
}, | ||
functionality: {}, | ||
analytics: { | ||
services: { | ||
ga4: { | ||
label: | ||
'<a href="https://marketingplatform.google.com/about/analytics/terms/us/" target="_blank">Google Analytics 4 (dummy)</a>', | ||
onAccept: () => { | ||
console.log('ga4 accepted'); | ||
// TODO: load ga4 | ||
}, | ||
onReject: () => { | ||
console.log('ga4 rejected'); | ||
}, | ||
cookies: [ | ||
{ | ||
name: /^_ga/, | ||
}, | ||
], | ||
}, | ||
another: { | ||
label: 'Another one (dummy)', | ||
}, | ||
}, | ||
}, | ||
}, | ||
language: { | ||
default: 'en', | ||
autoDetect: 'browser', | ||
translations: { | ||
en: { | ||
consentModal: { | ||
title: "Hello traveller, it's cookie time!", | ||
description: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip.', | ||
acceptAllBtn: 'Accept all', | ||
acceptNecessaryBtn: 'Reject all', | ||
showPreferencesBtn: 'Manage preferences', | ||
footer: | ||
'<a href="/privacy-policy">Privacy Policy</a>\n<a href="/terms-and-conditions">Terms and conditions</a>', | ||
}, | ||
preferencesModal: { | ||
title: 'Consent Preferences Center', | ||
acceptAllBtn: 'Accept all', | ||
acceptNecessaryBtn: 'Reject all', | ||
savePreferencesBtn: 'Save preferences', | ||
closeIconLabel: 'Close modal', | ||
serviceCounterLabel: 'Service|Services', | ||
sections: [ | ||
{ | ||
title: 'Cookie Usage', | ||
description: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', | ||
}, | ||
{ | ||
title: | ||
'Strictly Necessary Cookies <span class="pm__badge">Always Enabled</span>', | ||
description: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', | ||
linkedCategory: 'necessary', | ||
}, | ||
{ | ||
title: 'Functionality Cookies', | ||
description: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', | ||
linkedCategory: 'functionality', | ||
}, | ||
{ | ||
title: 'Analytics Cookies', | ||
description: | ||
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', | ||
linkedCategory: 'analytics', | ||
}, | ||
{ | ||
title: 'More information', | ||
description: | ||
'For any query in relation to my policy on cookies and your choices, please <a class="cc__link" href="/contact">contact me</a>.', | ||
}, | ||
], | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
1 change: 1 addition & 0 deletions
1
src/ui/components/molecules/cookieConsent/utils/initCookieConsent/index.ts
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 @@ | ||
export * from './initCookieConsent.ts' |
10 changes: 10 additions & 0 deletions
10
src/ui/components/molecules/cookieConsent/utils/initCookieConsent/initCookieConsent.ts
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,10 @@ | ||
import { run } from 'vanilla-cookieconsent'; | ||
import { cookieConsentConfig } from '../../cookieConsent.config'; | ||
import { getInitialTheme, ThemeType } from '@components/atoms/themeToggle/utils/themeSetter'; | ||
|
||
export const initCookieConsent = async () => { | ||
const theme = getInitialTheme() | ||
document.body.classList.toggle('cc--elegant-black', theme === ThemeType.DARK); | ||
|
||
await run(cookieConsentConfig); | ||
} |
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 |
---|---|---|
@@ -1,17 +1,18 @@ | ||
@layer cities { | ||
.city-card__list { | ||
--num-columns: 2; | ||
display: grid; | ||
gap: 3rem; | ||
grid-template-columns: 1fr; | ||
grid-template-rows: repeat(var(--inline-num-cards), 400px); | ||
list-style: none; | ||
margin-bottom: 3rem; | ||
max-width: calc(100% / 2); | ||
max-width: calc(100% / var(--num-columns)); | ||
padding-bottom: calc(var(--inline-index) * 0.5rem); | ||
view-timeline-name: --cities-scales-in-view; | ||
|
||
@media (max-width: 960px) { | ||
max-width:100%; | ||
--num-columns: 1; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.