Fixed aspect ratio
All checks were successful
All checks were successful
This commit is contained in:
parent
ac7e9f089e
commit
3c97d6687c
1 changed files with 8 additions and 5 deletions
|
@ -1,6 +1,6 @@
|
||||||
---
|
---
|
||||||
import type { ImageMetadata } from 'astro';
|
import type { ImageMetadata } from 'astro'
|
||||||
import { Image } from 'astro:assets';
|
import { Image } from 'astro:assets'
|
||||||
import mlb_ce from '../assets/ce/mlb.webp'
|
import mlb_ce from '../assets/ce/mlb.webp'
|
||||||
|
|
||||||
export interface Props {
|
export interface Props {
|
||||||
|
@ -11,7 +11,9 @@ export interface Props {
|
||||||
|
|
||||||
const { mlb, imageFile, name } = Astro.props
|
const { mlb, imageFile, name } = Astro.props
|
||||||
const imagePath = `/src/assets/ce/${imageFile}`
|
const imagePath = `/src/assets/ce/${imageFile}`
|
||||||
const images_ces = import.meta.glob<{ default: ImageMetadata }>('/src/assets/ce/*.webp')
|
const images_ces = import.meta.glob<{ default: ImageMetadata }>(
|
||||||
|
'/src/assets/ce/*.webp'
|
||||||
|
)
|
||||||
|
|
||||||
let mlb_image: string = 'mlbalign'
|
let mlb_image: string = 'mlbalign'
|
||||||
if (mlb === 'false') {
|
if (mlb === 'false') {
|
||||||
|
@ -21,10 +23,10 @@ if (mlb === 'false') {
|
||||||
|
|
||||||
<article>
|
<article>
|
||||||
<div>
|
<div>
|
||||||
<Image src={images_ces[imagePath]()} alt={name} class="ce-crop"/>
|
<Image src={images_ces[imagePath]()} alt={name} class="ce-crop" />
|
||||||
</div>
|
</div>
|
||||||
<div class={mlb_image}>
|
<div class={mlb_image}>
|
||||||
<Image src={mlb_ce} alt="Max-limit broken" class="mlb"/>
|
<Image src={mlb_ce} alt="Max-limit broken" class="mlb" />
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
|
@ -89,6 +91,7 @@ if (mlb === 'false') {
|
||||||
|
|
||||||
.mlb {
|
.mlb {
|
||||||
width: 5.5rem;
|
width: 5.5rem;
|
||||||
|
height: auto;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue