feat(components/tiles/pages): text page

This commit is contained in:
mikhail "synzr" 2025-12-01 11:04:21 +05:00
parent ee42b07e6a
commit 7875fedc83
5 changed files with 61 additions and 17 deletions

View file

@ -60,6 +60,7 @@ Metro-like tile. Must be in a group to display correctly.
let {
size,
row,
icon,
column,
children,
}: {
@ -78,6 +79,11 @@ Metro-like tile. Must be in a group to display correctly.
*/
column: number;
/**
* Icon. Must be a valid URL.
*/
icon: string;
/**
* Pages.
*/
@ -162,6 +168,7 @@ Metro-like tile. Must be in a group to display correctly.
<div
class={style({ size })}
style="
--tile-icon: url('{icon}');
--tile-icon-size: {iconSize}px;
--tile-page-height: {pageHeight}px;
--tile-name-display: {size !== 'small' ? 'inline' : 'none'};

View file

@ -6,14 +6,8 @@ Icon page for a tile. Must be in a tile to display correctly.
<script lang="ts">
let {
icon,
name,
}: {
/**
* Icon. Must be a valid URL.
*/
icon: string;
/**
* Name.
*/
@ -25,7 +19,7 @@ Icon page for a tile. Must be in a tile to display correctly.
class="flex flex-col justify-end bg-center bg-no-repeat"
style="
height: var(--tile-page-height);
background-image: url('{icon}');
background-image: var(--tile-icon);
background-size: var(--tile-icon-size);
"
>

View file

@ -16,6 +16,11 @@ Image page for a tile. Must be in a tile to display correctly.
</script>
<div
class="w-full bg-cover bg-center bg-no-repeat"
class="flex flex-col justify-end bg-cover bg-center bg-no-repeat"
style="height: var(--tile-page-height); background-image: url('{image}');"
></div>
>
<div
class="w-[20px] mt-auto aspect-square bg-contain bg-center bg-no-repeat self-end m-2"
style="background-image: var(--tile-icon);"
></div>
</div>

View file

@ -0,0 +1,37 @@
<!--
@component
Text page for a tile. Must be in a tile to display correctly.
-->
<script lang="ts">
let {
title,
subtitle,
text,
}: {
title: string;
subtitle?: string;
text?: string;
} = $props();
</script>
<div
class="p-2 w-full flex flex-col gap-1 select-none text-white"
style="height: var(--tile-page-height);"
>
<h1 class="font-bold text-md">{title}</h1>
{#if subtitle}
<h2 class="text-md">{subtitle}</h2>
{/if}
{#if text}
<p class="text-sm">{text}</p>
{/if}
<div
class="w-[20px] mt-auto aspect-square bg-contain bg-center bg-no-repeat self-end"
style="background-image: var(--tile-icon);"
></div>
</div>