character-ref/src/layouts/character.webc
2025-04-07 04:00:32 +02:00

79 lines
1.7 KiB
Text

---
layout: base.webc
---
<main :class="firstName.toLowerCase()">
<profile webc:nokeep>
<eleventy-image
slot="avatar"
:src="`src/img/${firstName.toLowerCase()}/avatar.png`"
:alt="firstName + ' Avatar'"
:width="[500, 1000]"
></eleventy-image>
<template webc:nokeep slot="name" @text="getFullName()"></template>
<template webc:nokeep slot="species" @text="species"></template>
<traits :traits="getTraits()" webc:nokeep></traits>
</profile>
<page-content :char="firstName.toLowerCase()" webc:nokeep>
<h1 @text="$data.eleventyNavigation.key"></h1>
<article @raw="content"></article>
</page-content>
<footer>&copy; Sebin Nyshkim 2025</footer>
</main>
<style>
main {
--inbox-margin: 1rem;
display: grid;
justify-content: center;
justify-items: center;
align-items: start;
gap: 1em;
grid-auto-columns: 100%;
grid-template-areas:
'info'
'content'
'footer';
margin-block: var(--container-spacing-top-safe) var(--container-spacing-bottom-safe);
margin-inline: var(--container-spacing-left-safe) var(--container-spacing-right-safe);
margin-block: var(--page-spacing);
@media (min-width: 64em) {
--inbox-margin: 1.5rem;
grid-auto-columns: revert;
grid-template-columns: 18em minmax(0, 65ch);
grid-template-areas:
'info content'
'. footer';
}
}
h1 {
margin-inline: var(--inbox-margin);
}
article {
margin-block: var(--inbox-margin);
margin-inline: var(--inbox-margin);
hyphens: auto;
}
aside {
grid-area: info;
}
section {
grid-area: content;
}
footer {
text-align: end;
grid-area: footer;
}
</style>