Skip to content

Commit e1e80f9

Browse files
authored
Merge pull request #595 from Alt-Org/juhaj77/bug/585-enhancement-site-wide-uiux-improvements-continues
Juhaj77/bug/585 enhancement site wide uiux improvements continues
2 parents 80d95a8 + 10954f4 commit e1e80f9

File tree

27 files changed

+302
-118
lines changed

27 files changed

+302
-118
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { redirect } from 'next/navigation';
2+
import { getRouteAllMusicCollectionsPage } from '@/shared/appLinks/RoutePaths';
3+
4+
export default function Page({ params }: { params: { lng: string; collection: string } }) {
5+
redirect(`/${params.lng}${getRouteAllMusicCollectionsPage()}`);
6+
}
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
import { ReactNode } from 'react';
2-
import { ScrollTop } from '@/features/ScrollTop';
32
import { FurnitureLayout } from '@/preparedPages/FurniturePages';
43

54
type Props = {
65
children: ReactNode;
76
};
87

98
export default function Layout({ children }: Props) {
10-
return (
11-
<FurnitureLayout>
12-
{children}
13-
<ScrollTop />
14-
</FurnitureLayout>
15-
);
9+
return <FurnitureLayout>{children}</FurnitureLayout>;
1610
}

frontend-next-migration/src/app/[lng]/(helper)/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ReactNode } from 'react';
22
import { Footer } from '@/widgets/Footer';
33
import { Navbar } from '@/widgets/Navbar';
4+
import { ScrollTop } from '@/features/ScrollTop';
45
import LayoutDefault from '../../../preparedPages/Layouts/ui/LayoutDefault/LayoutDefault';
56

67
type Props = {
@@ -15,6 +16,7 @@ export default function HelperLayout({ children }: Props) {
1516
<div style={{ flex: 1 }}>
1617
<LayoutDefault>{children}</LayoutDefault>
1718
</div>
19+
<ScrollTop />
1820
<Footer />
1921
</div>
2022
);

frontend-next-migration/src/app/[lng]/(home)/_getPage.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export async function _getPage(lng: string) {
8080
href: getRouteAllHeroesPage(),
8181
},
8282
},
83-
gallery: {
83+
altZone: {
8484
title: t('project-description-title'),
8585
infoText: t('project-description-text'),
8686
socialsText: t('socials-text'),
@@ -97,23 +97,6 @@ export async function _getPage(lng: string) {
9797
videoLink: AppExternalLinks.previewVideoYoutube,
9898
gameImg: iPhone16.src,
9999
},
100-
galleryCopy: {
101-
title: t('project-description-title'),
102-
infoText: t('project-description-text'),
103-
socialsText: t('socials-text'),
104-
followUsText: t('follow-us-text'),
105-
seeMoreLink: {
106-
text: t('gallery-seeMore'),
107-
href: getRouteAboutPage(),
108-
},
109-
socialMediaLinks: [
110-
AppExternalLinks.igPost1,
111-
AppExternalLinks.igPost2,
112-
AppExternalLinks.fbPost1,
113-
],
114-
videoLink: AppExternalLinks.previewVideoYoutube,
115-
gameImg: gameImg.src,
116-
},
117100
contactSection: {
118101
title: t('contact-title'),
119102
googlePLayLink: AppExternalLinks.duunitori,

frontend-next-migration/src/app/[lng]/(home)/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export default function HomeLayout({ children }: Props) {
1414
<div style={{ display: 'flex', flexDirection: 'column', minHeight: '100vh' }}>
1515
<Navbar />
1616
<div className={cls.joinUsLayout}>{children}</div>
17-
<Footer />
1817
<ScrollTop />
18+
<Footer />
1919
</div>
2020
);
2121
}

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@
2727
@media (max-width: 457px) {
2828
height: 150px;
2929
}
30+
@media (max-width: 368px) {
31+
height: 180px;
32+
}
33+
@media (max-width: 357px) {
34+
height: 210px;
35+
}
36+
@media (max-width: 315px) {
37+
height: 240px;
38+
}
3039
}
3140
}
3241

frontend-next-migration/src/features/ScrollTop/ui/v2/ScrollTop.module.scss

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,19 @@
1111
border: var(--border-desktop) solid var(--black);
1212
border-radius: var(--border-radius-custom);
1313
background-color: var(--primary-color);
14-
z-index: 10;
14+
/* no high z-index by default so it won't overlay inputs */
1515
cursor: pointer;
1616
padding: 0.75rem;
1717
box-shadow: var(--s);
1818

19-
position: fixed;
20-
bottom: 100px;
21-
right: 24px;
19+
/* Make the button participate in normal flow and stick near viewport bottom */
20+
position: sticky;
21+
bottom: calc(180px + var(--cookie-consent-offset, 0px)); /* default (mobile/tablet) + cookie bar height */
22+
align-self: flex-end; /* place to the right in flex containers */
23+
margin-right: 28px; /* right gap */
24+
display: inline-flex; /* shrink to content width */
25+
float: right; /* align right when not inside a flex container */
26+
2227

2328
opacity: 0;
2429
visibility: hidden;
@@ -52,16 +57,21 @@
5257
outline-offset: 2px;
5358
}
5459

60+
/* Mobile tweaks */
5561
@media (max-width: breakpoint(lg)) {
56-
right: 24px;
57-
bottom: 100px;
5862
border-width: var(--border-mobile);
5963
border-radius: var(--border-radius-custom);
6064
box-shadow: var(--s);
6165
transform: none; // Mobile safety
66+
margin-right: 25px;
6267
}
6368
}
6469

70+
/* Raise just above the cookie bar only while it is visible */
71+
:root.cookie-consent-visible .ScrollTop {
72+
z-index: 1001; /* Cookie bar uses z-index:1000 */
73+
}
74+
6575
.ScrollTop > img {
6676
width: 32px;
6777
height: 32px;

frontend-next-migration/src/features/ScrollTop/ui/v2/ScrollTop.tsx

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,82 @@ export const ScrollTop = memo(({ className = '' }: ScrollTopProps) => {
2828
}
2929
}, [currentYPosition]);
3030

31+
useEffect(() => {
32+
// Keep ScrollTop above minimized CookieConsent: set CSS var to bar height
33+
const root = document.documentElement;
34+
const CSS_VAR = '--cookie-consent-offset';
35+
36+
const getBar = (): HTMLElement | null => {
37+
// Match CookieConsent V2/V3 wrappers using CSS Modules generated class names
38+
return document.querySelector('[class*="cookieConsentV2"]') as HTMLElement | null;
39+
};
40+
41+
const ROOT_VISIBLE_CLASS = 'cookie-consent-visible';
42+
const updateOffset = (bar: HTMLElement | null) => {
43+
let height = 0;
44+
if (bar) {
45+
const rect = bar.getBoundingClientRect();
46+
const style = window.getComputedStyle(bar);
47+
const isVisible =
48+
style.display !== 'none' &&
49+
style.visibility !== 'hidden' &&
50+
rect.height > 0 &&
51+
rect.width > 0;
52+
height = isVisible ? Math.round(rect.height) : 0;
53+
}
54+
55+
root.style.setProperty(CSS_VAR, `${height - 80}px`);
56+
// Toggle a helper class so we can raise z-index only while bar is present
57+
if (height > 0) {
58+
root.classList.add(ROOT_VISIBLE_CLASS);
59+
root.style.setProperty(CSS_VAR, `${height - 150}px`);
60+
} else {
61+
root.classList.remove(ROOT_VISIBLE_CLASS);
62+
}
63+
};
64+
65+
let resizeObs: ResizeObserver | null = null;
66+
let mutationObs: MutationObserver | null = null;
67+
68+
const setup = () => {
69+
const bar = getBar();
70+
updateOffset(bar);
71+
if (bar && 'ResizeObserver' in window) {
72+
resizeObs = new ResizeObserver(() => updateOffset(bar));
73+
resizeObs.observe(bar);
74+
}
75+
};
76+
77+
setup();
78+
79+
// Watch for bar mount/unmount or class changes (minimized/full)
80+
mutationObs = new MutationObserver(() => {
81+
const bar = getBar();
82+
updateOffset(bar);
83+
if (bar && resizeObs && (resizeObs as any)._observed !== bar) {
84+
// Reconnect observer in case element changed
85+
resizeObs.disconnect();
86+
resizeObs.observe(bar);
87+
}
88+
});
89+
mutationObs.observe(document.body, {
90+
childList: true,
91+
subtree: true,
92+
attributes: true,
93+
attributeFilter: ['class', 'style'],
94+
});
95+
96+
// Fallback: periodic poll to be extra safe on older browsers
97+
const pollId = window.setInterval(() => updateOffset(getBar()), 1500);
98+
99+
return () => {
100+
root.style.removeProperty(CSS_VAR);
101+
if (resizeObs) resizeObs.disconnect();
102+
if (mutationObs) mutationObs.disconnect();
103+
window.clearInterval(pollId);
104+
};
105+
}, []);
106+
31107
return (
32108
<button
33109
data-testid="scroll-to-top-btn"

frontend-next-migration/src/preparedPages/AboutPage/ui/About.module.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
overflow: hidden;
119119
outline: 4px solid var(--black);
120120
box-shadow: 6px 6px #121212;
121-
margin: 0 0 var(--spacing-400) 0;
121+
margin: -16px 0 var(--spacing-400) 0;
122122

123123
@media (max-width: breakpoint(sm)) {
124124
max-width: none;
@@ -137,6 +137,7 @@
137137
font: var(--font-sw-xl);
138138
color: var(--primary-color);
139139
padding-bottom: var(--spacing-sm);
140+
margin-bottom: 16px;
140141
padding-top: var(--spacing-sm);
141142

142143
@media (max-width: breakpoint(sm)) {
@@ -164,15 +165,15 @@
164165
}
165166

166167
.sValues {
167-
font-family: var(--font-family-title);
168-
font-size: var(--font-size-m);
168+
font: var(font-sw-xl);
169169
text-align: center;
170170
padding: 1%;
171171
}
172172
.yearh1 {
173173
font: var(--font-sw-xl);
174174
color: var(--primary-color);
175175
text-align: left;
176+
margin-top: -16px;
176177

177178
@media (max-width: breakpoint(sm)) {
178179
text-align: left;
@@ -188,6 +189,7 @@
188189

189190
@media (max-width: breakpoint(lg)) {
190191
font: var(--font-sw-l);
192+
margin-top: -12px;
191193
}
192194
}
193195

frontend-next-migration/src/preparedPages/MainPage/ui/MainPage.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
} from '@/shared/ui/v2/DescriptionCardMobile';
88
import defenceGalleryMobile from '@/shared/assets/images/descriptionCard/defense_gallery_mobile.png';
99
import useSizes from '@/shared/lib/hooks/useSizes';
10-
import { Gallery, GalleryProps } from './_components/sections/Gallery';
10+
import { AltZone, AltZoneProps } from './_components/sections/AltZone';
1111
import { GetToKnowComicsProps } from './_components/sections/GetToKnowComics';
1212
import { PlayWithUs, PlayWithUsProps } from './_components/sections/PlayWithUs';
1313
import { NewsCard } from '@/widgets/NewsCard';
@@ -32,8 +32,7 @@ export type Props = {
3232
playWithUs: PlayWithUsProps;
3333
getToKnowComics: GetToKnowComicsProps;
3434
videoAndGalleries: VideoAndGalleriesProps;
35-
gallery: GalleryProps;
36-
galleryCopy: GalleryProps;
35+
altZone: AltZoneProps;
3736
contactSection: ContactSectionProps;
3837
};
3938

@@ -43,7 +42,7 @@ function MainPage(props: Props) {
4342
playWithUs,
4443
// getToKnowComics,
4544
// classifiedHeroesBlocks,
46-
gallery,
45+
altZone,
4746
contactSection,
4847
} = props;
4948

@@ -149,7 +148,7 @@ function MainPage(props: Props) {
149148
</DescriptionCard>
150149
</div>
151150
)}
152-
<Gallery {...gallery} />
151+
<AltZone {...altZone} />
153152
<div className={cls.newsSection}>
154153
<h2 className={cls.newsHeader}>{t('newsSection-title')}</h2>
155154
<div className={cls.newsGrid}>
@@ -181,8 +180,6 @@ function MainPage(props: Props) {
181180
</div>
182181
<ContactSection {...contactSection} />
183182

184-
{/*<Gallery {...galleryCopy} />*/}
185-
186183
{/*<HorizontalLines />*/}
187184
{/*<SectionRanking*/}
188185
{/* rankingPlayerText={t('ranking-player')}*/}

0 commit comments

Comments
 (0)