mirror of
https://ark.sudovanilla.org/Korbs/Pandora.git
synced 2024-12-23 03:23:52 +00:00
Create Hero component
This commit is contained in:
parent
cc996376f5
commit
eccad26857
3
index.ts
3
index.ts
|
@ -1,8 +1,9 @@
|
||||||
// Blocks
|
// Blocks
|
||||||
import CallToAction from "./src/blocks/CallToAction.astro";
|
import CallToAction from "./src/blocks/CallToAction.astro";
|
||||||
|
import Hero from "./src/blocks/Hero.astro"
|
||||||
|
|
||||||
// Components
|
// Components
|
||||||
import Image from "./src/Image.astro";
|
import Image from "./src/Image.astro";
|
||||||
|
|
||||||
// Export
|
// Export
|
||||||
export {CallToAction, Image}
|
export {CallToAction, Image, Hero}
|
48
src/blocks/Hero.astro
Normal file
48
src/blocks/Hero.astro
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
---
|
||||||
|
// Properties
|
||||||
|
const {
|
||||||
|
Title,
|
||||||
|
Description,
|
||||||
|
|
||||||
|
ImageSource,
|
||||||
|
ImageAlt,
|
||||||
|
} = Astro.props
|
||||||
|
|
||||||
|
// Components
|
||||||
|
import Image from '../Image.astro'
|
||||||
|
---
|
||||||
|
|
||||||
|
<div class="pd-hero">
|
||||||
|
<Image Source={ImageSource} Alt={ImageAlt}/>
|
||||||
|
<div class="pd-hero-content">
|
||||||
|
<h2>{Title}</h2>
|
||||||
|
<p>{Description}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.pd-hero {
|
||||||
|
position: relative;
|
||||||
|
height: 500px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
img {
|
||||||
|
position: absolute;
|
||||||
|
z-index: -1;
|
||||||
|
border-radius: 12px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
object-position: center;
|
||||||
|
opacity: 0.5 !important;
|
||||||
|
filter: brightness(0.75);
|
||||||
|
}
|
||||||
|
.pd-hero-content {
|
||||||
|
margin-left: 10%;
|
||||||
|
color: var(--pandora-text);
|
||||||
|
* {margin: 0px}
|
||||||
|
h2 {font-size: 48px}
|
||||||
|
p {font-size: 24px}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in a new issue