More basic stuff and features
This commit is contained in:
parent
ba98da2b17
commit
5de1d8fc07
11 changed files with 449 additions and 80 deletions
62
src/Pages/ImageIndexPage.bf
Normal file
62
src/Pages/ImageIndexPage.bf
Normal 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>
|
||||
""");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue