Skip to content

Commit e465663

Browse files
committed
feat: [#91] content structure for the home page
1 parent e5c4619 commit e465663

File tree

11 files changed

+100
-60
lines changed

11 files changed

+100
-60
lines changed
File renamed without changes.
File renamed without changes.
6.56 MB
Loading

src/content/home/index.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import {HomePageContentStructure} from "../../views";
2+
3+
import HOOK_VIDEO_WEBM from './assets/cd-labs-home-page-hook-animation.webm';
4+
import HOOK_VIDEO_MP4 from './assets/cd-labs-home-page-hook-animation.mp4';
5+
6+
import PHILOSOPHY_BG from './assets/philosophy-background-temp.png';
7+
8+
export const homePageContent: HomePageContentStructure = {
9+
hookHeading: "When was the last time you <span class='highlight'>finished</span> a game?",
10+
hookBody: "CD-Labs’ initiative is to design <b>complete</b> gaming experiences for <b>busy lives</b>.",
11+
hookVideoWebm: HOOK_VIDEO_WEBM,
12+
hookVideoMp4: HOOK_VIDEO_MP4,
13+
14+
philosophy: {
15+
sectionBG: PHILOSOPHY_BG,
16+
header: "Games that respect <span class='highlight'>your time.</span>",
17+
paragraphs: [
18+
"I believe gaming should be an escape, not a second job. But as games have gotten bigger and more demanding, it's become harder to find the time to even finish one.",
19+
"That's why I started cd-labs. My goal is to deliver compact, complete gaming experiences that honor your schedule. Each game is a focused, handcrafted quest meant to be enjoyed in a single sitting or over a few evenings.",
20+
]
21+
}
22+
}

src/views/home.ts renamed to src/views/home/index.ts

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
import {arrowButton, createVideoBackground, createWrapper, writeParagraph, writeTitle} from "./utils";
1+
import './styles.css';
2+
import {arrowButton, createVideoBackground, createWrapper, writeParagraph, writeTitle} from "../utils";
3+
import {homePageContent} from "../../content/home";
24

3-
export type HomePageContent = {
4-
readonly title: string;
5-
readonly introText: string;
5+
export type HomePageContentStructure = {
6+
readonly hookHeading: string;
7+
readonly hookBody: string;
8+
readonly hookVideoWebm: string;
9+
readonly hookVideoMp4: string;
10+
11+
readonly philosophy: SectionContent;
12+
}
13+
14+
export type SectionContent = {
15+
readonly sectionBG: string;
16+
readonly header: string;
17+
readonly paragraphs: string[];
618
}
719

820
// --------------------------------------------------------------------------------
@@ -21,11 +33,11 @@ export function homeView() {
2133

2234
function hookSection() {
2335
const hook = document.createElement('section');
24-
const videoBg = createVideoBackground();
36+
const videoBg = createVideoBackground(homePageContent.hookVideoWebm, homePageContent.hookVideoMp4);
2537
const wrapper = createWrapper();
2638
const article = document.createElement('article');
27-
const hookTitle = writeTitle("h1", "When was the last time you <span class='highlight'>finished</span> a game?");
28-
const hookText = writeParagraph("CD-Labs’ initiative is to design <b>complete</b> gaming experiences for <b>busy lives</b>.");
39+
const hookTitle = writeTitle("h1", homePageContent.hookHeading);
40+
const hookText = writeParagraph(homePageContent.hookBody);
2941
const arrowDownBtn = arrowButton();
3042

3143
hook.className = 'hook';
@@ -46,15 +58,17 @@ function philosophySection() {
4658
const section = document.createElement('section');
4759
const wrapper = createWrapper();
4860
const article = document.createElement('article');
49-
const title = writeTitle("h2", "Games that respect your time.");
50-
const text_a = writeParagraph("I believe gaming should be an escape, not a second job. But as games have gotten bigger and more demanding, it's become harder to find the time to even finish one.");
51-
const text_b = writeParagraph("That's why I started cd-labs. My goal is to deliver compact, complete gaming experiences that honor your schedule. Each game is a focused, handcrafted quest meant to be enjoyed in a single sitting or over a few evenings.");
61+
const title = writeTitle("h2", homePageContent.philosophy.header);
5262

5363
section.className = 'philosophy';
54-
64+
section.style.backgroundImage = `url('${homePageContent.philosophy.sectionBG}')`;
5565
article.appendChild(title);
56-
article.appendChild(text_a);
57-
article.appendChild(text_b);
66+
67+
homePageContent.philosophy.paragraphs.forEach(paragraph => {
68+
const p = writeParagraph(paragraph);
69+
article.appendChild(p);
70+
})
71+
5872
wrapper.appendChild(article);
5973
section.appendChild(wrapper);
6074

src/views/home/styles.css

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#home-page {
2+
3+
section {
4+
width: 100%;
5+
min-height: 100vh;
6+
height: 100vh;
7+
margin: 0;
8+
padding: 0;
9+
box-sizing: border-box;
10+
}
11+
12+
.hook {
13+
h1, p {
14+
text-shadow: 0 4px 55px rgba(0, 0, 0, 0.65);
15+
max-width: 1160px;
16+
17+
.highlight {
18+
text-decoration: underline;
19+
text-decoration-color: #3BFFC5;
20+
text-underline-offset: 20px;
21+
}
22+
}
23+
24+
article {
25+
margin: 0 15%;
26+
display: flex;
27+
text-align: center;
28+
flex-direction: column; /* Stack children vertically */
29+
justify-content: center;
30+
align-items: center;
31+
height: 100vh;
32+
33+
.hook-text {
34+
margin-top: 75px;
35+
margin-bottom: 20px;
36+
max-width: 630px;
37+
}
38+
}
39+
}
40+
41+
.philosophy {
42+
article {
43+
44+
}
45+
46+
}
47+
}

src/views/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import "./styles.css";
22

3-
export * from "./home";
3+
export * from "./home/";
44
export * from "./projectCollection.ts";
55
export * from "./project.ts";
66
export * from "./about.ts";

src/views/styles.css

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,6 @@
77
width: 95%;
88
margin: 0 auto;
99
}
10-
11-
#home-page {
12-
13-
section {
14-
width: 100%;
15-
min-height: 100vh;
16-
height: 100vh;
17-
margin: 0;
18-
padding: 0;
19-
box-sizing: border-box;
20-
}
21-
22-
.hook {
23-
h1, p {
24-
text-shadow: 0 4px 55px rgba(0, 0, 0, 0.65);
25-
max-width: 1160px;
26-
27-
.highlight {
28-
text-decoration: underline;
29-
text-decoration-color: #3BFFC5;
30-
text-underline-offset: 20px;
31-
}
32-
}
33-
34-
article {
35-
margin: 0 15%;
36-
display: flex;
37-
text-align: center;
38-
flex-direction: column; /* Stack children vertically */
39-
justify-content: center;
40-
align-items: center;
41-
height: 100vh;
42-
43-
.hook-text {
44-
margin-top: 75px;
45-
margin-bottom: 20px;
46-
max-width: 630px;
47-
}
48-
}
49-
}
50-
}
5110
}
5211

5312
#view-box {

src/views/utils/assets/cd-anim.mp4

-64.5 MB
Binary file not shown.
-15 MB
Binary file not shown.

0 commit comments

Comments
 (0)