Skip to content

Commit 18b1cad

Browse files
authored
Merge pull request #339 from Gothsec/update
Improve Custom LogoWall and add self-hosted font with preload
2 parents 852f920 + 15bdf15 commit 18b1cad

4 files changed

Lines changed: 37 additions & 21 deletions

File tree

69 KB
Binary file not shown.
37.1 KB
Binary file not shown.

src/components/logoWall.astro

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,26 @@ const technologies = [
1818
---
1919

2020
<div class="relative overflow-x-hidden py-8">
21-
<div
22-
class="pointer-events-none absolute inset-y-0 left-0 w-32 bg-gradient-to-r from-[var(--background)] to-transparent z-20"
23-
>
24-
</div>
25-
<div
26-
class="pointer-events-none absolute inset-y-0 right-0 w-32 bg-gradient-to-l from-[var(--background)] to-transparent z-20"
27-
>
28-
</div>
21+
<div class="pointer-events-none absolute inset-y-0 left-0 w-32 bg-gradient-to-r from-[var(--background)] to-transparent z-20"></div>
22+
<div class="pointer-events-none absolute inset-y-0 right-0 w-32 bg-gradient-to-l from-[var(--background)] to-transparent z-20"></div>
2923

30-
<div class="flex animate-scroll hover:animate-paused gap-12 md:gap-20 w-max">
24+
<div class="flex animate-scroll w-max will-change-transform">
3125
{
32-
[...technologies, ...technologies, ...technologies].map((tech) => (
33-
<div class="flex items-center gap-2 group transition-all duration-300">
26+
[...technologies, ...technologies].map((tech, index) => (
27+
<div
28+
class="flex items-center gap-2 pr-12 md:pr-20 group transition-all duration-300"
29+
aria-hidden={index >= technologies.length ? "true" : "false"}
30+
>
3431
<img
3532
src={`/svg/${tech}.svg`}
3633
alt={tech}
3734
class="h-7 w-auto object-contain transition-transform group-hover:scale-110 opacity-60"
3835
width="30"
3936
height="30"
40-
loading="lazy"
37+
loading={index < technologies.length ? "eager" : "lazy"}
38+
decoding="async"
4139
/>
42-
<span class="text-lg font-medium text-[var(--white-icon)]">
40+
<span class="text-lg font-medium text-[var(--white-icon)] whitespace-nowrap">
4341
{tech.charAt(0).toUpperCase() + tech.slice(1)}
4442
</span>
4543
</div>
@@ -50,11 +48,11 @@ const technologies = [
5048

5149
<style is:global>
5250
@keyframes scroll {
53-
from {
54-
transform: translateX(0);
51+
0% {
52+
transform: translate3d(0, 0, 0);
5553
}
56-
to {
57-
transform: translateX(-50%);
54+
100% {
55+
transform: translate3d(-50%, 0, 0);
5856
}
5957
}
6058
.animate-scroll {
@@ -66,4 +64,4 @@ const technologies = [
6664
animation-duration: 50s;
6765
}
6866
}
69-
</style>
67+
</style>

src/layouts/Layout.astro

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
---
2-
import '@fontsource-variable/montserrat';
3-
42
interface Props {
53
title: string;
64
}
@@ -15,9 +13,21 @@ const { title } = Astro.props;
1513
<meta name="description" content="Software Developer" />
1614
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
1715
<link rel="icon" type="image/png" href="/favicon.png" />
16+
17+
<link
18+
rel="preload"
19+
href="/fonts/montserrat-latin-wght-normal.woff2"
20+
as="font"
21+
type="font/woff2"
22+
crossorigin="anonymous"
23+
/>
24+
1825
<meta property="og:title" content="Oscar Hernandez" />
1926
<meta property="og:description" content="Software Developer" />
20-
<meta property="og:image" content="https://oscarhernandez.vercel.app/og.image.png" />
27+
<meta
28+
property="og:image"
29+
content="https://oscarhernandez.vercel.app/og.image.png"
30+
/>
2131
<meta property="og:url" content="https://oscarhernandez.vercel.app" />
2232
<meta property="og:type" content="website" />
2333
<meta property="og:site_name" content="Oscar Hernandez Portfolio" />
@@ -30,6 +40,14 @@ const { title } = Astro.props;
3040
</html>
3141

3242
<style is:global>
43+
@font-face {
44+
font-family: "Montserrat Variable";
45+
src: url("/fonts/montserrat-latin-wght-normal.woff2")
46+
format("woff2-variations");
47+
font-weight: 100 900;
48+
font-style: normal;
49+
font-display: swap;
50+
}
3351

3452
:root {
3553
--background: #101010;

0 commit comments

Comments
 (0)