Skip to content

Commit ab1e5c0

Browse files
authored
Merge pull request #584 from Alt-Org/salimsara/enhancement/556-complete-gameart-page-redesign-2-2
Salimsara/enhancement/556 complete gameart page redesign
2 parents a884578 + f0144fd commit ab1e5c0

File tree

10 files changed

+157
-10
lines changed

10 files changed

+157
-10
lines changed

frontend-next-migration/src/features/NavigateGameArt/ui/GameArtNavMenuAsDropdown.module.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
padding-top: var(--spacing-800);
55

66
@media (max-width: breakpoint(lg)) {
7-
min-width: 320px;
7+
min-width: 290px;
8+
padding-top: 0;
89
}
910
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
.Title {
22
padding-left: 5%;
33
margin-bottom: 25px;
4+
5+
@media (max-width: breakpoint(lg)) {
6+
margin-bottom: -30px;
7+
}
48
}

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

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
'use client';
22
import cls from './GameArtPage.module.scss';
33
import { LayoutWithSidebars } from '@/preparedPages/Layouts';
4-
import WikiContent from '@/shared/ui/WikiContent/ui/WikiContent';
4+
import { ModularCard, ModularCardTheme } from '@/shared/ui/v2/ModularCard';
55
import GameArtNavMenu from '@/features/NavigateGameArt';
66
import { PageTitle } from '@/shared/ui/PageTitle';
77
import { Container } from '@/shared/ui/Container';
8+
import useSizes from '@/shared/lib/hooks/useSizes';
89

910
interface Section {
1011
id: string;
@@ -23,22 +24,66 @@ export type Props = {
2324

2425
const GameArtPackagePage = (props: Props) => {
2526
const { sections = [], title } = props;
27+
const { isMobileSize, isTabletSize } = useSizes();
2628

2729
return (
2830
<main>
29-
<LayoutWithSidebars
30-
leftTopSidebar={{
31-
component: <GameArtNavMenu sections={sections} />,
32-
hideOnMobile: true,
33-
}}
34-
>
31+
{(isTabletSize || isMobileSize) && (
3532
<Container className={cls.Title}>
3633
<PageTitle
3734
titleText={title}
3835
alternate={true}
3936
/>
4037
</Container>
41-
<WikiContent sections={sections} />
38+
)}
39+
40+
<LayoutWithSidebars
41+
leftTopSidebar={{
42+
component: <GameArtNavMenu sections={sections} />,
43+
hideOnMobile: false,
44+
}}
45+
>
46+
{!isTabletSize && !isMobileSize && (
47+
<Container className={cls.Title}>
48+
<PageTitle
49+
titleText={title}
50+
alternate={true}
51+
/>
52+
</Container>
53+
)}
54+
55+
<div className={cls.SectionGrid}>
56+
{sections.map((section) => (
57+
<ModularCard
58+
key={section.id}
59+
id={section.id}
60+
theme={ModularCardTheme.SECTIONCARD}
61+
className={cls.SectionCard}
62+
>
63+
<ModularCard.Texts>
64+
<ModularCard.Texts.Title>{section.label}</ModularCard.Texts.Title>
65+
<ModularCard.Texts.Body>
66+
<div
67+
dangerouslySetInnerHTML={{
68+
__html: section.description,
69+
}}
70+
/>
71+
</ModularCard.Texts.Body>
72+
</ModularCard.Texts>
73+
74+
{section.image && (
75+
<ModularCard.Image className={cls.SectionCardImage}>
76+
<ModularCard.Image.Image
77+
src={section.image}
78+
alt={section.imageAlt}
79+
width={600}
80+
height={400}
81+
/>
82+
</ModularCard.Image>
83+
)}
84+
</ModularCard>
85+
))}
86+
</div>
4287
</LayoutWithSidebars>
4388
</main>
4489
);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

frontend-next-migration/src/shared/ui/v2/ModularCard/ui/ModularCard.module.scss

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,95 @@
345345
}
346346
}
347347

348+
// SectionCard
349+
.Card.SectionCard {
350+
position: relative;
351+
display: flex;
352+
background-color: var(--background);
353+
border: var(--border-desktop) solid var(--black);
354+
border-radius: var(--border-radius-md);
355+
box-shadow: 4px 8px 0 var(--black);
356+
overflow: hidden;
357+
margin-left: 50px;
358+
margin-bottom: 50px;
359+
margin-right: 20px;
360+
361+
@media (max-width: breakpoint(md)) {
362+
flex-direction: column;
363+
margin: 0;
364+
margin-bottom: 30px;
365+
}
366+
367+
}
368+
369+
.Card.SectionCard > .ModularCardTexts {
370+
flex-basis: 95%;
371+
display: flex;
372+
flex-direction: column;
373+
z-index: 2;
374+
gap: 10px;
375+
padding: 20px;
376+
justify-content: flex-start;
377+
}
378+
379+
.Card.SectionCard > .ModularCardTexts > .ModularCardTitle {
380+
display: -webkit-box;
381+
-webkit-box-orient: vertical;
382+
overflow: hidden;
383+
padding-bottom: 10px;
384+
h2 {
385+
font: var(--font-sw-xxl);
386+
color: var(--primary-color);
387+
}
388+
@media (max-width: breakpoint(md)) {
389+
h2 {
390+
font: var(--font-sw-xl);
391+
}
392+
}
393+
}
394+
.Card.SectionCard > .ModularCardTexts > .ModularCardBody {
395+
font: var(--font-dm-m);
396+
overflow: hidden;
397+
display: -webkit-box;
398+
-webkit-box-orient: vertical;
399+
@media (max-width: breakpoint(md)) {
400+
font: var(--font-dm-m);
401+
}
402+
}
403+
404+
.Card.SectionCard > .ModularCardImageSection {
405+
height: auto;
406+
position: relative;
407+
overflow: visible;
408+
display: flex;
409+
justify-content: flex-end;
410+
align-items: stretch;
411+
clip-path: polygon(0 0, 100% 0, 100% 100%, 55% 100%);
412+
margin-left: -20px;
413+
414+
@media (max-width: breakpoint(md)) {
415+
height: auto;
416+
clip-path: polygon(0 50%, 100% 31%, 100% 100%, 0 100%);
417+
margin-top: -110px;
418+
}
419+
420+
@media ((min-width: breakpoint(sm)) and (max-width: breakpoint(md))) {
421+
height: auto;
422+
margin-top: -190px;
423+
}
424+
425+
}
426+
427+
.Card.SectionCard > .ModularCardImageSection > .ModularCardImage {
428+
position: relative;
429+
max-width: 100%;
430+
height: 100%;
431+
object-fit: cover;
432+
z-index: 0;
433+
434+
@media (max-width: breakpoint(md)) {
435+
height: auto;
436+
width: 100%;
437+
margin-top: 80px;
438+
}
439+
}

frontend-next-migration/src/shared/ui/v2/ModularCard/ui/ModularCard.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export enum ModularCardTheme {
2323
TITLEIMAGE = 'TitleImageCard',
2424
NEWSCARD = 'NewsImageCard',
2525
DEFENSECARD = 'DefenseCard',
26+
SECTIONCARD = 'SectionCard',
2627
}
2728

2829
/**
@@ -57,6 +58,8 @@ interface CardCompoundProps {
5758
interface ModularCardImageProps {
5859
className?: string;
5960
alt: string;
61+
width?: number;
62+
height?: number;
6063
src: StaticImageData | string;
6164
}
6265

@@ -200,13 +203,15 @@ ModularCardFootnote.displayName = 'modularcard-Texts-Footnote';
200203
* />
201204
*/
202205
const ModularCardImage = memo((props: ModularCardImageProps) => {
203-
const { className = '', alt, src } = props;
206+
const { className = '', alt, src, width, height } = props;
204207

205208
return (
206209
<Image
207210
className={classNames(cls.ModularCardImage, {}, [className])}
208211
src={src}
209212
alt={alt}
213+
width={width}
214+
height={height}
210215
/>
211216
);
212217
});

0 commit comments

Comments
 (0)