add element icons

This commit is contained in:
Yisroel Baum 2026-05-27 21:14:24 +03:00
parent ac7af2463d
commit f3f500d491
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
12 changed files with 49 additions and 0 deletions

View file

@ -8,6 +8,7 @@ export interface ChildElement {
}
export interface Element extends ChildElement {
iconImageUrl: string | null
richText: string
pdfPath: string | null
youtubeUrl: string | null

View file

@ -211,6 +211,14 @@ function isShortYoutubeHost(hostname: string): boolean {
{{ error }}
</p>
<section v-else-if="element" class="element-page__content">
<img
v-if="element.iconImageUrl !== null"
:src="element.iconImageUrl"
:alt="`${element.title} icon`"
class="element-page__icon"
data-cy="element-icon"
/>
<h1 class="element-page__heading">
{{ element.title }}
</h1>
@ -296,6 +304,14 @@ function isShortYoutubeHost(hostname: string): boolean {
margin: 0 auto;
}
.element-page__icon {
display: block;
width: 132px;
height: 132px;
margin: 0 auto 1.8rem;
object-fit: contain;
}
.element-page__heading {
margin: 0;
color: #2c2c2c;
@ -459,5 +475,11 @@ function isShortYoutubeHost(hostname: string): boolean {
.element-page__children {
margin-top: 2rem;
}
.element-page__icon {
width: 108px;
height: 108px;
margin-bottom: 1.4rem;
}
}
</style>