Improve mobile layout, add dl lists, add npub to profile

This commit is contained in:
Râu Cao 2024-10-22 12:18:36 +02:00
parent 4534147050
commit 3914ca25a1
Signed by: raucao
GPG Key ID: 37036C356E56CC51
3 changed files with 54 additions and 3 deletions

View File

@ -25,7 +25,7 @@ img.avatar {
} }
h1 { h1 {
margin: 2em 0 0 0; margin: 4rem 0 0 0;
} }
h2, h3, h4 { h2, h3, h4 {
@ -34,7 +34,7 @@ h2, h3, h4 {
line-height: 1.6em; line-height: 1.6em;
} }
p, pre, ul, ol, blockquote { p, pre, ul, ol, dl, blockquote {
line-height: 1.6em; line-height: 1.6em;
margin-bottom: 1.6em; margin-bottom: 1.6em;
} }
@ -53,10 +53,20 @@ pre code {
padding: 0.6rem 1rem; padding: 0.6rem 1rem;
} }
dl dt {
font-weight: bold;
margin: 0 0 0.5rem 0;
}
dl dd {
margin: 0 0 1.6rem 0;
}
main { main {
display: block; display: block;
max-width: 44rem; max-width: 44rem;
margin: 12rem auto 24rem auto; margin: 12rem auto 24rem auto;
overflow-wrap: break-word;
} }
main header { main header {
@ -96,6 +106,10 @@ main article footer {
margin-top: 5rem; margin-top: 5rem;
} }
.profile-page .about {
margin-bottom: 3rem;
}
/* Dropdown menu */ /* Dropdown menu */
.dropdown { .dropdown {
@ -144,11 +158,31 @@ main article footer {
font-size: 14px; font-size: 14px;
} }
h1 {
font-size: 1.8rem;
}
h2 {
font-size: 1.5rem;
}
h3 {
font-size: 1.3rem;
}
h4 {
font-size: 1rem;
}
main { main {
max-width: 100%; max-width: 100%;
margin: 4rem 1rem 8rem 1rem; margin: 4rem 1rem 8rem 1rem;
} }
.profile-page h1 {
margin-top: 2rem;
}
.dropdown-content { .dropdown-content {
bottom: 100%; bottom: 100%;
} }

View File

@ -25,6 +25,10 @@ pre code {
color: #ccc; color: #ccc;
} }
dl dt {
color: #888;
}
main header .meta .date { main header .meta .date {
color: #888; color: #888;
} }
@ -33,6 +37,10 @@ main header .meta .name a {
color: #3b3a38; color: #3b3a38;
} }
.profile-page .pubkey {
color: #888;
}
/* Dropdown menu */ /* Dropdown menu */
.dropdown-button { .dropdown-button {

11
html.ts
View File

@ -88,9 +88,18 @@ export function profilePageHtml(profile: Profile, articles: Article[]): string {
<p class="about"> <p class="about">
${profile.about} ${profile.about}
</p> </p>
</p>
</div> </div>
</header> </header>
${articleListHtml(articles)} <section>
<dl>
<dt>Public key</dt>
<dd>${profile.npub}</dd>
</dl>
</section>
<section>
${articleListHtml(articles)}
</section>
</main> </main>
`; `;