Skip to content

Commit 330f999

Browse files
committed
Add: Moonbeam 🚀
1 parent 4cab962 commit 330f999

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

components/BlurImage.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import clsx from "clsx";
2+
import Image from "next/image";
3+
import React, { useState } from "react";
4+
5+
export const BlurImage = ({ src, className, ...rest }) => {
6+
const [isLoading, setLoading] = useState(true);
7+
return (
8+
<Image
9+
className={clsx(
10+
"transition duration-500",
11+
isLoading ? "blur-sm scale-100" : " blur-0 scale-100",
12+
className
13+
)}
14+
onLoadingComplete={() => setLoading(false)}
15+
src={src}
16+
loading="lazy"
17+
decoding="async"
18+
blurDataURL={src}
19+
{...rest}
20+
/>
21+
);
22+
};

components/Header.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useEffect, useState } from "react";
22
import { motion, AnimatePresence } from "framer-motion";
33
import { LinkPreview } from "@/components/LinkPreview";
4+
import { BlurImage } from "./BlurImage";
45

56
const Header = () => {
67
const [open, setOpen] = useState(false);
@@ -38,11 +39,20 @@ const Header = () => {
3839
Building
3940
<LinkPreview
4041
className={
41-
"inline-block px-1 font-bold bg-clip-text text-transparent bg-gradient-to-r from-zinc-900 to-zinc-700 dark:from-zinc-300 dark:to-zinc-100"
42+
"inline-block px-2 py-0 font-bold bg-gray-100 dark:bg-zinc-700 dark:text-white rounded-md mx-1"
4243
}
4344
url="https://algochurn.com"
4445
>
4546
Algochurn
47+
</LinkPreview>{" "}
48+
|{" "}
49+
<LinkPreview
50+
className={
51+
"inline-block px-2 py-0 font-bold bg-gray-100 dark:bg-zinc-700 dark:text-white rounded-md mx-1"
52+
}
53+
url="https://gomoonbeam.com"
54+
>
55+
Moonbeam
4656
</LinkPreview>
4757
other
4858
<span
@@ -150,9 +160,14 @@ const Header = () => {
150160
<a
151161
href="https://twitter.com/mannupaaji"
152162
target="__blank"
153-
className="block relative z-[5] overflow-hidden rounded shadow-xl ring-1 ring-slate-900/5"
163+
className="block z-[5] overflow-hidden rounded shadow-xl ring-1 ring-slate-900/5 relative bg-white h-20 w-20"
154164
>
155-
<img className="h-auto w-[50px] md:w-[150px]" src="avatar-new.png" />
165+
<BlurImage
166+
objectFit="cover"
167+
layout="fill"
168+
className="bg-gray-100 object-contain"
169+
src="/avatar-new.png"
170+
/>
156171
</a>
157172
<div className="z-0">
158173
<div className="absolute left-0 -right-12 top-0 h-px bg-slate-900/[0.1] dark:bg-zinc-300/[0.1] [mask-image:linear-gradient(to_right,transparent,white_4rem,white_calc(100%-4rem),transparent)]"></div>

0 commit comments

Comments
 (0)