Skip to content

Commit cb8ed26

Browse files
committed
wip: hook section
1 parent 3cd0276 commit cb8ed26

File tree

14 files changed

+179
-63
lines changed

14 files changed

+179
-63
lines changed
768 Bytes
Loading

src/components/logo/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import './styles.css';
2+
import LOGO from './assets/cd-labs-logo.png';
3+
4+
export function buildMainLogo() {
5+
const logoContainer = document.createElement('div');
6+
const logoImg = document.createElement('img');
7+
const logoText = document.createElement('p');
8+
9+
logoContainer.className = 'main-logo';
10+
11+
logoImg.src = LOGO;
12+
logoImg.alt = "CD-Labs Logo";
13+
14+
logoText.textContent = "CD-Labs";
15+
16+
logoContainer.appendChild(logoImg);
17+
logoContainer.appendChild(logoText);
18+
19+
return logoContainer;
20+
}

src/components/logo/styles.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
.main-logo {
3+
position: fixed;
4+
top: 40px;
5+
left: 55px;
6+
7+
img {
8+
width: 95px;
9+
height: 95px;
10+
image-rendering: pixelated;
11+
}
12+
13+
p {
14+
text-align: center;
15+
text-transform: uppercase;
16+
font-family: "Handjet", sans-serif;
17+
font-size: 2em;
18+
font-weight: 900;
19+
}
20+
}

src/heads/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
66
<link rel="preconnect" href="https://fonts.googleapis.com">
77
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8-
<link href="https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400..700;1,400..700&family=Handjet:[email protected]&display=swap&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
8+
<link href="https://fonts.googleapis.com/css2?family=Handjet:[email protected]&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
99
`

src/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { buildMainLogo } from "./components/logo";
12
import { router } from "./core/router";
23
import {homeView, buildViewBase, renderView} from "./views";
34

@@ -13,8 +14,11 @@ routes.forEach(route => router.registerRoute(route.path, route.handler));
1314
function init() {
1415
const body = document.getElementsByTagName("body")[0];
1516
const contentPage = buildViewBase();
17+
const mainLogo = buildMainLogo();
1618

19+
body.appendChild(mainLogo);
1720
body.appendChild(contentPage);
21+
1822

1923
router.handleRoute(window.location.pathname);
2024
}

src/views/home.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {createWrapper, writeParagraph, writeTitle} from "./utils";
1+
import {arrowButton, createVideoBackground, createWrapper, writeParagraph, writeTitle} from "./utils";
22

33
export type HomePageContent = {
44
readonly title: string;
@@ -12,6 +12,7 @@ export function homeView() {
1212
page.id = 'home-page';
1313

1414
page.appendChild(hookSection());
15+
page.appendChild(philosophySection());
1516

1617

1718

@@ -22,11 +23,12 @@ export function homeView() {
2223

2324
function hookSection() {
2425
const hook = document.createElement('section');
26+
const videoBg = createVideoBackground();
2527
const wrapper = createWrapper();
2628
const article = document.createElement('article');
2729
const hookTitle = writeTitle("h1", "When was the last time you finished a game?");
2830
const hookText = writeParagraph("CD-Labs’ initiative is to design complete gaming experiences for busy lives.");
29-
const arrowDownBtn = document.createElement('button');
31+
const arrowDownBtn = arrowButton();
3032

3133
hook.className = 'hook';
3234
hookTitle.className = "hook-title";
@@ -36,10 +38,30 @@ function hookSection() {
3638
article.appendChild(hookText);
3739
article.appendChild(arrowDownBtn);
3840
wrapper.appendChild(article);
41+
hook.appendChild(videoBg);
3942
hook.appendChild(wrapper);
4043

4144
return hook;
4245
}
4346

47+
function philosophySection() {
48+
const section = document.createElement('section');
49+
const wrapper = createWrapper();
50+
const article = document.createElement('article');
51+
const title = writeTitle("h2", "Games that respect your time.");
52+
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.");
53+
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.");
54+
55+
section.className = 'philosophy';
56+
57+
article.appendChild(title);
58+
article.appendChild(text_a);
59+
article.appendChild(text_b);
60+
wrapper.appendChild(article);
61+
section.appendChild(wrapper);
62+
63+
return section;
64+
}
65+
4466

4567

src/views/styles.css

Lines changed: 5 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,4 @@
1-
body {
2-
background-color: black;
3-
margin: 0;
4-
}
5-
6-
h1, h2 {
7-
margin: 0;
8-
font-family: "Inter", sans-serif;
9-
font-size: 6em;
10-
line-height: 100%;
11-
color: white;
12-
}
13-
14-
h3 {
15-
font-family: "Handjet", serif;
16-
font-size: 2.8em;
17-
font-weight: 600;
18-
color: #828282;
19-
}
20-
21-
h5 {
22-
font-family: "Handjet", serif;
23-
font-size: 1.5em;
24-
font-weight: 600;
25-
text-transform: lowercase;
26-
color: #828282;
27-
}
28-
29-
h6 {
30-
margin: 0 0 20px 0;
31-
font-family: "Handjet", serif;
32-
font-size: 2em;
33-
font-weight: 600;
34-
text-transform: lowercase;
35-
color: #3BFFC5;
36-
}
37-
38-
p {
39-
font-size: 1.5em;
40-
font-weight: normal;
41-
color: white;
42-
line-height: 110%;
43-
margin: 0;
44-
}
45-
46-
p.intro-text {
47-
margin-bottom: 50px;
48-
}
49-
50-
p.description {
51-
font-family: "Cabin", sans-serif;
52-
color: #A1A1A1;
53-
font-size: 0.9em;
54-
}
55-
1+

562
#view {
573
height: 100%;
584
font-family: 'Inter', sans-serif;
@@ -65,7 +11,7 @@ p.description {
6511
#home-page {
6612

6713
section {
68-
width: 100vw;
14+
width: 100%;
6915
min-height: 100vh;
7016
height: 100vh;
7117
margin: 0;
@@ -74,6 +20,9 @@ p.description {
7420
}
7521

7622
.hook {
23+
h1, p {
24+
text-shadow: 0 4px 55px rgba(0, 0, 0, 0.65);
25+
}
7726

7827
article {
7928
margin: 0 15%;
@@ -91,8 +40,6 @@ p.description {
9140
}
9241
}
9342
}
94-
95-
9643
}
9744
}
9845

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

64.5 MB
Binary file not shown.
15 MB
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)