From 7442e12d9d38b9121d948e646ed2ad17fa3f1feb Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Fri, 14 Oct 2022 14:23:27 +0800 Subject: [PATCH] github releases timeline --- source/css/_layout/tag-plugins/timeline.styl | 42 ++++------- source/js/plugins/timeline.js | 74 +++++++++++--------- 2 files changed, 55 insertions(+), 61 deletions(-) diff --git a/source/css/_layout/tag-plugins/timeline.styl b/source/css/_layout/tag-plugins/timeline.styl index 0316a56..1a5b874 100644 --- a/source/css/_layout/tag-plugins/timeline.styl +++ b/source/css/_layout/tag-plugins/timeline.styl @@ -91,11 +91,15 @@ font-size: $fs-14 p.title font-size: 1rem - font-weight: 500 + font-weight: 700 margin: 0 padding: 0.5rem 0 0.75rem line-height: 1.25 border-bottom: 1px dashed var(--block-border) + a + color: inherit + &:hover + color: $color-hover pre code font-size: $fs-12 @@ -116,18 +120,13 @@ line-height: 1.8 &:empty display: none - a.comments - margin-right: 0 - + .flex + display: flex + flex-wrap: wrap + font-size: $fs-12 + align-items: stretch -.tag-plugin.timeline.stellar-timeline-api .body .footer .flex - display: flex - flex-wrap: wrap - font-size: $fs-12 - align-items: stretch - .reaction - border-color: var(--block) - border-style: dashed +.tag-plugin.timeline.stellar-timeline-api .body .footer .item border-width: 1px border-style: solid @@ -136,24 +135,9 @@ padding: 0 0.5rem display: flex align-items: center - &.comments - border-width: 0 &:first-child margin-left: 0 &:last-child margin-right: 0 - .key - margin-right: 4px - -.tag-plugin.timeline.stellar-timeline-api .body .footer a.comments - border-radius: 4px - padding: 0 0.5rem - color: white - trans1: all - margin-left: 2px - background: $color-theme - .key - margin-right: 4px - &:hover - background: $color-hover - + .reaction + border-color: var(--block) \ No newline at end of file diff --git a/source/js/plugins/timeline.js b/source/js/plugins/timeline.js index 241a8cb..48dc474 100644 --- a/source/js/plugins/timeline.js +++ b/source/js/plugins/timeline.js @@ -59,45 +59,55 @@ const StellarTimeline = { $(el).find('.loading-wrap').remove(); const arr = data.content || data; arr.forEach((item, i) => { - if (item.labels.length > 0) { - var cell = '
'; - cell += '
'; - let date = new Date(item.created_at); - cell += '

' + date.toString().replace(/\sGMT([^.]*)/i, "") + '

'; - cell += '
'; - cell += '
'; - cell += '

' + item.title + '

'; - cell += marked.parse(item.body); - cell += ''; + cell += '
'; + $(el).append(cell); }); }, function() { $(el).find('.loading-wrap svg').remove();