mirror of
https://github.com/cupcakearmy/nicco.io.git
synced 2025-09-10 20:50:43 +00:00
astro first commit
This commit is contained in:
52
src/layouts/PageWithTitle.astro
Normal file
52
src/layouts/PageWithTitle.astro
Normal file
@@ -0,0 +1,52 @@
|
||||
---
|
||||
import SpacedLetters from '../components/SpacedLetters.astro'
|
||||
import Root from './Root.astro'
|
||||
|
||||
export type Props = {
|
||||
title: string
|
||||
readable?: boolean
|
||||
expanded?: boolean
|
||||
}
|
||||
|
||||
const { title, readable = false, expanded = true } = Astro.props
|
||||
---
|
||||
|
||||
<Root>
|
||||
<div>
|
||||
<h1>
|
||||
<SpacedLetters letters={title} {readable} />
|
||||
</h1>
|
||||
<section class:list={{ expanded }}>
|
||||
<slot />
|
||||
</section>
|
||||
</div>
|
||||
</Root>
|
||||
|
||||
<style>
|
||||
div {
|
||||
padding: 4rem;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 30rem) {
|
||||
div {
|
||||
padding: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
section {
|
||||
max-width: 30em;
|
||||
margin-bottom: 4em;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
section.expanded {
|
||||
margin-top: 5em;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-top: calc(28vh - 3em);
|
||||
margin-bottom: 3em;
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user