Skip to content

Commit a67bbe6

Browse files
committed
feat: [#92] game teaser section
1 parent fa03d08 commit a67bbe6

File tree

5 files changed

+47
-6
lines changed

5 files changed

+47
-6
lines changed

src/content/home/index.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,27 @@ export const homePageContent: HomePageContentStructure = {
2525
],
2626

2727
alignment: 'left'
28+
},
29+
30+
teaser: {
31+
sectionBG: PHILOSOPHY_BG,
32+
33+
introTitle: "The First Experience is Taking Shape",
34+
header: "Project <span class='highlight'>Aqua</span>",
35+
36+
paragraphs: [
37+
"Inspired by the frustrations of everyday bad design, Aqua places you in a sleek testing facility. Your mission: master a series of deceptively simple shower prototypes.",
38+
"In this fast-paced puzzler, can you solve one of design's most infuriating problems—the shower interface—and calibrate each prototype?",
39+
"<b>A sharp puzzle and a fresh perspective distilled into a single, focused game.</b"
40+
],
41+
42+
buttons: [
43+
{ text: "Whishlist on Steam", path: "#", styleType: "primary" },
44+
{ text: "Follow Development", path: "#", styleType: "secondary" }
45+
],
46+
47+
alignment: 'right'
2848
}
49+
50+
2951
}

src/views/home/contentSection.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {createWrapper, writeParagraph, writeTitle} from "../utils";
44

55
export type SectionContent = {
66
readonly sectionBG: string;
7+
readonly introTitle?: string;
78
readonly header: string;
89
readonly paragraphs: string[];
910
readonly buttons: MainButtonOptions[];
@@ -18,10 +19,14 @@ export function createContentSection(content: SectionContent) {
1819
const wrapper = createWrapper();
1920
const article = document.createElement('article');
2021

21-
section.className = 'content-section';
22+
section.className = `content-section ${content.alignment}`;
2223
section.style.backgroundImage = `url('${content.sectionBG}')`;
2324
section.appendChild(pixelGrid(content.alignment));
2425

26+
if (content.introTitle) {
27+
article.appendChild(introTitle(content.introTitle));
28+
}
29+
2530
article.appendChild(writeTitle("h2", content.header));
2631
article.appendChild(sectionParagraphs(content.paragraphs));
2732
article.appendChild(sectionButtons(content.buttons));
@@ -62,4 +67,11 @@ function sectionButtons(contentButtons: MainButtonOptions[]) {
6267
buttonsContainer.appendChild(button);
6368
});
6469
return buttonsContainer;
70+
}
71+
72+
function introTitle(text: string) {
73+
const intro = document.createElement('h3');
74+
intro.className = 'intro-title';
75+
intro.innerHTML = text;
76+
return intro;
6577
}

src/views/home/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export type HomePageContentStructure = {
1010
readonly hookVideoWebm: string;
1111
readonly hookVideoMp4: string;
1212
readonly philosophy: SectionContent;
13+
readonly teaser: SectionContent;
1314
}
1415

1516
// --------------------------------------------------------------------------------
@@ -20,6 +21,7 @@ export function homeView() {
2021

2122
page.appendChild(hookSection());
2223
page.appendChild(createContentSection(homePageContent.philosophy));
24+
page.appendChild(createContentSection(homePageContent.teaser));
2325

2426
return page;
2527
}

src/views/home/styles.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,19 @@
6666
position: relative;
6767
z-index: 2; /* Above the pixel grid */
6868
display: flex;
69-
width: 45%;
69+
width: 40%;
7070
flex-direction: column;
7171
justify-content: center;
7272
align-items: flex-start;
7373
height: 100vh;
7474
margin-left: 5%; /* Add some margin to position the content */
7575
}
7676

77+
&.right article {
78+
margin-left: auto;
79+
margin-right: 5%; /* Mirror the left margin */
80+
}
81+
7782
p {
7883
max-width: 60%;
7984
margin-bottom: 30px;

src/views/utils/styles.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ h1, h2 {
1313
}
1414

1515
h3 {
16-
font-family: "Handjet", serif;
17-
font-size: 2.8em;
18-
font-weight: 600;
19-
color: #828282;
16+
font-family: "Inter", sans-serif;
17+
font-size: 2em;
18+
font-weight: 700;
19+
color: #ffffff;
2020
}
2121

2222
h5 {

0 commit comments

Comments
 (0)