Skip to content

Commit d02e8f6

Browse files
authored
Merge pull request #631 from Alt-Org/liisa/chore/617-update-cookie-banner-and-legal-pages-guidelines
Liisa/chore/617 update cookie banner and legal pages guidelines
2 parents e1368ee + cdea640 commit d02e8f6

10 files changed

Lines changed: 183 additions & 63 deletions

File tree

frontend-next-migration/src/entities/PresentationPackages/model/data/cookiesSections.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ import { createSection } from '../createSection';
33
const i18nKeyPrefixes = [
44
'policies',
55
'cookies',
6+
'cookies2',
7+
'website',
8+
'analytics',
69
'interpretation',
710
'type',
811
'choices',

frontend-next-migration/src/entities/PresentationPackages/model/data/privacySections.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@ import { createSection } from '../createSection';
33
const i18nKeyPrefixes = [
44
'privacy',
55
'interpretation',
6+
'user',
67
'collecting',
8+
'testing',
79
'analytics',
810
'legal-basis',
11+
'review',
12+
'gameteam',
13+
'datasubject',
914
'data-retention',
1015
'rights',
1116
'security',

frontend-next-migration/src/features/CookieConsentV3/CookieConsentV3.module.scss

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
bottom: 0;
44
left: 50%;
55
transform: translateX(-50%);
6-
width: 780px;
6+
width: 100%;
7+
max-width: 800px;
78
padding: 24px;
89
background: var(--background);
910
border: solid var(--black);
@@ -18,7 +19,9 @@
1819
box-sizing: border-box;
1920
box-shadow: 8px 8px 1px #000000;
2021
transition: height 0.3s ease-in-out;
21-
height: 360px;
22+
max-height: 90vh;
23+
overflow-y: auto;
24+
2225
@media (max-width: breakpoint(xs)) {
2326
height: 690px;
2427
}
@@ -84,20 +87,12 @@
8487
}
8588
}
8689
.cookieConsentContent {
87-
display: flex;
88-
align-items: center;
89-
justify-content: space-between;
90-
gap: 24px;
91-
}
92-
.alignVertically {
9390
display: flex;
9491
flex-direction: row;
95-
align-items: center !important;
92+
align-items: flex-start;
9693
justify-content: space-between;
97-
}
98-
99-
.cookieText {
100-
flex: 1;
94+
gap: 24px;
95+
width: 100%;
10196
}
10297

10398
.cookieHeader {
@@ -107,21 +102,19 @@
107102
line-height: 1.2 !important;
108103
text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
109104
}
110-
111-
.cookieShortHeader {
112-
color: var(--primary-color);
113-
font: var(--font-sw-l);
114-
text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
115-
}
105+
.alignVertically { display: flex; flex-direction: row; align-items: center !important; justify-content: space-between; } .cookieText { flex: 1; width: 100%; white-space: pre-line; overflow-wrap: break-word; word-break: break-word; }
106+
.cookieShortHeader { color: var(--primary-color); font: var(--font-sw-l); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }
116107

117108
.cookieConsentContentText {
109+
flex: 1;
118110
font: var(--font-dm-m);
119111
color: white;
120112
line-height: 1.6 !important;
121113
letter-spacing: -0.01em;
122114
text-align: left;
123-
width: 432px;
124115
margin-bottom: 16px;
116+
overflow-wrap: break-word;
117+
word-break: break-word;
125118
}
126119

127120
.cookieImage {
@@ -174,33 +167,35 @@
174167

175168
/* Responsive adjustments */
176169
@media (max-width: breakpoint(xs)) {
170+
177171
.cookieConsentV2 {
178172
width: 90%;
173+
padding: 16px;
174+
}
175+
.cookieConsentContentText {
176+
flex-direction: column;
177+
width: 100%;
178+
height: auto;
179+
line-height: 1.5 !important;
180+
padding-left: 0;
181+
text-align: center !important;
182+
margin: 0 auto 16px auto;
179183
}
180-
181184
button:not(.processButton) + button:not(.processButton) {
182185
margin-left: 0px;
183186
padding-top: 10px;
184187
}
185188

186189
.cookieConsentContent {
187190
flex-direction: column;
188-
width: 333px;
189-
padding-right: 35px;
191+
width: 100%;
190192
}
191193

192194
.cookieHeader {
193195
font: var(--font-sw-l);
196+
text-align: center;
194197
}
195-
196-
.cookieConsentContentText {
197-
font: var(--font-dm-m);
198-
width: 301px;
199-
height: 224px;
200-
line-height: 1.5;
201-
padding-left: 8px;
202-
}
203-
198+
204199
.cookieImage {
205200
width: 164px;
206201
max-width: 164px;
@@ -226,20 +221,22 @@
226221

227222
.cookieConsentContent {
228223
flex-direction: column;
229-
width: 333px;
230-
padding-right: 35px;
224+
width: 100%;
225+
padding: 0;
231226
}
232227

233228
.cookieHeader {
234229
font: var(--font-sw-l);
230+
text-align: center;
235231
}
236232

237233
.cookieConsentContentText {
238234
font: var(--font-dm-m);
239-
width: 301px;
240-
height: 224px;
235+
width: 100%;
236+
height: auto;
241237
line-height: 1.5 !important;
242238
padding-left: 8px;
239+
text-align: center !important;
243240
}
244241

245242
.cookieImage {
@@ -253,4 +250,5 @@
253250
.declineButton {
254251
width: 100%;
255252
}
253+
256254
}

frontend-next-migration/src/features/CookieConsentV3/CookieConsentV3.tsx

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
11
'use client';
2+
/**
3+
* CookieConsentV3 – GDPR-compliant cookie consent banner for ALT Zone.
4+
*
5+
* This client-side component displays a cookie consent banner that:
6+
* - Allows users to accept or decline cookies
7+
* - Stores consent persistently in a cookie for 1 year
8+
* - Supports minimized and expanded banner states
9+
* - Localizes text using `react-i18next`
10+
* - Links to Privacy Policy and Cookie Policy pages based on the current locale
11+
*
12+
* If cookie consent has already been handled, the component renders nothing.
13+
*
14+
* UI Behavior:
15+
* - Minimized mode shows a short description and action buttons
16+
* - Expanded mode shows full description and a character image
17+
*
18+
* @returns {JSX.Element | null} The cookie consent banner, or null if consent exists
19+
*/
220
import React, { useState, useEffect } from 'react';
321
import { useTranslation } from 'react-i18next';
422
import Image from 'next/image';
@@ -16,13 +34,20 @@ const CookieConsentV3: React.FC = () => {
1634
const [isMinimized, setIsMinimized] = useState(false);
1735
const [cookiesHandled, setCookiesHandled] = useState(false);
1836

37+
// Check if cookie consent is already present
1938
useEffect(() => {
2039
const consent = document.cookie.includes('AltZoneCookieConsent=');
2140
if (consent) {
2241
setCookiesHandled(true);
2342
}
2443
}, []);
2544

45+
/**
46+
* Handles user action for cookie consent.
47+
*
48+
* @param action - 'accept' or 'decline'
49+
* @returns void
50+
*/
2651
const handleEventCookies = (action: 'accept' | 'decline') => {
2752
const expirationDate = new Date();
2853
expirationDate.setFullYear(expirationDate.getFullYear() + 1);
@@ -32,22 +57,34 @@ const CookieConsentV3: React.FC = () => {
3257
};
3358

3459
const descriptionParts = t('description').split(
35-
/(tietosuojan|evästeiden|privacy|cookies|конфиденциальности|файлов cookie)/,
60+
/(Tietosuojaseloste|evästekäytäntö|Privacy Policy|Cookie Policy|конфиденциальности|файлов cookie)/,
3661
);
3762
const shortDescriptionParts = t('shortDescription').split(
38-
/(tietosuojan|evästeiden|privacy|cookies|конфиденциальности|файлов cookie)/,
63+
/(Tietosuojaseloste|evästekäytäntö|Privacy Policy|Cookie Policy|конфиденциальности|файлов cookie)/,
3964
);
4065

66+
/**
67+
* Returns a localized URL for privacy or cookie pages based on current language.
68+
*
69+
* @param base - 'privacy' or 'cookies'
70+
* @returns {string} Localized URL
71+
*/
4172
const getLocalizedUrl = (base: string) => {
4273
const lang = i18n.language || 'en';
4374
if (base === 'privacy') return '/' + lang + '/privacy';
4475
if (base === 'cookies') return '/' + lang + '/cookies';
4576
return '/';
4677
};
4778

79+
/**
80+
* Renders description text with links for Privacy Policy / Cookie Policy.
81+
*
82+
* @param parts - Array of strings from description split by policy keywords
83+
* @returns JSX.Element[]
84+
*/
4885
const renderDescription = (descriptionParts: string[]) =>
4986
descriptionParts.map((part, index) => {
50-
if (['tietosuojan', 'privacy', 'конфиденциальности'].includes(part)) {
87+
if (['Tietosuojaseloste', 'Privacy Policy', 'конфиденциальности'].includes(part)) {
5188
return (
5289
<Link
5390
key={index}
@@ -60,7 +97,7 @@ const CookieConsentV3: React.FC = () => {
6097
</Link>
6198
);
6299
}
63-
if (['evästeiden', 'cookies', 'файлов cookie'].includes(part)) {
100+
if (['evästekäytäntö', 'Cookie Policy', 'файлов cookie'].includes(part)) {
64101
return (
65102
<Link
66103
key={index}
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"header": "USE OF COOKIES",
2+
"header": "WE USE COOKIES",
33
"shortHeader": "COOKIES",
4-
"description": "This website uses cookies and local storage to improve user experience.\nIf you do not accept cookies, you may still use the website, but some features may be restricted.\nBy using our website, you accept our privacy policy and cookie usage.",
4+
"description": "We use cookies and local storage to ensure the technical functionality of the website and to improve user experience. We also use analytics (Google Analytics) to monitor website usage and for educational purposes during school-based testing. Analytics data is statistical and is not used to identify individual users or for advertising.\n\nYou may accept all cookies or continue using the site without analytics cookies. In this case, some features may be limited.\n\nPrivacy Policy and Cookie Policy",
55
"shortDescription": "Accept or decline the use of privacy and cookies.",
6-
"declineButton": "Continue without accepting",
7-
"acceptButton": "Accept"
6+
"link": "Privacy Policy and Cookie Policy",
7+
"declineButton": "Continue without analytics",
8+
"acceptButton": "Accept all"
89
}

frontend-next-migration/src/shared/i18n/locales/en/cookies.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,31 @@
1010

1111
"policies-nav-menu-title": "ALT Zone",
1212
"policies-label": "Cookies Policy for ALT Zone",
13-
"policies-description": "Last updated: March 12, 2025",
13+
"policies-description": "Last updated: February 16, 2026",
1414

1515
"cookies-nav-menu-title": "Policy",
1616
"cookies-label": "Cookies Policy",
1717
"cookies-description": "This Cookies Policy explains what Cookies are and how We use them. You should read this policy so You can understand what type of cookies We use, or the information We collect using Cookies and how that information is used. This Cookies Policy has been created with the help of the <a href=\"https://www.freeprivacypolicy.com/free-privacy-policy-generator/\" target=\"_blank\">Cookies Policy Generator</a>.<br><br>Cookies do not typically contain any information that personally identifies a user, but personal information that we store about You may be linked to the information stored in and obtained from Cookies. For further information on how We use, store and keep your personal data secure, see our Privacy Policy.<br><br>We do not store sensitive personal information, such as mailing addresses, account passwords, etc. in the Cookies We use.",
1818

19+
"cookies2-nav-menu-title": "Cookies",
20+
"cookies2-label": "Cookies",
21+
"cookies2-description": "The ALT Zone website uses cookies and local storage to ensure technical functionality and improve user experience.<br><br>The use of cookies is based on user consent, and cookie preferences are stored.",
22+
23+
"website-nav-menu-title": "Data Collected",
24+
"website-label": "Data Collected",
25+
"website-description": "<h3>Website</h3>When using the ALT Zone website, the following data may be processed:<br><br>● Technical log data (e.g. browser type, device type, time of access)<br>● Aggregated usage statistics via Google Analytics<br>● Cookie and local storage data required for technical functionality and usability<br><br>Google Analytics is used solely for website development, usability improvement, and educational purposes. IP addresses are anonymized, and data is not used to identify individual users or for advertising purposes.",
26+
27+
"analytics-nav-menu-title": "Google Analytics",
28+
"analytics-label": "Google Analytics",
29+
"analytics-description": "Google Analytics is used for:<br><br>● General monitoring of website traffic and usage<br>● Website development and usability improvement<br>● Educational purposes during school-based testing, to demonstrate what types of statistical and technical data websites may collect<br><br>IP addresses are anonymized, and analytics data is not linked to user accounts or used for advertising or profiling.",
30+
1931
"interpretation-nav-menu-title": "Interpretation",
2032
"interpretation-label": "Interpretation and Definitions",
21-
"interpretation-description": "<h3>Interpretation</h3>Words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural.<br><br><h3>Definitions</h3>For the purposes of this Cookies Policy:<br><br> ●<b>Company</b> (referred to as either 'the Company', 'We', 'Us' or 'Our' in this Cookies Policy) refers to Psyche's Royale Gaming ry, Laturinkatu 3, 08100 Lohja.<br> ●<b>Cookies</b> means small files that are placed on Your computer, mobile device or any other device by a website, containing details of your browsing history on that website among its many uses.<br> ●<b>Website</b> refers to ALT Zone, accessible from <https://altzone.fi><br> ●<b>Account</b> means a unique account created for You to access our Service or parts of our Service.<br> ●<b>You</b> means the individual accessing or using the Website, or a company, or any legal entity on behalf of which such individual is accessing or using the Website, as applicable.<br> ●<b>Usage Data</b> refers to data collected automatically, either generated by the use of the Service or from the Service infrastructure itself (for example, the duration of a page visit).",
33+
"interpretation-description": "<h3>Interpretation</h3>Words of which the initial letter is capitalized have meanings defined under the following conditions. The following definitions shall have the same meaning regardless of whether they appear in singular or in plural.<br><br><h3>Definitions</h3>For the purposes of this Cookies Policy:<br><br> ● <b>Company</b> (referred to as either 'the Company', 'We', 'Us' or 'Our' in this Cookies Policy) refers to Psyche's Royale Gaming ry, Laturinkatu 3, 08100 Lohja.<br> ● <b>Cookies</b> means small files that are placed on Your computer, mobile device or any other device by a website, containing details of your browsing history on that website among its many uses.<br> ● <b>Website</b> refers to ALT Zone, accessible from <https://altzone.fi><br> ● <b>Account</b> means a unique account created for You to access our Service or parts of our Service.<br> ● <b>You</b> means the individual accessing or using the Website, or a company, or any legal entity on behalf of which such individual is accessing or using the Website, as applicable.<br> ● <b>Usage Data</b> refers to data collected automatically, either generated by the use of the Service or from the Service infrastructure itself (for example, the duration of a page visit).",
2234

2335
"type-nav-menu-title": "Usage",
2436
"type-label": "The use of the Cookies",
25-
"type-description": "Cookies can be \"Persistent\" or \"Session\" Cookies. Persistent Cookies remain on your personal computer or mobile device when You go offline, while Session Cookies are deleted as soon as You close your web browser.<br><br>We use both session and persistent Cookies for the purposes set out below:<br><br> ●<b>Necessary / Essential Cookies</b><br>Type: Session Cookies<br>Administered by: Us<br>Purpose: These Cookies are essential to provide You with services available through the Website and to enable You to use some of its features. They help to authenticate users and prevent fraudulent use of user accounts. Without these Cookies, the services that You have asked for cannot be provided, and We only use these Cookies to provide You with those services.<br><br> ●<b>Functionality Cookies</b><br>Type: Persistent Cookies<br>Administered by: Us<br>Purpose: These Cookies allow us to remember choices You make when You use the Website, such as remembering your login details or language preference. The purpose of these Cookies is to provide You with a more personal experience and to avoid You having to re-enter your preferences every time You use the Website.",
37+
"type-description": "Cookies can be \"Persistent\" or \"Session\" Cookies. Persistent Cookies remain on your personal computer or mobile device when You go offline, while Session Cookies are deleted as soon as You close your web browser.<br><br>We use both session and persistent Cookies for the purposes set out below:<br><br> ● <b>Necessary / Essential Cookies</b><br>Type: Session Cookies<br>Administered by: Us<br>Purpose: These Cookies are essential to provide You with services available through the Website and to enable You to use some of its features. They help to authenticate users and prevent fraudulent use of user accounts. Without these Cookies, the services that You have asked for cannot be provided, and We only use these Cookies to provide You with those services.<br><br> ● <b>Functionality Cookies</b><br>Type: Persistent Cookies<br>Administered by: Us<br>Purpose: These Cookies allow us to remember choices You make when You use the Website, such as remembering your login details or language preference. The purpose of these Cookies is to provide You with a more personal experience and to avoid You having to re-enter your preferences every time You use the Website.",
2638

2739
"choices-nav-menu-title": "Choices",
2840
"choices-label": "Your Choices Regarding Cookies",

0 commit comments

Comments
 (0)