Skip to content

Commit 558c2f6

Browse files
fix: add custom font
1 parent 7af7527 commit 558c2f6

File tree

9 files changed

+58
-62
lines changed

9 files changed

+58
-62
lines changed

src/components/header.jsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
33
import { faAdjust, faVolumeMute, faVolumeUp, faSpinner } from "@fortawesome/free-solid-svg-icons"
44

55
import { useTheme } from "../context/theme"
6-
import { useAudio } from "../context/audio"
76

87
const Header = () => {
98
const { toggleDarkMode } = useTheme()
10-
const { start, stop, synth, fetching } = useAudio()
11-
const spinner = fetching && faSpinner
129

1310
return (
1411
<header>
@@ -18,19 +15,6 @@ const Header = () => {
1815
<div className="flex-1 flex items-center justify-end sm:items-stretch">
1916
<div className="block ml-8 text-gray-800 dark:text-gray-100 transition-none">
2017
<div className="flex space-x-4 sm:text-base md:text-lg text-sm">
21-
<button
22-
type="button"
23-
aria-label="audio volume"
24-
className="flex-grow focus:outline-none"
25-
onClick={() => (synth ? stop() : start())}
26-
>
27-
<FontAwesomeIcon
28-
icon={spinner || synth ? faVolumeUp : faVolumeMute}
29-
size="1x"
30-
alt="audio volume"
31-
/>
32-
</button>
33-
3418
<button
3519
type="button"
3620
aria-label="toggle theme"

src/components/layout.jsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from "react"
22
import styled from "astroturf/react"
33

44
import { ThemeProvider } from "../context/theme"
5-
import { AudioProvider } from "../context/audio"
65
import Header from "./header"
76

87
const Layout = ({ children }) => {
@@ -12,12 +11,10 @@ const Layout = ({ children }) => {
1211

1312
return (
1413
<ThemeProvider>
15-
<AudioProvider>
16-
<div className="flex flex-col h-screen bg-white dark:bg-black transition-none">
17-
<Header />
18-
<Content>{children}</Content>
19-
</div>
20-
</AudioProvider>
14+
<div className="flex flex-col h-screen bg-white dark:bg-black transition-none">
15+
<Header />
16+
<Content>{children}</Content>
17+
</div>
2118
</ThemeProvider>
2219
)
2320
}

src/pages/index.jsx

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,80 +3,74 @@ import styled from "astroturf/react"
33
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
44
import { faTwitter, faGithub, faLinkedin, faDiscord } from "@fortawesome/free-brands-svg-icons"
55

6-
import { useAudio } from "../context/audio"
7-
86
import Layout from "../components/layout"
97
import SEO from "../components/seo"
108

11-
const Greeting = styled.h1`
9+
const TitlePrefix = styled.span`
10+
${"@apply leading-normal font-title"};
11+
`
12+
const TitlePostfix = styled.span`
1213
background-clip: text;
1314
-webkit-text-fill-color: transparent;
14-
${"@apply leading-normal font-sans font-semibold text-black bg-black"};
15+
${"@apply leading-normal font-title-light text-black bg-black"};
1516
${"@apply bg-gradient-to-r from-purple-700 via-red-500 to-yellow-500"};
1617
`
1718

18-
const SocialIcons = () => {
19-
const { playNote } = useAudio()
20-
21-
return (
22-
<div className="flex font-normal leading-none align-middle text-center text-black dark:text-white sm:text-3xl md:text-5xl text-1xl transition-none">
23-
{/* }
19+
const SocialIcons = () => (
20+
<div className="flex font-normal leading-none align-middle text-center text-black dark:text-white sm:text-3xl md:text-5xl text-1xl transition-none">
21+
{/* }
2422
<a href="https://twitter.com/thejustinwalsh" className="flex-grow">
2523
<FontAwesomeIcon
2624
className="transform transition-transform duration-200 hover:scale-125"
2725
icon={faTwitter}
2826
size="1x"
2927
alt="twitter"
30-
onMouseEnter={() => playNote("C")}
3128
/>
3229
<span className="hidden">Twitter</span>
3330
</a>
3431
*/}
35-
<a href="https://github.com/tjw-dev" className="flex-grow">
36-
<FontAwesomeIcon
37-
className="transform transition-transform duration-200 hover:scale-125"
38-
icon={faGithub}
39-
size="1x"
40-
alt="github"
41-
onMouseEnter={() => playNote("D")}
42-
/>
43-
<span className="hidden">Github</span>
44-
</a>
45-
{/* }
32+
<a href="https://github.com/tjw-dev" className="flex-grow">
33+
<FontAwesomeIcon
34+
className="transform transition-transform duration-200 hover:scale-125"
35+
icon={faGithub}
36+
size="1x"
37+
alt="github"
38+
/>
39+
<span className="hidden">Github</span>
40+
</a>
41+
{/* }
4642
<a href="https://www.linkedin.com/in/justinwalsh/" className="flex-grow">
4743
<FontAwesomeIcon
4844
className="transform transition-transform duration-200 hover:scale-125"
4945
icon={faLinkedin}
5046
size="1x"
5147
alt="linkedin"
52-
onMouseEnter={() => playNote("E")}
5348
/>
5449
<span className="hidden">LinkedIn</span>
5550
</a>
5651
*/}
57-
<a href="https://discord.gg/SzxMh6GjS8" className="flex-grow">
58-
<FontAwesomeIcon
59-
className="transform transition-transform duration-200 hover:scale-125"
60-
icon={faDiscord}
61-
size="1x"
62-
alt="discord"
63-
onMouseEnter={() => playNote("G")}
64-
/>
65-
<span className="hidden">Discord</span>
66-
</a>
67-
</div>
68-
)
69-
}
52+
<a href="https://discord.gg/SzxMh6GjS8" className="flex-grow">
53+
<FontAwesomeIcon
54+
className="transform transition-transform duration-200 hover:scale-125"
55+
icon={faDiscord}
56+
size="1x"
57+
alt="discord"
58+
/>
59+
<span className="hidden">Discord</span>
60+
</a>
61+
</div>
62+
)
7063

7164
const IndexPage = () => (
7265
<Layout>
7366
<SEO title="Home" />
7467
<div className="container mx-auto h-full flex justify-center items-center">
7568
<div className="flex">
7669
<div className="px-6 text-left">
77-
<Greeting className="sm:text-7xl md:text-8xl text-4xl md:text-left text-center">
78-
tjw.DEV
79-
</Greeting>
70+
<h1 className="sm:text-7xl md:text-8xl text-4xl md:text-left text-center">
71+
<TitlePrefix className="text-black dark:text-white transition-none">tjw</TitlePrefix>
72+
<TitlePostfix>.dev</TitlePostfix>
73+
</h1>
8074
<SocialIcons />
8175
</div>
8276
</div>

src/styles/global.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,20 @@
22
@tailwind base;
33
@tailwind components;
44
@tailwind utilities;
5+
6+
/* ./src/styles/global.css */
7+
@font-face {
8+
font-family: "TJW Title";
9+
src: url("tjw-title.woff2") format("woff2"), url("tjw-title.woff") format("woff");
10+
font-weight: bold;
11+
font-style: normal;
12+
font-display: swap;
13+
}
14+
15+
@font-face {
16+
font-family: "TJW Title Light";
17+
src: url("tjw-title-light.woff2") format("woff2"), url("tjw-title-light.woff") format("woff");
18+
font-weight: 300;
19+
font-style: normal;
20+
font-display: swap;
21+
}

src/styles/tjw-title-light.woff

6.69 KB
Binary file not shown.

src/styles/tjw-title-light.woff2

5.05 KB
Binary file not shown.

src/styles/tjw-title.woff

6.59 KB
Binary file not shown.

src/styles/tjw-title.woff2

5.02 KB
Binary file not shown.

tailwind.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ module.exports = {
77
extend: {
88
animation: {},
99
keyframes: {},
10+
fontFamily: {
11+
title: ["'TJW Title', sans-serif"],
12+
"title-light": ["'TJW Title Light', sans-serif"],
13+
},
1014
},
1115
},
1216
variants: {

0 commit comments

Comments
 (0)