This commit is contained in:
xaoxuu 2022-10-20 21:34:59 +08:00
parent c928c4124e
commit 159d275a82
2 changed files with 39 additions and 9 deletions

View File

@ -35,24 +35,48 @@
&:hover .header &:hover .header
p p
color: var(--text-p1) color: var(--text-p1)
.user-info
background: $color-theme
span
color: var(--card)
&:before &:before
background: $color-theme background: $color-theme
height: 16px height: 16px
top: 'calc(50% - 0.5 * %s)' % @height top: 'calc(50% - 0.5 * %s)' % @height
transform: scale(1) transform: scale(1)
.tag-plugin.timeline .header .tag-plugin.timeline .timenode .header
display: flex display: flex
align-items: center align-items: center
position: relative position: relative
p margin: 0.25rem 0
margin: .25rem 0 .user-info
display: flex
align-items: center
font-size: $fs-12 font-size: $fs-12
font-weight: 700 font-weight: 500
color: var(--text-p1)
margin-right: 4px
line-height: 1
border-radius: 16px
padding-right: 6px
trans2 color background
img
background: white
height: 16px
border-radius: 16px
display: inline
margin: 0 4px 0 0
object-fit: contain
&:hover
background: $color-hover
p
margin: 0
font-size: $fs-12
font-weight: 500
color: var(--text-p3) color: var(--text-p3)
font-family: $ff-code
trans1 color trans1 color
opacity: 0.75 line-height: 1
a a
color: inherit color: inherit
font-weight: inherit font-weight: inherit
@ -148,7 +172,7 @@
border-left: 4px solid var(--block-border) border-left: 4px solid var(--block-border)
border-radius: 0 border-radius: 0
display: block display: block
margin: 0.5rem 0 margin: 0.75rem 0
p p
font-size: $fs-13 font-size: $fs-13
margin: 4px margin: 0.25rem

View File

@ -67,6 +67,12 @@ const StellarTimeline = {
} }
var cell = '<div class="timenode" index="' + i + '">'; var cell = '<div class="timenode" index="' + i + '">';
cell += '<div class="header">'; cell += '<div class="header">';
if (!user && item.user) {
cell += '<a class="user-info" href="' + item.user.html_url + '" target="_blank" rel="external nofollow noopener noreferrer">';
cell += '<img src="' + item.user.avatar_url + '">';
cell += '<span>' + item.user.login + '</span>';
cell += '</a>';
}
let date = new Date(item.created_at); let date = new Date(item.created_at);
cell += '<p>' + date.toString().replace(/\sGMT([^.]*)/i, "") + '</p>'; cell += '<p>' + date.toString().replace(/\sGMT([^.]*)/i, "") + '</p>';
cell += '</div>'; cell += '</div>';
@ -105,7 +111,7 @@ const StellarTimeline = {
} }
if (item.comments != null) { if (item.comments != null) {
cell += '<a class="item comments last" href="' + item.html_url + '#issuecomment-new" target="_blank" rel="external nofollow noopener noreferrer">'; cell += '<a class="item comments last" href="' + item.html_url + '#issuecomment-new" target="_blank" rel="external nofollow noopener noreferrer">';
cell += '<span>💬 ' + (item.comments || 0) + '</span>'; cell += '<span><svg t="1666270368054" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2528" width="200" height="200"><path d="M952 64H72C32.3 64 0 96.3 0 136v508c0 39.7 32.3 72 72 72h261l128 128c14 14 32.5 21.1 50.9 21.1s36.9-7 50.9-21.1l128-128h261c39.7 0 72-32.3 72-72V136c0.2-39.7-32.1-72-71.8-72zM222 462c-39.8 0-72-32.2-72-72s32.2-72 72-72 72 32.2 72 72-32.2 72-72 72z m290-7.7c-39.8 0-72-32.2-72-72s32.2-72 72-72 72 32.2 72 72c0 39.7-32.2 72-72 72z m290 8c-39.8 0-72-32.2-72-72s32.2-72 72-72 72 32.2 72 72c0 39.7-32.2 72-72 72z" p-id="2529"></path></svg> ' + (item.comments || 0) + '</span>';
cell += '</a>'; cell += '</a>';
} }