Skip to content

Commit ea7b35c

Browse files
committed
feat: hook section complete with new animation
1 parent cb8ed26 commit ea7b35c

File tree

8 files changed

+46
-11
lines changed

8 files changed

+46
-11
lines changed

src/components/logo/styles.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
}
1212

1313
p {
14+
margin-top: 9px;
1415
text-align: center;
1516
text-transform: uppercase;
1617
font-family: "Handjet", sans-serif;

src/components/top-nav/index.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
type NavLinkItem = [
2+
name: string,
3+
path: string,
4+
]
5+
6+
const navLinks: NavLinkItem[] = [
7+
['Side Quests', '/projects'],
8+
['About', '/about'],
9+
['Logs', '/logs'],
10+
['Contact', '/contact'],
11+
]
12+
13+
export function buildTopNav() {
14+
const navBox = document.createElement("div");
15+
const ul = document.createElement("ul");
16+
17+
18+
19+
20+
}

src/views/home.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ export function homeView() {
1414
page.appendChild(hookSection());
1515
page.appendChild(philosophySection());
1616

17-
18-
1917
return page;
2018
}
2119

@@ -26,8 +24,8 @@ function hookSection() {
2624
const videoBg = createVideoBackground();
2725
const wrapper = createWrapper();
2826
const article = document.createElement('article');
29-
const hookTitle = writeTitle("h1", "When was the last time you finished a game?");
30-
const hookText = writeParagraph("CD-Labs’ initiative is to design complete gaming experiences for busy lives.");
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>.");
3129
const arrowDownBtn = arrowButton();
3230

3331
hook.className = 'hook';

src/views/styles.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
.hook {
2323
h1, p {
2424
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+
}
2532
}
2633

2734
article {
14.4 MB
Binary file not shown.
5.97 MB
Binary file not shown.

src/views/utils/backgrounds-utils.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {BackgroundChoice, threeBackground} from "../../components/three-background";
2-
import HOME_VIDEO_WEBM from './assets/cd-anim.webm';
3-
import HOME_VIDEO_MP4 from './assets/cd-anim.mp4';
2+
import HOME_VIDEO_WEBM from './assets/cd-labs-home-page-hook-animation.webm';
3+
import HOME_VIDEO_MP4 from './assets/cd-labs-home-page-hook-animation.mp4';
44

55
export function createThreeBackground(choice: BackgroundChoice) {
66
const viewBox = document.getElementById('view-box')!;
@@ -17,11 +17,20 @@ export function createThreeBackground(choice: BackgroundChoice) {
1717
export function createVideoBackground() {
1818
const background = document.createElement('video');
1919
background.className = 'video-background';
20-
background.src = HOME_VIDEO_WEBM;
21-
background.src = HOME_VIDEO_MP4;
2220
background.autoplay = true;
2321
background.loop = true;
2422
background.muted = true;
2523

24+
const sourceWebm = document.createElement('source');
25+
sourceWebm.src = HOME_VIDEO_WEBM;
26+
sourceWebm.type = 'video/webm';
27+
28+
const sourceMp4 = document.createElement('source');
29+
sourceMp4.src = HOME_VIDEO_MP4;
30+
sourceMp4.type = 'video/mp4';
31+
32+
background.appendChild(sourceWebm);
33+
background.appendChild(sourceMp4);
34+
2635
return background;
2736
}

src/views/utils/text-utils.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
export function writeTitle(importance: string,text: string) {
88
const title = document.createElement(importance);
9-
title.textContent = text;
9+
title.innerHTML = text;
1010

1111
return title;
1212
}
1313

1414
export function writeParagraph(text: string) {
1515
const paragraph = document.createElement("p");
16-
paragraph.textContent = text;
16+
paragraph.innerHTML = text;
1717

1818
return paragraph;
1919
}
@@ -22,7 +22,7 @@ export function writeLink(text: string, href: string) {
2222
const link = document.createElement('a');
2323
link.className = "link";
2424
link.href = href;
25-
link.textContent = text;
25+
link.innerHTML = text;
2626
link.target = "_blank";
2727

2828
return link;

0 commit comments

Comments
 (0)