mirror of
https://github.com/d0zingcat/BroadcastChannel.git
synced 2026-06-08 15:10:29 +00:00
fix: improve accessibility and remove unnecessary attributes
Enhanced accessibility by wrapping time display in a semantic `<time>` element, ensuring better screen reader support. Removed inline styles and onclick attributes from elements, simplifying the code and improving performance.
This commit is contained in:
@@ -20,7 +20,9 @@ const timeago = datetime.isBefore(dayjs().subtract(1, 'w')) ? datetime.format('H
|
||||
<div class="time-box">
|
||||
<div class="dot"></div>
|
||||
<div class="time">
|
||||
<a href={`${SITE_URL}posts/${post.id}`} title={post.datetime} class="item-link">{timeago}</a>
|
||||
<a href={`${SITE_URL}posts/${post.id}`} title={post.datetime} class="item-link">
|
||||
<time datetime={post.datetime} title={timeago}>{timeago}</time>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
{post.content.length > 0 && <div class={`text-box content`} set:html={post.content} />}
|
||||
|
||||
Reference in New Issue
Block a user