More basic stuff and features

This commit is contained in:
Booklordofthedings 2025-05-05 13:48:51 +02:00
parent ba98da2b17
commit 5de1d8fc07
11 changed files with 449 additions and 80 deletions

View file

@ -0,0 +1,62 @@
namespace Writer;
using System;
using System.Collections;
class ImageIndexPage : Page
{
private String Layerinfo = new .("") ~ delete _;
public this(params Span<TOCItem> items)
{
this.AddHeading(3, "Abbildungsverzeichnis");
for (var i in items)
AddItem(i);
}
public override void ComputeStyle(System.StringView className, System.String buffer)
{
buffer.Append(scope $"""
.{className} \{
page: image-index;
\}
.article \{
display: flex;
\}
.article .item,
.article .price \{
flex: 1 0 auto;
\}
.article .dots \{
flex: 0 1 auto;
margin: 0 5px;
/*Allows too long content to be hidden.*/
overflow: hidden;
\}
.dots::before \{
display: block;
white-space: nowrap;
overflow: hidden;
text-overflow: clip;
content:
". . . . . . . . . . . . . . . . . . . . "
". . . . . . . . . . . . . . . . . . . . "
". . . . . . . . . . . . . . . . . . . . "
". . . . . . . . . . . . . . . . . . . . "
\}
""");
}
private void AddItem(TOCItem item)
{
this.[Friend]_content.Append(scope $"""
<div class="article">
<span class="item">{item.Name}</span>
<span class="dots"></span>
<span class="price">{item.Page}</span>
</div>
""");
}
}