Skip to content

Commit 3bc8d32

Browse files
committed
small improvements
1 parent 8ba774d commit 3bc8d32

File tree

5 files changed

+35
-41
lines changed

5 files changed

+35
-41
lines changed

assets/index.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ svg:hover {
3232
}
3333

3434
:root {
35-
--bg: rgb(48, 96, 120);
35+
--bg: #206080;
3636
--dark: #0000000d;
3737
--duration: .25s;
38-
--header: rgb(16, 24, 32);
38+
--header: #0c141c;
3939
--key: #ffffff0d;
4040
--sub: #c0c0c0;
4141
--text: #ffffff;

components/Footer.js

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,50 +2,39 @@ import __JSX__, { render } from "../server/render.js";
22

33
import { SocialIcon } from "./Icon.js";
44

5-
const socials = [
6-
{
7-
icon: "discord",
8-
href: "https://discord.com/users/460612586061430806",
9-
h: "#5865F2",
10-
},
11-
{
12-
icon: "github",
13-
href: "https://github.com/apacheli",
14-
h: "#808080",
15-
},
16-
{
17-
icon: "steam",
18-
href: "https://steamcommunity.com/id/apacheli/",
19-
h: "#00adef",
20-
},
21-
{
22-
icon: "twitch",
23-
href: "https://www.twitch.tv/apachelitv",
24-
h: "#8d44f7",
25-
},
26-
{
27-
icon: "twitter",
28-
href: "https://twitter.com/apacheopteryx",
29-
h: "#24a3f1",
30-
},
31-
{
32-
icon: "youtube",
33-
href: "https://www.youtube.com/@apacheli",
34-
h: "#ff0000",
35-
},
36-
]
5+
const socials = [{
6+
name: "discord",
7+
h: "#5865F2",
8+
}, {
9+
name: "github",
10+
h: "#808080",
11+
}, {
12+
name: "steam",
13+
h: "#00adef",
14+
}, {
15+
name: "twitch",
16+
h: "#8d44f7",
17+
}, {
18+
name: "twitter",
19+
h: "#24a3f1",
20+
}, {
21+
name: "youtube",
22+
h: "#ff0000",
23+
}]
3724
.map((social) => (
3825
<li>
3926
<SocialIcon
40-
icon={social.icon}
27+
icon={social.name}
4128
h={social.h}
42-
href={social.href}
29+
href={`/${social.name}`}
4330
/>
4431
</li>
4532
));
4633

4734
const date = new Date();
48-
const d = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
35+
const year = date.getFullYear();
36+
const month = `${date.getMonth() + 1}`.padStart(2, "0");
37+
const day = `${date.getDate()}`.padStart(2, "0");
4938

5039
export default render(
5140
<footer class="main-ftr">
@@ -55,7 +44,7 @@ export default render(
5544
</ul>
5645
</nav>
5746
<span>
58-
Last updated on {`<strong>${d}</strong> `}
47+
Last deployed at {`<strong>${year}-${month}-${day}</strong> `}
5948
<a href="https://github.com/apacheli/apacheli.github.io">(Source)</a>
6049
</span>
6150
<span>

pages/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const description = "Web and Software Developer"
55

66
# Hello, I'm apacheli.
77

8-
I build really cool stuff.
8+
Hello, I'm apacheli, a web and software developer.
99

1010
> My website is still currently under development. Expect to see more stuff in
1111
> the future!

server/build.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const _buildHtml = async (file) => {
4747
};
4848

4949
const build = async ({ directories }) => {
50-
const p = performance.now();
50+
console.time("_build_");
5151
await Promise.all(directories.map((dir) => mkdir(`dist/${dir}`, _fs)));
5252
await cp("assets", "dist/assets", _fs);
5353
const promises = [];
@@ -58,7 +58,7 @@ const build = async ({ directories }) => {
5858
promises.push(_buildHtml(file));
5959
}
6060
await Promise.all(promises);
61-
console.log(`\x1b[36mDone. Took ${performance.now() - p} ms.\x1b[39m`);
61+
console.timeEnd("_build_");
6262
};
6363

6464
const normalize = (file) => file.replace(/\\/g, "/");
@@ -92,6 +92,7 @@ const _serveHtml = async (file, paths) => {
9292
};
9393

9494
async function serve() {
95+
console.time("_serve_");
9596
const paths = {};
9697

9798
const _files = [];
@@ -110,6 +111,7 @@ async function serve() {
110111
console.log(` ${k}`);
111112
}
112113
console.log("\n=> http://localhost:1337/\n");
114+
console.timeEnd("_serve_");
113115

114116
return Bun.serve({
115117
fetch: (request) => handleRequest(request, paths),

server/render.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export const render = (element) => {
3636
? `<code>${element.children[0]}</code>`
3737
: hljs.highlight(lang, element.children[0].slice(0, -1)).value;
3838
}
39+
if (element.type === "img") {
40+
element.attributes.loading = "lazy";
41+
}
3942
const c = element.children.reduce((a, b) => a + render(b), "");
4043
if (element.type === null) {
4144
return c;

0 commit comments

Comments
 (0)