handle images better

This commit is contained in:
2024-08-25 00:32:12 +02:00
parent 056d06a1e3
commit a965cda85f
3 changed files with 21 additions and 3 deletions
+17 -1
View File
@@ -1,5 +1,9 @@
---
import { Image } from 'astro:assets';
import logoImage from '../assets/img/yht_logo.png';
---
<div> <div>
<img src="/assets/yht_logo.png" alt="YouHaveTrouble's logo"> <Image src={logoImage} alt="Logo displaying a stylized character with brown hair wearing purple hoodie on a light blue circle background" width="150" height="150"/>
<p> <p>
Hi, I'm <strong>Paweł</strong>, also known by <strong>YouHaveTrouble</strong> on the internet. Hi, I'm <strong>Paweł</strong>, also known by <strong>YouHaveTrouble</strong> on the internet.
I'm a full-stack web developer and minecraft plugin developer. I'm a full-stack web developer and minecraft plugin developer.
@@ -10,6 +14,7 @@
div { div {
align-items: center; align-items: center;
display: flex; display: flex;
flex-direction: row;
} }
img { img {
@@ -23,4 +28,15 @@
p { p {
font-size: 1.125rem; font-size: 1.125rem;
} }
@media screen and (max-width: 520px) {
div {
flex-direction: column;
}
img {
margin-right: unset;
width: 150px;
height: 150px;
}
}
</style> </style>
+1 -1
View File
@@ -16,6 +16,6 @@ const { current = '' } = Astro.props;
</style> </style>
<header> <header>
<Logo /> <Logo width="50" height="50" />
<Nav current={current} /> <Nav current={current} />
</header> </header>
+3 -1
View File
@@ -1,10 +1,12 @@
--- ---
import { Image } from 'astro:assets'; import { Image } from 'astro:assets';
import logoImage from '../assets/img/yht_logo.png'; import logoImage from '../assets/img/yht_logo.png';
const { width, height } = Astro.props;
--- ---
<a href="/"> <a href="/">
<Image src={logoImage} alt="Logo displaying a stylized character with brown hair wearing purple hoodie on a light blue circle background" width="50" height="50"/> <Image src={logoImage} alt="Logo displaying a stylized character with brown hair wearing purple hoodie on a light blue circle background" width={width} height={height}/>
</a> </a>
<style> <style>