From ada7837a94afb6b3c7d687c62db2943fd39dc1f4 Mon Sep 17 00:00:00 2001 From: Yufan Sheng Date: Wed, 16 Oct 2024 03:38:50 +0800 Subject: [PATCH] feat: add title for social icons. --- .vscode/settings.json | 3 +- options.ts | 8 +- src/assets/styles/globals.css | 26 +++- src/components/header/Header.astro | 169 ++++++++++++------------- src/components/image/QRDialog.astro | 1 + src/components/like/LikeShare.astro | 2 + src/components/search/SearchIcon.astro | 2 +- 7 files changed, 114 insertions(+), 97 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 9c976a8..96f1ca4 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -149,7 +149,8 @@ "yual", "yufan", "yyjn", - "zeabur" + "zeabur", + "zhihu" ], "[mdx]": { "editor.defaultFormatter": "unifiedjs.vscode-mdx" diff --git a/options.ts b/options.ts index d6ac9ad..98a8086 100644 --- a/options.ts +++ b/options.ts @@ -137,13 +137,13 @@ const options: z.input = { link: 'https://github.com/syhily', }, { - name: 'Twitter', - icon: 'icon-twitter', + name: '知乎', + icon: 'icon-zhihu-square-fill', type: 'link', - link: 'https://twitter.com/amehochan', + link: 'https://www.zhihu.com/people/syhily', }, { - name: 'Wechat', + name: '微信', icon: 'icon-wechat', type: 'qrcode', title: '扫码加我微信好友', diff --git a/src/assets/styles/globals.css b/src/assets/styles/globals.css index f8b0210..64299a0 100644 --- a/src/assets/styles/globals.css +++ b/src/assets/styles/globals.css @@ -1399,6 +1399,7 @@ textarea.form-control { @media (min-width: 1200px) and (max-width: 1399.98px) { .list-desc .h-2x { -webkit-line-clamp: 1; + line-clamp: 1; } } @@ -1638,6 +1639,7 @@ a:hover .overlay { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; + line-clamp: 1; -webkit-box-orient: vertical; } @@ -1645,6 +1647,7 @@ a:hover .overlay { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; + line-clamp: 1; -webkit-box-orient: vertical; } @@ -1652,6 +1655,7 @@ a:hover .overlay { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; + line-clamp: 1; -webkit-box-orient: vertical; } @@ -1659,6 +1663,7 @@ a:hover .overlay { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; + line-clamp: 1; -webkit-box-orient: vertical; } @@ -2044,12 +2049,6 @@ a:hover .overlay { } } -.not-by-ai { - display: block; - margin-bottom: 10px; - width: 120px; -} - .site-submenu { -ms-flex-negative: 0; flex-shrink: 0; @@ -2687,6 +2686,7 @@ a:hover .overlay { flex-wrap: wrap; } +/* Astro Badge */ .astro-badge:hover stop:first-child { stop-color: #3245ff; } @@ -2694,6 +2694,20 @@ a:hover .overlay { stop-color: #bc52ee; } +/* Not By AI Badge */ +.not-by-ai { + display: block; + margin-bottom: 10px; + width: 120px; + --not-by-ai-background: var(--btn-secondary); + --not-by-ai-line: var(--color-light); +} + +.not-by-ai:hover { + --not-by-ai-background: var(--color-light); + --not-by-ai-line: var(--btn-secondary); +} + /*-------------------------------------------------------------- widget style --------------------------------------------------------------*/ diff --git a/src/components/header/Header.astro b/src/components/header/Header.astro index 86f1f2c..4a2978d 100644 --- a/src/components/header/Header.astro +++ b/src/components/header/Header.astro @@ -28,91 +28,90 @@ import options from '@/options';
- + + + + + + + + + + + + + + + + + + + + + + + + + + + { options.socials.map((social) => { if (social.type === 'qrcode') { diff --git a/src/components/image/QRDialog.astro b/src/components/image/QRDialog.astro index 9b05879..c78203a 100644 --- a/src/components/image/QRDialog.astro +++ b/src/components/image/QRDialog.astro @@ -24,6 +24,7 @@ const svg = new QRCode({ class={className ? `nice-dialog ${className}` : 'nice-dialog btn btn-dark btn-icon btn-circle single-popup button-social'} + title={name} > diff --git a/src/components/like/LikeShare.astro b/src/components/like/LikeShare.astro index 1228cb9..628f24d 100644 --- a/src/components/like/LikeShare.astro +++ b/src/components/like/LikeShare.astro @@ -30,6 +30,7 @@ const weibo = querystring.stringify({ @@ -45,6 +46,7 @@ const weibo = querystring.stringify({ diff --git a/src/components/search/SearchIcon.astro b/src/components/search/SearchIcon.astro index ad9a544..481f4d2 100644 --- a/src/components/search/SearchIcon.astro +++ b/src/components/search/SearchIcon.astro @@ -1,4 +1,4 @@ -