mirror of
https://github.com/hex248/ob248.com.git
synced 2026-02-08 10:43:38 +00:00
demo box component
This commit is contained in:
26
src/components/Demo.astro
Normal file
26
src/components/Demo.astro
Normal file
@@ -0,0 +1,26 @@
|
||||
---
|
||||
interface Props {
|
||||
image: string;
|
||||
title: string;
|
||||
type?: "boxed" | "simple";
|
||||
}
|
||||
|
||||
const { image, title, type = "simple" } = Astro.props;
|
||||
---
|
||||
|
||||
{type === "boxed" ? (
|
||||
<div class="border demo-border">
|
||||
<span>{title}</span>
|
||||
<img
|
||||
src={image}
|
||||
alt={title}
|
||||
class="object-cover"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<img
|
||||
src={image}
|
||||
alt={title}
|
||||
class="w-full h-full object-cover demo-border"
|
||||
/>
|
||||
)}
|
||||
Reference in New Issue
Block a user