Skip to content

Commit

Permalink
feat(home-links): support custom pictures.
Browse files Browse the repository at this point in the history
  • Loading branch information
Theo-Messi committed Jan 13, 2025
1 parent 1540347 commit bfd3f6d
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 21 deletions.
2 changes: 1 addition & 1 deletion docs/.vitepress/configs/socialLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const socialLinks: DefaultTheme.SocialLink[] = [
icon: {
svg: '<iconify-icon icon="twemoji:red-heart" style="font-size:1.2em" alt="Github Sponsors"></iconify-icon>'
},
link: 'https://github.com/sponsors/Theo-Messi',
link: 'https://i.theojs.cn/docs/202405201759098.webp',
ariaLabel: 'Github Sponsors'
}
]
2 changes: 1 addition & 1 deletion docs/.vitepress/data/AsideData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const Aside_Data: AsideItem[] = [
activity: '飞兔云'
},
{
link: 'https://github.com/sponsors/Theo-Messi',
link: 'https://i.theojs.cn/docs/202405201759098.webp',
icon: 'twemoji:red-heart',
name: '赞助我的项目'
},
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ hero:

- theme: sponsor
text: ✨ 成为赞助商
link: https://github.com/sponsors/Theo-Messi
link: https://i.theojs.cn/docs/202405201759098.webp

- theme: lumen theo
- theme: custom-alt
text: 玄学宝典
link: https://xx.theojs.cn

Expand Down
7 changes: 7 additions & 0 deletions src/theme/components-var.css
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@
--ShareButton-bg-hover: var(--vp-c-brand-soft);
--ShareButton-border-hover: var(--vp-c-brand-1);
--ShareButton-icon: var(--vp-c-brand-1);

/**
* Home-links
* -------------------------------------------------------------------------- */

--Home-links-custom-brand: url('https://i.theojs.cn/avatar.webp');
--Home-links-custom-alt: url('https://i.theojs.cn/avatar.webp');
}

.dark {
Expand Down
54 changes: 37 additions & 17 deletions src/theme/home-links.css
Original file line number Diff line number Diff line change
@@ -1,33 +1,60 @@
/**
* Component: home-links
* -------------------------------------------------------------------------- */
a.custom-brand {
border-color: var(--vp-button-brand-border);
background-color: var(--vp-button-brand-bg);
color: var(--vp-button-brand-text);
}

a.custom-brand:hover {
border-color: var(--vp-button-brand-hover-border);
background-color: var(--vp-button-brand-hover-bg);
color: var(--vp-button-brand-hover-text);
}

a.custom-brand:active {
border-color: var(--vp-button-brand-active-border);
background-color: var(--vp-button-brand-active-bg);
color: var(--vp-button-brand-active-text);
}

a.lumen {
a.custom-brand::before {
display: inline-block;
transform: translateY(7px);
margin-right: 0.5em;
background-image: var(--Home-links-custom-brand);
background-position: bottom;
background-size: 1.5rem;
background-repeat: no-repeat;
width: 1.5rem;
height: 1.5rem;
content: '';
}

a.custom-alt {
border-color: var(--vp-button-alt-border);
background-color: var(--vp-button-alt-bg);
color: var(--vp-button-alt-text);
font-size: 16px;
line-height: 46px;
text-align: center;
}

a.lumen:hover {
a.custom-alt:hover {
border-color: var(--vp-button-alt-hover-border);
background-color: var(--vp-button-alt-hover-bg);
color: var(--vp-button-alt-hover-text);
}

a.lumen:active {
a.custom-alt:active {
border-color: var(--vp-button-alt-active-border);
background-color: var(--vp-button-alt-active-bg);
color: var(--vp-button-alt-active-text);
}

a.lumen.theo::before {
a.custom-alt::before {
display: inline-block;
transform: translateY(7px);
margin-right: 0.5em;
background-image: url('https://i.theojs.cn/avatar.webp');
background-image: var(--Home-links-custom-alt);
background-position: bottom;
background-size: 1.5rem;
background-repeat: no-repeat;
Expand All @@ -36,16 +63,9 @@ a.lumen.theo::before {
content: '';
}

@keyframes ping {
15%,
to {
transform: scale(1.25, 2);
opacity: 0;
}
}

@media (max-width: 420px) {
a.lumen.theo {
a.custom-alt,
a.custom-brand {
display: block;
margin-right: 8px;
margin-left: 8px;
Expand Down

0 comments on commit bfd3f6d

Please sign in to comment.