Skip to content

Commit a787681

Browse files
committed
首页图片优化
1 parent 73b713f commit a787681

3 files changed

Lines changed: 12 additions & 4 deletions

File tree

packages/pure/components/basic/Header.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ import { Icon } from '../user'
7777
</header-component>
7878

7979
{/* Use inline to load icon quicker firstly */}
80-
<script is:inline>
80+
<!-- <script is:inline>
8181
const toggleDarkModeElement = document.getElementById('toggleDarkMode')
8282
const initialTheme = localStorage.getItem('theme') || 'system'
8383
if (toggleDarkModeElement) {
@@ -123,7 +123,7 @@ import { Icon } from '../user'
123123
}
124124
125125
customElements.define('header-component', Header)
126-
</script>
126+
</script> -->
127127

128128
<style>
129129
header-component {

src/assets/home.png

-1.59 MB
Loading

src/pages/index.astro

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,16 @@ const highlightColor = getHighlightColor()
3232
<div class='grid grid-cols-1 md:grid-cols-[auto_1fr] gap-6 md:gap-8 items-center'>
3333
{/* 左侧:头像 - 大尺寸 */}
3434
<div class='flex justify-center md:justify-start'>
35-
<div class='w-32 h-32 md:w-48 md:h-48 lg:w-56 lg:h-56 overflow-hidden rounded-lg'>
36-
<Image src={avatarImage} alt='Avatar' class='w-full h-full object-contain block' />
35+
<div class='w-32 h-32 md:w-48 md:h-48 lg:w-56 lg:h-56 overflow-hidden rounded-lg flex items-center justify-center bg-muted/30'>
36+
<Image
37+
src={avatarImage}
38+
alt='Avatar'
39+
width={224}
40+
height={224}
41+
class='w-full h-full object-contain block'
42+
loading='eager'
43+
fetchpriority='high'
44+
/>
3745
</div>
3846
</div>
3947

0 commit comments

Comments
 (0)