Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fe2cb13aff | |||
| 7187f7bb2a | |||
| ac0e1ed8c6 | |||
| 5597e11a69 | |||
| a607faec9a |
@@ -1,6 +1,6 @@
|
|||||||
(function () {
|
(function () {
|
||||||
function trackVisit() {
|
function trackVisit() {
|
||||||
var banner = document.getElementById('cookie_banner');
|
var banner = document.getElementById('cookie-banner');
|
||||||
if (!banner) return;
|
if (!banner) return;
|
||||||
var matomoUrl = banner.dataset.matomoUrl;
|
var matomoUrl = banner.dataset.matomoUrl;
|
||||||
var siteId = banner.dataset.matomoSiteId;
|
var siteId = banner.dataset.matomoSiteId;
|
||||||
@@ -23,4 +23,4 @@
|
|||||||
if (localStorage.getItem('cookie_consent') === 'accepted') {
|
if (localStorage.getItem('cookie_consent') === 'accepted') {
|
||||||
trackVisit();
|
trackVisit();
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -16,6 +16,12 @@
|
|||||||
gap: 1rem;
|
gap: 1rem;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
transition: opacity 0.5s ease;
|
transition: opacity 0.5s ease;
|
||||||
|
|
||||||
|
@media (max-width: 420px) {
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: stretch;
|
||||||
|
gap: 0.75rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#cookie-banner.fade-out {
|
#cookie-banner.fade-out {
|
||||||
@@ -23,7 +29,25 @@
|
|||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#cookie-banner p { margin: 0; font-size: 14px; flex: 1; }
|
#cookie-banner p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 14px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#cookie-banner .cookie-buttons {
|
||||||
|
display: flex;
|
||||||
|
gap: 0.5rem;
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
@media (max-width: 420px) {
|
||||||
|
width: 100%;
|
||||||
|
|
||||||
|
button {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#cookie-banner button {
|
#cookie-banner button {
|
||||||
margin: 0.1rem 0;
|
margin: 0.1rem 0;
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
<div id="cookie-banner" style="display:none" role="dialog"
|
<div id="cookie-banner" style="display:none" role="dialog"
|
||||||
aria-label="Cookie consent" aria-live="polite"
|
aria-label="Cookie consent" aria-live="polite"
|
||||||
data-matomo-url="{{ .Site.Params.hugo_cookie_consent.matomo_host }}"
|
data-matomo-url="{{ .Site.Params.hugo_cookie_consent.matomo_host }}"
|
||||||
data-matomo-site-id="{{ .Site.Params.hugo_cookie_consent_matomo_site_id }}" >
|
data-matomo-site-id="{{ .Site.Params.hugo_cookie_consent.matomo_site_id }}" >
|
||||||
<p>
|
<p>
|
||||||
{{ i18n "site_wants_cookie" }}
|
{{ i18n "site_wants_cookie" }}
|
||||||
<a href="{{ .Site.Params.hugo_cookie_consent.privacy_policy_url }}">
|
<a href="{{ .Site.Params.hugo_cookie_consent.privacy_policy_url }}">
|
||||||
{{ i18n "cookie_more_info" }}
|
{{ i18n "cookie_more_info" }}
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div class="cookie-buttons">
|
||||||
<button id="cookie-accept">
|
<button id="cookie-accept">
|
||||||
{{ i18n "cookie_button_accept" }}
|
{{ i18n "cookie_button_accept" }}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -3,4 +3,5 @@
|
|||||||
{{- if eq .Site.Params.hugo_cookie_consent.enable_tracking true -}}
|
{{- if eq .Site.Params.hugo_cookie_consent.enable_tracking true -}}
|
||||||
{{- $js := resources.Get "js/hugo_cookie_consent/tracker_code.js" | minify -}}
|
{{- $js := resources.Get "js/hugo_cookie_consent/tracker_code.js" | minify -}}
|
||||||
<script src="{{ $js.RelPermalink }}" defer></script>
|
<script src="{{ $js.RelPermalink }}" defer></script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<p>
|
<p>
|
||||||
{{ i18n "cookie_status" }}:
|
{{ i18n "cookie_status" }}:
|
||||||
<strong id="cookie_status"
|
<strong id="cookie-status"
|
||||||
data-accepted="{{ i18n "cookie_accepted" }}"
|
data-accepted="{{ i18n "cookie_accepted" }}"
|
||||||
data-declined="{{ i18n "cookie_declined" }}"
|
data-declined="{{ i18n "cookie_declined" }}"
|
||||||
data-none="{{ i18n "cookie_none" }}">
|
data-none="{{ i18n "cookie_none" }}">
|
||||||
|
|||||||
Reference in New Issue
Block a user