mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +02:00
fix: visual height inconsistency between chinese and english title font
This commit is contained in:
parent
dc260f3f6c
commit
26a3cce66e
5 changed files with 11 additions and 11 deletions
Binary file not shown.
|
@ -19,7 +19,7 @@ const marginBottom = {
|
||||||
---
|
---
|
||||||
|
|
||||||
<header class="mb-10.625 lg:hidden">
|
<header class="mb-10.625 lg:hidden">
|
||||||
<h3 class={`${marginBottom} mt-2.9375 text-5.375 c-secondary font-bold font-title`}>
|
<h3 class={`${marginBottom} mt-3 text-5.375 c-secondary font-bold font-title`}>
|
||||||
<!-- Fix text cropping issues during view transition on ios by adding a div tag -->
|
<!-- Fix text cropping issues during view transition on ios by adding a div tag -->
|
||||||
<div
|
<div
|
||||||
class="box-content inline-block pr-1.25"
|
class="box-content inline-block pr-1.25"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
import { getNextLangUrl, getPostNextLangUrl } from '@/i18n/path'
|
import { getNextLangUrl, getNextSupportedLangUrl } from '@/i18n/path'
|
||||||
import { isPostPage, isTagPage } from '@/utils/page'
|
import { isPostPage, isTagPage } from '@/utils/page'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -11,13 +11,13 @@ const currentPath = Astro.url.pathname
|
||||||
const isPost = isPostPage(currentPath)
|
const isPost = isPostPage(currentPath)
|
||||||
const isTag = isTagPage(currentPath)
|
const isTag = isTagPage(currentPath)
|
||||||
|
|
||||||
// 检查是否应使用受限的语言列表
|
// Check if only the supported language switch list is used
|
||||||
const useFilteredLangs = isPost || (isTag && supportedLangs.length > 0)
|
const useSupportedLangs = isPost || (isTag && supportedLangs.length > 0)
|
||||||
|
|
||||||
// 根据页面类型选择合适的语言切换方式
|
// Choose a language switch list according to the page type
|
||||||
const nextUrl = useFilteredLangs
|
const nextUrl = useSupportedLangs
|
||||||
? getPostNextLangUrl(currentPath, supportedLangs) // 只在有内容的语言间切换
|
? getNextSupportedLangUrl(currentPath, supportedLangs) // Switch between supported languages
|
||||||
: getNextLangUrl(currentPath) // 在所有语言间切换
|
: getNextLangUrl(currentPath) // Switch between all languages
|
||||||
---
|
---
|
||||||
|
|
||||||
<a
|
<a
|
||||||
|
|
|
@ -75,7 +75,7 @@ export function getNextLangUrl(currentPath: string): string {
|
||||||
* @param supportedLangs 文章支持的语言列表
|
* @param supportedLangs 文章支持的语言列表
|
||||||
* @returns 下一个可用语言的URL
|
* @returns 下一个可用语言的URL
|
||||||
*/
|
*/
|
||||||
export function getPostNextLangUrl(currentPath: string, supportedLangs: string[]): string {
|
export function getNextSupportedLangUrl(currentPath: string, supportedLangs: string[]): string {
|
||||||
// 从路径提取当前语言
|
// 从路径提取当前语言
|
||||||
const currentLang = getLangFromPath(currentPath)
|
const currentLang = getLangFromPath(currentPath)
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ const footerMarginClass = isPost && themeConfig.comment?.waline?.serverURL
|
||||||
<!-- content width: calc(32rem+(100vw-1024px)*(44rem-32rem)/(1280-1024))=calc(75vw-16rem) / gap width: calc(6.75rem+(100vw-1024px)*(10.75rem-6.75rem)/(1280-1024))=calc(25vw-9.25rem) -->
|
<!-- content width: calc(32rem+(100vw-1024px)*(44rem-32rem)/(1280-1024))=calc(75vw-16rem) / gap width: calc(6.75rem+(100vw-1024px)*(10.75rem-6.75rem)/(1280-1024))=calc(25vw-9.25rem) -->
|
||||||
<div
|
<div
|
||||||
class="mx-auto max-w-205.848 min-h-vh w-full min-h-dvh"
|
class="mx-auto max-w-205.848 min-h-vh w-full min-h-dvh"
|
||||||
p="x-[min(7.25vw,3.731rem)] y-8 lg:(x-22.5 y-20)"
|
p="x-[min(7.25vw,3.731rem)] y-9 lg:(x-22.5 y-20)"
|
||||||
lg="max-w-320 grid cols-[min(calc(75vw-16rem),44rem)_14rem] gap-[min(calc(25vw-9.25rem),10.75rem)]"
|
lg="max-w-320 grid cols-[min(calc(75vw-16rem),44rem)_14rem] gap-[min(calc(25vw-9.25rem),10.75rem)]"
|
||||||
>
|
>
|
||||||
<!-- hide header and navigation on mobile for post pages -->
|
<!-- hide header and navigation on mobile for post pages -->
|
||||||
|
@ -75,7 +75,7 @@ const footerMarginClass = isPost && themeConfig.comment?.waline?.serverURL
|
||||||
<!-- <PhotoSwipe /> -->
|
<!-- <PhotoSwipe /> -->
|
||||||
|
|
||||||
<!-- only show on mobile (fix position issue on ios / fix right distance)-->
|
<!-- only show on mobile (fix position issue on ios / fix right distance)-->
|
||||||
<div class="absolute right-7.25vw top-13.5 flex gap-6 [@supports(-webkit-touch-callout:none)]:top-12.5 min-[823px]:right-[calc(50vw-22rem)] lg:hidden">
|
<div class="absolute right-7.25vw top-13.6 flex gap-6 [@supports(-webkit-touch-callout:none)]:top-12.6 min-[823px]:right-[calc(50vw-22rem)] lg:hidden">
|
||||||
<LanguageSwitcher supportedLangs={supportedLangs} />
|
<LanguageSwitcher supportedLangs={supportedLangs} />
|
||||||
<ThemeToggle />
|
<ThemeToggle />
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue