Cookie-Banner klarer gestalten
This commit is contained in:
+3
-3
@@ -145,12 +145,12 @@ function app_analytics_body_html(): string
|
||||
<section class="analytics-consent" id="analytics-consent" aria-labelledby="analytics-consent-title" aria-describedby="analytics-consent-description" hidden>
|
||||
<div class="analytics-consent__inner">
|
||||
<div class="analytics-consent__copy">
|
||||
<h2 id="analytics-consent-title">Optionale Nutzungsanalyse</h2>
|
||||
<h2 id="analytics-consent-title">Cookie-Zustimmung</h2>
|
||||
<p id="analytics-consent-description">Wir möchten mit Matomo verstehen, wie unsere Website und App genutzt werden. Erst nach deiner Zustimmung übermitteln wir Seitenaufrufe an unser selbst betriebenes Matomo und setzen ein Analyse-Cookie. Notwendige Cookies funktionieren immer. Mehr dazu steht im <a href="datenschutz.php">Datenschutz</a>.</p>
|
||||
</div>
|
||||
<div class="analytics-consent__actions">
|
||||
<button type="button" data-analytics-consent="denied">Nur notwendige</button>
|
||||
<button type="button" data-analytics-consent="granted">Analyse erlauben</button>
|
||||
<button type="button" data-analytics-consent="denied">Nur notwendige Cookies</button>
|
||||
<button type="button" data-analytics-consent="granted">Zustimmen</button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
@@ -75,6 +75,17 @@
|
||||
border-color: #2f6418;
|
||||
}
|
||||
|
||||
.analytics-consent__actions [data-analytics-consent="denied"] {
|
||||
background: #ffffff;
|
||||
color: #2f6418 !important;
|
||||
}
|
||||
|
||||
.analytics-consent__actions [data-analytics-consent="denied"]:hover {
|
||||
background: #f2f7ef;
|
||||
border-color: #2f6418;
|
||||
color: #244f13 !important;
|
||||
}
|
||||
|
||||
.analytics-consent__actions button:focus-visible,
|
||||
.analytics-consent-settings:focus-visible {
|
||||
outline: solid 3px #f0b429;
|
||||
|
||||
@@ -61,8 +61,14 @@ $head = app_analytics_head_html();
|
||||
$body = app_analytics_body_html();
|
||||
$assert('Consent-Stylesheet wird lokal und filterarm geladen', str_contains($head, 'assets/css/privacy-settings.css'));
|
||||
$assert('Zustimmen und Ablehnen stehen in derselben Ebene',
|
||||
str_contains($body, 'data-analytics-consent="denied"')
|
||||
&& str_contains($body, 'data-analytics-consent="granted"'));
|
||||
str_contains($body, 'data-analytics-consent="denied">Nur notwendige Cookies</button>')
|
||||
&& str_contains($body, 'data-analytics-consent="granted">Zustimmen</button>'));
|
||||
$assert('Einwilligungsdialog ist eindeutig benannt',
|
||||
str_contains($body, '<h2 id="analytics-consent-title">Cookie-Zustimmung</h2>'));
|
||||
$consentCss = file_get_contents(APP_ROOT . '/assets/css/privacy-settings.css') ?: '';
|
||||
$assert('Nur notwendige Cookies ist innen weiß gestaltet',
|
||||
str_contains($consentCss, '[data-analytics-consent="denied"]')
|
||||
&& str_contains($consentCss, 'background: #ffffff;'));
|
||||
$assert('Matomo selbst ist im HTML nicht vorab eingebunden',
|
||||
!str_contains($body, 'https://analytics.example.test')
|
||||
&& !str_contains($body, '"siteId"'));
|
||||
|
||||
Reference in New Issue
Block a user