feat: add reading progress display

This commit is contained in:
Cory Dransfeldt 2023-10-29 09:51:33 -07:00
parent 3c54506ce8
commit a4472722f6
6 changed files with 25 additions and 7 deletions

View file

@ -9,13 +9,16 @@
{% assign alt = item.alt | strip %}
<a href="{{ item.url | stripUtm }}" title="{{ alt | escape }}">
<div class="relative block h-full rounded-lg overflow-hidden"{% if shape != 'square' %} style="max-width:226px"{% endif %}>
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-blue-600 hover:border-blue-800 dark:border-blue-400 dark:hover:border-blue-200 ease-in-out duration-300{% if item.title %} bg-cover-gradient{% endif %}"></div>
<div class="absolute left-1 bottom-2 drop-shadow-md">
<div class="absolute left-0 top-0 h-full w-full rounded-lg border border-blue-600 hover:border-blue-800 dark:border-blue-400 dark:hover:border-blue-200 ease-in-out duration-300{% if item.subtext %} bg-cover-gradient{% endif %}"></div>
<div class="absolute px-1.5 bottom-2 drop-shadow-md w-full">
{% if item.title %}
<div class="px-1 text-xs font-bold text-white line-clamp-2">{{ item.title }}</div>
<div class="text-xs font-bold text-white line-clamp-2">{{ item.title }}</div>
{% endif %}
{% if item.percentage %}
{% render "partials/now/progress-bar.liquid", percentage:item.percentage %}
{% endif %}
{% if item.subtext %}
<div class="px-1 text-xs text-white line-clamp-2">
<div class="text-xs text-white line-clamp-2">
{{ item.subtext }}
</div>
{% endif %}

View file

@ -0,0 +1,5 @@
{% if percentage %}
<div class="overflow-hidden h-4 my-1 w-full flex rounded-lg bg-gray-200/60">
<div style="width:{{ percentage }}" class="shadow-none flex flex-col whitespace-nowrap justify-center bg-blue-600 dark:bg-blue-400"></div>
</div>
{% endif %}