feat: style improvements

This commit is contained in:
saicaca 2023-11-03 15:59:14 +08:00
parent c642691dc8
commit 35f9260b58
7 changed files with 27 additions and 8 deletions

View File

@ -28,7 +28,8 @@ export default defineConfig({
include: { include: {
'material-symbols': ['*'], 'material-symbols': ['*'],
'fa6-brands': ['*'], 'fa6-brands': ['*'],
'fa6-regular': ['*'] 'fa6-regular': ['*'],
'fa6-solid': ['*']
} }
}) })
], ],

View File

@ -31,6 +31,7 @@
"@astrojs/ts-plugin": "^1.1.3", "@astrojs/ts-plugin": "^1.1.3",
"@iconify-json/fa6-brands": "^1.1.13", "@iconify-json/fa6-brands": "^1.1.13",
"@iconify-json/fa6-regular": "^1.1.13", "@iconify-json/fa6-regular": "^1.1.13",
"@iconify-json/fa6-solid": "^1.1.15",
"@iconify-json/material-symbols": "^1.1.59", "@iconify-json/material-symbols": "^1.1.59",
"@rollup/plugin-yaml": "^4.1.2", "@rollup/plugin-yaml": "^4.1.2",
"@tailwindcss/typography": "^0.5.10", "@tailwindcss/typography": "^0.5.10",

View File

@ -61,6 +61,9 @@ devDependencies:
'@iconify-json/fa6-regular': '@iconify-json/fa6-regular':
specifier: ^1.1.13 specifier: ^1.1.13
version: 1.1.13 version: 1.1.13
'@iconify-json/fa6-solid':
specifier: ^1.1.15
version: 1.1.15
'@iconify-json/material-symbols': '@iconify-json/material-symbols':
specifier: ^1.1.59 specifier: ^1.1.59
version: 1.1.59 version: 1.1.59
@ -990,6 +993,12 @@ packages:
'@iconify/types': 2.0.0 '@iconify/types': 2.0.0
dev: true dev: true
/@iconify-json/fa6-solid@1.1.15:
resolution: {integrity: sha512-RMiUSSdnxD4BLDW2QBskqr/+i1/6xhZK+E3sq24URnB3fSQUCWvyhNN3ZnU3RMjWaMVNxPy9pEXr1i/8s63GRQ==}
dependencies:
'@iconify/types': 2.0.0
dev: true
/@iconify-json/material-symbols@1.1.59: /@iconify-json/material-symbols@1.1.59:
resolution: {integrity: sha512-azzJVyS2AKQ4cxIUUmeMHaTVlU9aWM6M98NEqf8luZ1RJpVWuDdSjExY+x58Y39wPFTf+6hgvS4pRwCJRdpohw==} resolution: {integrity: sha512-azzJVyS2AKQ4cxIUUmeMHaTVlU9aWM6M98NEqf8luZ1RJpVWuDdSjExY+x58Y39wPFTf+6hgvS4pRwCJRdpohw==}
dependencies: dependencies:

View File

@ -51,7 +51,14 @@ function getLinkPresetInfo(p: LinkPreset): NavBarLink {
</Button></a> </Button></a>
<div> <div>
{links.map((l) => { {links.map((l) => {
return <a aria-label={l.name} href={l.url} target={l.external ? "_blank" : null}><Button light class="font-bold px-5 rounded-lg active:scale-95">{l.name}</Button></a>; return <a aria-label={l.name} href={l.url} target={l.external ? "_blank" : null}>
<Button light class="font-bold px-5 rounded-lg active:scale-95">
<div class="flex items-center">
{l.name}
{l.external && <Icon size="14" name="fa6-solid:arrow-up-right-from-square" class="transition -translate-y-[1px] ml-1 text-black/[0.2] dark:text-white/[0.2]"></Icon>}
</div>
</Button>
</a>;
})} })}
</div> </div>
<div class="flex"> <div class="flex">

View File

@ -14,6 +14,7 @@ const className = Astro.props.class;
const isLocal = !(src.startsWith('/') || src.startsWith('http') || src.startsWith('https') || src.startsWith('data:')); const isLocal = !(src.startsWith('/') || src.startsWith('http') || src.startsWith('https') || src.startsWith('data:'));
// TODO temporary workaround for images dynamic import // TODO temporary workaround for images dynamic import
// https://github.com/withastro/astro/issues/3373
let img; let img;
if (isLocal) { if (isLocal) {
const files = import.meta.glob<ImageMetadata>("../../**", { import: 'default' }); const files = import.meta.glob<ImageMetadata>("../../**", { import: 'default' });

View File

@ -14,15 +14,15 @@ const config = profileConfig;
<div class="card-base"> <div class="card-base">
<a aria-label="Go to About Page" href="/about" class="group block relative m-3 overflow-hidden rounded-xl active:scale-95"> <a aria-label="Go to About Page" href="/about" class="group block relative m-3 overflow-hidden rounded-xl active:scale-95">
<div class="absolute transition pointer-events-none group-hover:bg-black/30 group-active:bg-black/50 w-full h-full z-50 flex items-center justify-center"> <div class="absolute transition pointer-events-none group-hover:bg-black/30 group-active:bg-black/50 w-full h-full z-50 flex items-center justify-center">
<Icon name="material-symbols:person-outline-rounded" <Icon name="fa6-regular:address-card"
class="transition opacity-0 group-hover:opacity-100 text-white text-6xl"> class="transition opacity-0 group-hover:opacity-100 text-white text-5xl">
</Icon> </Icon>
</div> </div>
<ImageBox src={config.avatar} alt="Profile Image of the Author" class="mt-1 mx-auto w-[240px] lg:w-full h-full lg:mt-0 "></ImageBox> <ImageBox src={config.avatar} alt="Profile Image of the Author" class="mt-1 mx-auto w-[240px] lg:w-full h-full lg:mt-0 "></ImageBox>
</a> </a>
<div class="font-bold text-xl text-center mb-1 dark:text-neutral-50 transition">{config.name}</div> <div class="font-bold text-xl text-center mb-1 dark:text-neutral-50 transition">{config.name}</div>
<div class="h-1 w-5 bg-[var(--primary)] mx-auto rounded-full mb-3 transition"></div> <div class="h-1 w-5 bg-[var(--primary)] mx-auto rounded-full mb-2 transition"></div>
<div class="text-center text-neutral-400 mb-2 transition">{config.bio}</div> <div class="text-center text-neutral-400 mb-2.5 transition">{config.bio}</div>
<div class="flex gap-2 mx-2 justify-center mb-4"> <div class="flex gap-2 mx-2 justify-center mb-4">
{config.links.map(item => {config.links.map(item =>
<a aria-label={item.name} href={item.url} target="_blank"> <a aria-label={item.name} href={item.url} target="_blank">

View File

@ -90,7 +90,7 @@ const { remarkPluginFrontmatter } = await entry.render();
<a href={getPostUrlBySlug(entry.data.nextSlug)} class="w-full font-bold overflow-hidden active:scale-95"> <a href={getPostUrlBySlug(entry.data.nextSlug)} class="w-full font-bold overflow-hidden active:scale-95">
{entry.data.nextSlug && <Button class="w-full max-w-full h-10 px-4 rounded-2xl flex items-center justify-start gap-4" card height="60px"> {entry.data.nextSlug && <Button class="w-full max-w-full h-10 px-4 rounded-2xl flex items-center justify-start gap-4" card height="60px">
<Icon name="material-symbols:chevron-left-rounded" size={32} class="text-[var(--primary)]" /> <Icon name="material-symbols:chevron-left-rounded" size={32} class="text-[var(--primary)]" />
<div class="overflow-hidden overflow-ellipsis whitespace-nowrap max-w-[calc(100%_-_48px)] text-black/75 dark:text-white/75"> <div class="overflow-hidden transition overflow-ellipsis whitespace-nowrap max-w-[calc(100%_-_48px)] text-black/75 dark:text-white/75">
{entry.data.nextTitle} {entry.data.nextTitle}
</div> </div>
</Button>} </Button>}
@ -98,7 +98,7 @@ const { remarkPluginFrontmatter } = await entry.render();
<a href={getPostUrlBySlug(entry.data.prevSlug)} class="w-full font-bold overflow-hidden active:scale-95"> <a href={getPostUrlBySlug(entry.data.prevSlug)} class="w-full font-bold overflow-hidden active:scale-95">
{entry.data.prevSlug && <Button class="w-full max-w-full h-10 px-4 rounded-2xl flex items-center justify-end gap-4" card height="60px"> {entry.data.prevSlug && <Button class="w-full max-w-full h-10 px-4 rounded-2xl flex items-center justify-end gap-4" card height="60px">
<div class="overflow-hidden overflow-ellipsis whitespace-nowrap max-w-[calc(100%_-_48px)] text-black/75 dark:text-white/75"> <div class="overflow-hidden transition overflow-ellipsis whitespace-nowrap max-w-[calc(100%_-_48px)] text-black/75 dark:text-white/75">
{entry.data.prevTitle} {entry.data.prevTitle}
</div> </div>
<Icon name="material-symbols:chevron-right-rounded" size={32} class="text-[var(--primary)]" /> <Icon name="material-symbols:chevron-right-rounded" size={32} class="text-[var(--primary)]" />