mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 08:41:37 +00:00
add friends page
add friends!
This commit is contained in:
@ -1,5 +1,41 @@
|
||||
import avatarPoccur from 'assets/images/avatar-poccur.webp';
|
||||
import clsx from 'clsx';
|
||||
import FriendCard from 'components/pages/friends/friend-card';
|
||||
import { StaticImageData } from 'next/image';
|
||||
|
||||
export type Friend = {
|
||||
id: number;
|
||||
name: string;
|
||||
avatar: StaticImageData;
|
||||
link: string;
|
||||
desc: string;
|
||||
};
|
||||
|
||||
const friends = [
|
||||
{
|
||||
id: 0,
|
||||
name: 'Poccur',
|
||||
avatar: avatarPoccur,
|
||||
link: 'https://poccur.top',
|
||||
desc: '',
|
||||
},
|
||||
];
|
||||
|
||||
const Page = () => {
|
||||
return <>test</>;
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={clsx(
|
||||
'grid grid-cols-1 lg:grid-cols-3',
|
||||
'md:grid-cols-2 gap-5',
|
||||
)}
|
||||
>
|
||||
{friends.map((f) => (
|
||||
<FriendCard friend={f} key={f.id} />
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Page;
|
||||
|
BIN
assets/images/avatar-poccur.webp
Normal file
BIN
assets/images/avatar-poccur.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
37
components/pages/friends/friend-card.tsx
Normal file
37
components/pages/friends/friend-card.tsx
Normal file
@ -0,0 +1,37 @@
|
||||
import { Friend } from 'app/friends/page';
|
||||
import clsx from 'clsx';
|
||||
import Image from 'next/image';
|
||||
|
||||
const FriendCard = ({ friend }: { friend: Friend }) => {
|
||||
return (
|
||||
<a href={friend.link} target="_blank">
|
||||
<div
|
||||
className={clsx(
|
||||
'py-3 px-4 rounded-xl bg-slate-100',
|
||||
'hover:bg-slate-200',
|
||||
'transition-all duration-300',
|
||||
'flex items-center cursor-pointer',
|
||||
'justify-between dark:bg-rua-gray-800',
|
||||
'hover:dark:bg-rua-gray-700',
|
||||
'shadow-card',
|
||||
)}
|
||||
>
|
||||
<div>
|
||||
<h2 className={clsx('text-xl font-semibold')}>{friend.name}</h2>
|
||||
<div className="text-sm text-subtext0">{friend.link}</div>
|
||||
</div>
|
||||
<div className="overflow-hidden rounded-lg w-14 h-14">
|
||||
<Image
|
||||
src={friend.avatar}
|
||||
alt="avatar"
|
||||
width={56}
|
||||
height={56}
|
||||
objectFit="contain"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
);
|
||||
};
|
||||
|
||||
export default FriendCard;
|
@ -26,6 +26,7 @@ const ProjectCard = ({ project, icon }: ProjectCardProps) => {
|
||||
'flex items-center cursor-pointer',
|
||||
'justify-between dark:bg-rua-gray-800',
|
||||
'hover:dark:bg-rua-gray-700',
|
||||
'shadow-card',
|
||||
)}
|
||||
>
|
||||
{Icon ? Icon : <VscGithubInverted className="w-8 h-8" />}
|
||||
|
@ -146,7 +146,7 @@ pre {
|
||||
@apply p-4 rounded-lg;
|
||||
margin: 0.5em 0;
|
||||
overflow: auto;
|
||||
@apply bg-white dark:bg-rua-gray-800;
|
||||
@apply bg-white dark:bg-rua-gray-700;
|
||||
/* font-family: 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono',
|
||||
monospace; */
|
||||
direction: ltr;
|
||||
|
@ -38,6 +38,9 @@ module.exports = {
|
||||
outline: '0 0 0 3px rgba(83, 220, 246, 0.6)',
|
||||
underline: 'inset 0px -2px 0px 0px rgb(85 200 188 / 70%)',
|
||||
throughline: 'inset 0px -0.5em 0px 0px rgb(85 200 188 / 70%)',
|
||||
// card
|
||||
// l2
|
||||
card: '0px 10px 20px rgba(0, 0, 0, 0.04), 0px 2px 6px rgba(0, 0, 0, 0.04), 0px 0px 1px rgba(0, 0, 0, 0.04)',
|
||||
},
|
||||
backgroundImage: {
|
||||
underline: 'linear-gradient(rgb(240 240 240),rgb(240 240 240))',
|
||||
|
Reference in New Issue
Block a user