feat: ✨ add character page layout
This commit is contained in:
parent
eeca2a2202
commit
f7a73793d8
1 changed files with 61 additions and 0 deletions
61
src/layouts/character.webc
Normal file
61
src/layouts/character.webc
Normal file
|
@ -0,0 +1,61 @@
|
|||
---
|
||||
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>© Sebin Nyshkim 2025</footer>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
main {
|
||||
--inbox-margin: 1rem;
|
||||
|
||||
display: flex;
|
||||
flex-flow: column nowrap;
|
||||
align-items: center;
|
||||
gap: 1em;
|
||||
|
||||
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;
|
||||
|
||||
flex-flow: row nowrap;
|
||||
justify-content: center;
|
||||
align-items: start;
|
||||
}
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin-inline: var(--inbox-margin);
|
||||
}
|
||||
|
||||
article {
|
||||
margin-block: var(--inbox-margin);
|
||||
margin-inline: var(--inbox-margin);
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: end;
|
||||
}
|
||||
</style>
|
Loading…
Add table
Add a link
Reference in a new issue