chore: cleanup + organize

This commit is contained in:
Cory Dransfeldt 2024-05-19 14:40:22 -07:00
parent ac9a617fcd
commit 1852951f24
No known key found for this signature in database
21 changed files with 38 additions and 75 deletions

View file

@ -0,0 +1,21 @@
{% if albumReleases.size > 0 %}
<h2 id="album-releases" class="section-header flex-centered">
{% tablericon "calendar-time" "Anticipated albums" %}
Anticipated albums
</h2>
<ul class="link-list">
{% for album in albumReleases %}
<li>
<strong>{{ album.date }}: </strong>
<a href="{{ album.url}}" title="{{ album.title | escape}} by {{ album.artist | escape}}">
{{ album.title }}
</a>
<span> by </span>
<a href="https://musicbrainz.org/artist/{{ album.mbid }}">
{{ album.artist }}
</a>
<span> • {{ album.genre }}</span>
</li>
{% endfor %}
</ul>
{% endif %}

View file

@ -0,0 +1,30 @@
{% if data.size > 0 %}
{% assign media = data | normalizeMedia %}
<div class="media-grid {% if shape == 'square' %}square{% else %}vertical{% endif %}">
{% for item in media limit: count %}
{% assign alt = item.alt | strip | escape %}
<a href="{{ item.url | stripUtm }}" title="{{ alt }}">
<div class="item-wrapper shadow">
<div class="meta-text">
{% if item.title %}
<div class="header">{{ item.title }}</div>
{% endif %}
{% if item.subtext %}
<div class="subheader">
{{ item.subtext }}
</div>
{% endif %}
</div>
{%- capture loadingStrategy -%}
{%- if loading -%}{{ loading }}{%- else -%}lazy{%- endif -%}
{%- endcapture -%}
{% if shape == 'square' %}
<img src="https://coryd.dev/.netlify/images/?url={{ item.image }}&fit=cover&w=240&h=240&fm=webp&q=80"{% if alt %} alt="{{ alt }}"{% endif %} loading="{{ loadingStrategy }}" decoding="async" width="240" height="240" />
{% else %}
<img src="https://coryd.dev/.netlify/images/?url={{ item.image }}&fit=cover&w=200&h=307&fm=webp&q=80"{% if alt %} alt="{{ alt }}"{% endif %} loading="{{ loadingStrategy }}" decoding="async" width="200" height="307" />
{% endif %}
</div>
</a>
{% endfor %}
</div>
{% endif %}

View file

@ -0,0 +1,5 @@
{% if percentage %}
<div class="progress-bar__wrapper">
<div style="width:{{ percentage }}" class="progress-bar"></div>
</div>
{% endif %}

View file

@ -0,0 +1,19 @@
{% if data.size > 0 %}
<div class="music-chart">
{% for item in data limit: 10 %}
{%- assign percentage = item.plays | calculatePlayPercentage: mostPlayed -%}
<div class="item">
<div class="presentation">
<div class="count">{{ item.rank | formatNumber }}.</div>
<div class="info">
<div class="title">
<a href="{{ item.url }}">{{ item.title }}</a>
</div>
<div class="subtext">{{ item.artist }} • {{ item.plays }} plays</div>
</div>
</div>
{% render "partials/media/progress-bar.liquid", percentage:percentage %}
</div>
{% endfor %}
</div>
{% endif %}

View file

@ -0,0 +1,21 @@
{% if data.size > 0 %}
<div class="music-chart">
{% for item in data limit: 10 %}
{% capture alt %}{{ item.title | escape }} by {{ item.artist }}{% endcapture %}
<div class="item">
<div class="meta">
<img src="https://coryd.dev/.netlify/images/?url={{ item.image }}&fit=cover&w=64&h=64&fm=webp&q=80" alt="{{ alt }}" loading="lazy" decoding="async" width="64" height="64" />
<div class="meta-text">
<div class="title">
<a href="{{ item.url }}">{{ item.title }}</a>
</div>
<div class="subtext">{{ item.artist }}</div>
</div>
</div>
<div class="timestamp">
{{ item.timestamp | date: "%B %-d, %-I:%M%p", "America/Los_Angeles" }}
</div>
</div>
{% endfor %}
</div>
{% endif %}