hexo-theme-stellar 1.30.0 → 1.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_config.yml +9 -7
- package/_data/icons.yml +3 -1
- package/layout/_partial/main/post_list/post_card.ejs +15 -11
- package/package.json +1 -1
- package/scripts/tags/lib/friends.js +4 -4
- package/scripts/tags/lib/sites.js +1 -1
- package/source/css/_components/list.styl +41 -12
- package/source/css/_components/partial/article-banner.styl +23 -9
- package/source/css/_components/tag-plugins/friends.styl +1 -2
- package/source/css/_components/tag-plugins/friends_posts.styl +160 -0
- package/source/css/_components/tag-plugins/sites.styl +21 -8
- package/source/js/services/friends_and_posts.js +57 -0
- package/source/js/services/sites.js +11 -4
package/_config.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
######## Stellar info ########
|
|
2
2
|
stellar:
|
|
3
|
-
version: '1.30.
|
|
3
|
+
version: '1.30.1'
|
|
4
4
|
homepage: 'https://xaoxuu.com/wiki/stellar/'
|
|
5
5
|
repo: 'https://github.com/xaoxuu/hexo-theme-stellar'
|
|
6
6
|
main_css: /css/main.css
|
|
@@ -145,7 +145,7 @@ notebook:
|
|
|
145
145
|
auto_excerpt: 128
|
|
146
146
|
# 可以为某个 tag 设定图标(显示在标签树中)。
|
|
147
147
|
tagcons:
|
|
148
|
-
'': solar:hashtag-
|
|
148
|
+
'': solar:hashtag-square-bold
|
|
149
149
|
# 每页显示多少篇笔记。0 表示不分页,null 则 fallback 到 hexo 的配置。
|
|
150
150
|
# 可以在笔记本 yaml 的 per_page 字段中覆盖此参数。
|
|
151
151
|
per_page: null
|
|
@@ -173,7 +173,7 @@ article:
|
|
|
173
173
|
# 如果没有指定封面,是否根据 tags 作为关键词搜索封面图片?
|
|
174
174
|
auto_cover: false # search from https://source.unsplash.com/
|
|
175
175
|
# 封面图宽高比
|
|
176
|
-
cover_ratio: 2
|
|
176
|
+
cover_ratio: 2
|
|
177
177
|
# 如果没有指定横幅,是否根据 tags 作为关键词搜索横幅图片?
|
|
178
178
|
auto_banner: false # search from https://source.unsplash.com/
|
|
179
179
|
# 如果没有指定 excerpt 和 description,将自动取多长的内容作为文章摘要?
|
|
@@ -356,11 +356,11 @@ tag_plugins:
|
|
|
356
356
|
interactive: false # enable interactive for user
|
|
357
357
|
# {% quot %}
|
|
358
358
|
quot:
|
|
359
|
-
default: #
|
|
360
|
-
prefix:
|
|
361
|
-
suffix:
|
|
359
|
+
default: # 可以自行配置多种图标方案,支持icons.yml中配置的图片key,也支持直接设置svg/png等文件链接
|
|
360
|
+
prefix: bxs:quote-left
|
|
361
|
+
suffix: bxs:quote-right
|
|
362
362
|
hashtag:
|
|
363
|
-
prefix:
|
|
363
|
+
prefix: solar:hashtag-square-bold
|
|
364
364
|
question:
|
|
365
365
|
prefix: ph:seal-question-fill
|
|
366
366
|
# {% emoji %}
|
|
@@ -446,6 +446,8 @@ data_services:
|
|
|
446
446
|
js: /js/services/sites.js
|
|
447
447
|
friends:
|
|
448
448
|
js: /js/services/friends.js
|
|
449
|
+
friends_and_posts:
|
|
450
|
+
js: /js/services/friends_and_posts.js
|
|
449
451
|
# 列表布局类
|
|
450
452
|
timeline:
|
|
451
453
|
js: /js/services/timeline.js
|
package/_data/icons.yml
CHANGED
|
@@ -8,7 +8,7 @@ solar:chat-square-like-bold-duotone: <svg xmlns="http://www.w3.org/2000/svg" wid
|
|
|
8
8
|
solar:planet-bold-duotone: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M20 12a8 8 0 1 1-16 0a8 8 0 0 1 16 0" opacity=".5"/><path fill="currentColor" d="M17.712 5.453c1.047-.193 2.006-.259 2.797-.152c.77.103 1.536.393 1.956 1.064c.446.714.312 1.542-.012 2.258c-.33.728-.918 1.499-1.672 2.268c-1.516 1.547-3.836 3.226-6.597 4.697c-2.763 1.472-5.495 2.484-7.694 2.92c-1.095.217-2.098.299-2.923.201c-.8-.095-1.6-.383-2.032-1.075c-.47-.752-.296-1.63.07-2.379c.375-.768 1.032-1.586 1.872-2.403L4 12.416c0 .219.083.71.168 1.146c.045.23.09.444.123.596c-.652.666-1.098 1.263-1.339 1.756c-.277.567-.208.825-.145.925c.072.116.305.305.937.38c.609.073 1.44.018 2.455-.183c2.02-.4 4.613-1.351 7.28-2.772c2.667-1.42 4.85-3.015 6.23-4.423c.694-.707 1.15-1.334 1.377-1.836c.233-.515.167-.75.107-.844c-.07-.112-.289-.294-.883-.374c-.542-.072-1.272-.041-2.163.112L16.87 5.656c.338-.101.658-.17.842-.203"/></svg>
|
|
9
9
|
solar:notebook-bookmark-bold-duotone: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M14.25 4.48v3.057c0 .111 0 .27.02.406a.936.936 0 0 0 .445.683a.96.96 0 0 0 .783.072c.13-.04.272-.108.378-.159L17 8.005l1.124.534c.106.05.248.119.378.16a.958.958 0 0 0 .783-.073a.936.936 0 0 0 .444-.683c.021-.136.021-.295.021-.406V3.031c.113-.005.224-.01.332-.013C21.154 2.98 22 3.86 22 4.933v11.21c0 1.112-.906 2.01-2.015 2.08c-.97.06-2.108.179-2.985.41c-1.082.286-1.99 1.068-3.373 1.436c-.626.167-1.324.257-1.627.323V5.174c.32-.079 1.382-.203 1.674-.371c.184-.107.377-.216.576-.323m5.478 8.338a.75.75 0 0 1-.546.91l-4 1a.75.75 0 0 1-.364-1.456l4-1a.75.75 0 0 1 .91.546" clip-rule="evenodd"/><path fill="currentColor" d="M18.25 3.151c-.62.073-1.23.18-1.75.336a8.2 8.2 0 0 0-.75.27v3.182l.75-.356l.008-.005a1.13 1.13 0 0 1 .492-.13c.047 0 .094.004.138.01c.175.029.315.1.354.12l.009.005l.749.356V3.647z"/><path fill="currentColor" d="M12 5.214c-.334-.064-1.057-.161-1.718-.339C8.938 4.515 8.05 3.765 7 3.487c-.887-.234-2.041-.352-3.018-.412C2.886 3.007 2 3.9 2 4.998v11.146c0 1.11.906 2.01 2.015 2.079c.97.06 2.108.179 2.985.41c.486.129 1.216.431 1.873.726c1.005.451 2.052.797 3.127 1.034z" opacity=".5"/><path fill="currentColor" d="M4.273 12.818a.75.75 0 0 1 .91-.545l4 1a.75.75 0 1 1-.365 1.455l-4-1a.75.75 0 0 1-.545-.91m.909-4.545a.75.75 0 1 0-.364 1.455l4 1a.75.75 0 0 0 .364-1.455z"/></svg>
|
|
10
10
|
solar:pin-linear: <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path d="m15.9894 4.9502.5306-.53006zm3.0822 3.08542-.5306.53006zm-10.33323 11.39338-.5306.5301zm-4.11668-4.1209.5306-.53zm12.94521-.3138-.2637-.7021zm-1.9171.7203.2638.7021zm-7.3176-7.33283-.70422-.25802zm.69445-1.89541.70422.25802zm-3.18161 4.18714.19934.723zm1.45663-.5384-.43821-.60864zm.37415-.34472.57083.48642zm6.57518 6.59012.491.567zm-.8704 1.8207-.7232-.199zm.5363-1.4546-.6094-.4372zm-11.19844-3.9914-.74998.0048zm.21199-.8031-.64992-.3743zm8.37475 9.391.0012-.75zm.7881-.2084-.3718-.6514zm-.396-19.09864.1615.73239zm-10.2279 19.43384c-.29274.2931-.2925.768.00054 1.0607s.76792.2925 1.06066-.0005zm5.71443-3.5978c.29274-.293.2925-.7679-.00054-1.0607-.29305-.2927-.76792-.2925-1.06066.0006zm8.27497-12.39184 3.0822 3.08542 1.0612-1.06012-3.0822-3.08542zm-6.18983 13.41864-4.11668-4.1208-1.0612 1.0601 4.11668 4.1209zm8.03423-4.6067-1.9172.7203.5276 1.4042 1.9171-.7203zm-8.26678-5.65241.69445-1.89541-1.40844-.51604-.69445 1.89541zm-2.99204 2.75671c.71145-.1962 1.25281-.334 1.69549-.6527l-.87641-1.21734c-.17293.12451-.39745.19782-1.21776.42398zm1.5836-3.27275c-.29296.79957-.3846 1.01778-.52299 1.18016l1.14166.97289c.35376-.41505.53565-.94343.78977-1.63701zm.11189 2.62005c.18709-.1347.35725-.2915.50678-.467l-1.14166-.97289c-.07129.08366-.15239.15838-.24153.22255zm7.64613 4.2687c-.689.2589-1.2144.4446-1.626.801l.982 1.134c.1608-.1393.3772-.2323 1.1716-.5308zm-1.2823 3.3876c.2253-.8188.2984-1.0432.4226-1.2163l-1.2188-.8744c-.3173.4423-.4546.9825-.6501 1.6928zm-.3437-2.5866c-.1697.147-.3216.3134-.4525.4959l1.2188.8744c.0624-.087.1348-.1663.2157-.2363zm-8.60771-1.0354c-.64614-.6468-1.0843-1.0871-1.36863-1.4443-.28531-.3585-.31477-.5137-.31521-.5833l-1.49997.0095c.00367.5822.29279 1.0697.64154 1.5079.34974.4394.86113.9497 1.48107 1.5703zm.49341-4.82766c-.84522.23306-1.54174.42386-2.06274.63306-.51955.2085-1.0118.4897-1.30243.9943l1.29985.7486c.03462-.0601.13655-.1804.56142-.3509.42343-.17 1.02157-.3361 1.90258-.579zm-2.17725 2.80006c-.00094-.1489.03771-.2952.11193-.4241l-1.29985-.7486c-.20699.3594-.31467.7674-.31205 1.1822zm4.73932 7.2086c.62387.6245 1.13687 1.1396 1.5787 1.4915.44053.3509.93143.6416 1.51763.6425l.0023-1.5c-.0695-.0001-.225-.0287-.5854-.3158-.3592-.2861-.80177-.7274-1.45203-1.3784zm4.44963-1.9569c-.2441.8875-.4112 1.4902-.5823 1.9166-.1718.4279-.293.5299-.3536.5645l.7435 1.3028c.509-.2905.7923-.7857 1.0021-1.3086.2105-.5243.4023-1.2259.6366-2.0774zm-1.3533 4.0909c.4071.0006.8073-.1052 1.1609-.307l-.7435-1.3028c-.1265.0722-.2696.11-.4151.1098zm7.2369-13.52742c1.0635 1.06454 1.7993 1.80382 2.2507 2.41312.4436.5986.4946.9171.4404 1.1676l1.4661.317c.1899-.878-.16-1.6472-.7013-2.3777-.5334-.71978-1.3664-1.55084-2.3947-2.58014zm-.7103 7.13072c1.3614-.5115 2.4633-.9234 3.2464-1.358.7947-.4411 1.4312-.9968 1.6211-1.875l-1.4661-.317c-.0541.2504-.232.5191-.883.8804-.6626.3678-1.6379.7364-3.0459 1.2654zm-1.3107-11.27626c-1.0359-1.03694-1.8719-1.87661-2.5954-2.41376-.7338-.54473-1.5071-.89726-2.3889-.70271l.3231 1.46478c.2498-.0551.5689-.00515 1.1716.4423.6129.45504 1.3572 1.19726 2.4284 2.26951zm-6.78913 2.32424c.52163-1.42363.88523-2.41035 1.25033-3.08123.359-.65977.6278-.83958.8776-.8947l-.3231-1.46478c-.8817.19452-1.4352.83965-1.87208 1.64251-.43084.79175-.83674 1.90536-1.34119 3.28216zm-7.20027 15.78572 4.65323-4.658-1.0612-1.0601-4.65323 4.6579z" fill="currentColor"/></svg>
|
|
11
|
-
solar:hashtag-
|
|
11
|
+
solar:hashtag-square-bold: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Solar by 480 Design - https://creativecommons.org/licenses/by/4.0/ --><path fill="currentColor" d="m14.092 10.75l-.75 2.5H9.908l.75-2.5z"/><path fill="currentColor" fill-rule="evenodd" d="M3.464 3.464C2 4.93 2 7.286 2 12s0 7.071 1.464 8.535C4.93 22 7.286 22 12 22s7.071 0 8.535-1.465C22 19.072 22 16.714 22 12s0-7.071-1.465-8.536C19.072 2 16.714 2 12 2S4.929 2 3.464 3.464m7.752 2.818a.75.75 0 0 1 .502.934l-.61 2.034h3.434l.74-2.465a.75.75 0 0 1 1.436.43l-.61 2.035H18a.75.75 0 0 1 0 1.5h-2.342l-.75 2.5H17a.75.75 0 0 1 0 1.5h-2.542l-.74 2.465a.75.75 0 0 1-1.436-.43l.61-2.035H9.458l-.74 2.465a.75.75 0 1 1-1.436-.43l.61-2.035H6a.75.75 0 0 1 0-1.5h2.342l.75-2.5H7a.75.75 0 0 1 0-1.5h2.542l.74-2.465a.75.75 0 0 1 .934-.503" clip-rule="evenodd"/></svg>
|
|
12
12
|
|
|
13
13
|
default:goback: <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor"><path fill-rule="evenodd" d="M7.78 12.53a.75.75 0 01-1.06 0L2.47 8.28a.75.75 0 010-1.06l4.25-4.25a.75.75 0 011.06 1.06L4.81 7h7.44a.75.75 0 010 1.5H4.81l2.97 2.97a.75.75 0 010 1.06z"></path></svg>
|
|
14
14
|
|
|
@@ -48,3 +48,5 @@ share:link: https://gcore.jsdelivr.net/gh/cdn-x/placeholder@1.0.12/social/8411ed
|
|
|
48
48
|
|
|
49
49
|
# quot icons
|
|
50
50
|
ph:seal-question-fill: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 256 256"><path fill="currentColor" d="M225.86 102.82c-3.77-3.94-7.67-8-9.14-11.57c-1.36-3.27-1.44-8.69-1.52-13.94c-.15-9.76-.31-20.82-8-28.51s-18.75-7.85-28.51-8c-5.25-.08-10.67-.16-13.94-1.52c-3.56-1.47-7.63-5.37-11.57-9.14C146.28 23.51 138.44 16 128 16s-18.27 7.51-25.18 14.14c-3.94 3.77-8 7.67-11.57 9.14c-3.25 1.36-8.69 1.44-13.94 1.52c-9.76.15-20.82.31-28.51 8s-7.8 18.75-8 28.51c-.08 5.25-.16 10.67-1.52 13.94c-1.47 3.56-5.37 7.63-9.14 11.57C23.51 109.72 16 117.56 16 128s7.51 18.27 14.14 25.18c3.77 3.94 7.67 8 9.14 11.57c1.36 3.27 1.44 8.69 1.52 13.94c.15 9.76.31 20.82 8 28.51s18.75 7.85 28.51 8c5.25.08 10.67.16 13.94 1.52c3.56 1.47 7.63 5.37 11.57 9.14c6.9 6.63 14.74 14.14 25.18 14.14s18.27-7.51 25.18-14.14c3.94-3.77 8-7.67 11.57-9.14c3.27-1.36 8.69-1.44 13.94-1.52c9.76-.15 20.82-.31 28.51-8s7.85-18.75 8-28.51c.08-5.25.16-10.67 1.52-13.94c1.47-3.56 5.37-7.63 9.14-11.57c6.63-6.9 14.14-14.74 14.14-25.18s-7.51-18.27-14.14-25.18M128 192a12 12 0 1 1 12-12a12 12 0 0 1-12 12m8-48.72v.72a8 8 0 0 1-16 0v-8a8 8 0 0 1 8-8c13.23 0 24-9 24-20s-10.77-20-24-20s-24 9-24 20v4a8 8 0 0 1-16 0v-4c0-19.85 17.94-36 40-36s40 16.15 40 36c0 17.38-13.76 31.93-32 35.28"/></svg>
|
|
51
|
+
bxs:quote-left: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from BoxIcons Solid by Atisa - https://creativecommons.org/licenses/by/4.0/ --><path fill="currentColor" d="M3.691 6.292C5.094 4.771 7.217 4 10 4h1v2.819l-.804.161c-1.37.274-2.323.813-2.833 1.604A2.9 2.9 0 0 0 6.925 10H10a1 1 0 0 1 1 1v7c0 1.103-.897 2-2 2H3a1 1 0 0 1-1-1v-5l.003-2.919c-.009-.111-.199-2.741 1.688-4.789M20 20h-6a1 1 0 0 1-1-1v-5l.003-2.919c-.009-.111-.199-2.741 1.688-4.789C16.094 4.771 18.217 4 21 4h1v2.819l-.804.161c-1.37.274-2.323.813-2.833 1.604A2.9 2.9 0 0 0 17.925 10H21a1 1 0 0 1 1 1v7c0 1.103-.897 2-2 2"/></svg>
|
|
52
|
+
bxs:quote-right: <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from BoxIcons Solid by Atisa - https://creativecommons.org/licenses/by/4.0/ --><path fill="currentColor" d="M20.309 17.708C22.196 15.66 22.006 13.03 22 13V5a1 1 0 0 0-1-1h-6c-1.103 0-2 .897-2 2v7a1 1 0 0 0 1 1h3.078a2.9 2.9 0 0 1-.429 1.396c-.508.801-1.465 1.348-2.846 1.624l-.803.16V20h1c2.783 0 4.906-.771 6.309-2.292m-11.007 0C11.19 15.66 10.999 13.03 10.993 13V5a1 1 0 0 0-1-1h-6c-1.103 0-2 .897-2 2v7a1 1 0 0 0 1 1h3.078a2.9 2.9 0 0 1-.429 1.396c-.508.801-1.465 1.348-2.846 1.624l-.803.16V20h1c2.783 0 4.906-.771 6.309-2.292"/></svg>
|
|
@@ -100,26 +100,30 @@ function div_default() {
|
|
|
100
100
|
}
|
|
101
101
|
function div_photo() {
|
|
102
102
|
var el = '';
|
|
103
|
-
|
|
104
|
-
el += '<img src="' + obj.image + '"/>';
|
|
103
|
+
var position = '';
|
|
105
104
|
if (obj.headline || obj.topic || obj.caption) {
|
|
106
|
-
el += '<div class="cover-info"';
|
|
107
|
-
if (obj.color) {
|
|
108
|
-
el += 'style="color:' + obj.color + '"';
|
|
109
|
-
}
|
|
110
105
|
if (obj.topic) {
|
|
111
|
-
|
|
106
|
+
position = 'top';
|
|
112
107
|
} else {
|
|
113
|
-
|
|
108
|
+
position = 'bottom';
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
el += '<div class="cover" position="' + position + '">';
|
|
112
|
+
el += '<img src="' + obj.image + '"/>';
|
|
113
|
+
if (position.length > 0) {
|
|
114
|
+
el += '<div class="cover-info" position="' + position + '"';
|
|
115
|
+
if (obj.color) {
|
|
116
|
+
el += 'style="color:' + obj.color + '"';
|
|
114
117
|
}
|
|
118
|
+
el += '>';
|
|
115
119
|
if (obj.topic) {
|
|
116
|
-
el += '<div class="
|
|
120
|
+
el += '<div class="text topic">' + obj.topic + '</div>';
|
|
117
121
|
}
|
|
118
122
|
if (obj.headline) {
|
|
119
|
-
el += '<div class="
|
|
123
|
+
el += '<div class="text headline">' + obj.headline + '</div>';
|
|
120
124
|
}
|
|
121
125
|
if (obj.caption) {
|
|
122
|
-
el += '<div class="
|
|
126
|
+
el += '<div class="text caption">' + obj.caption + '</div>';
|
|
123
127
|
}
|
|
124
128
|
el += '</div>';
|
|
125
129
|
|
package/package.json
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* friends.js v2 | https://github.com/xaoxuu/hexo-theme-stellar/
|
|
3
3
|
* 格式与官方标签插件一致使用空格分隔,中括号内的是可选参数(中括号不需要写出来)
|
|
4
4
|
*
|
|
5
|
-
* {% friends [group] [repo:owner/repo] [api:http] %}
|
|
5
|
+
* {% friends [group] [repo:owner/repo] [posts:true/false] [api:http] %}
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
'use strict'
|
|
9
9
|
|
|
10
10
|
module.exports = ctx => function(args) {
|
|
11
|
-
args = ctx.args.map(args, ['repo', 'api'], ['group'])
|
|
11
|
+
args = ctx.args.map(args, ['repo', 'api', 'posts'], ['group'])
|
|
12
12
|
var api
|
|
13
13
|
if (args.api) {
|
|
14
14
|
api = args.api
|
|
@@ -16,9 +16,9 @@ module.exports = ctx => function(args) {
|
|
|
16
16
|
api = 'https://api.vlts.cc/output_data/v2/' + args.repo
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
var el =
|
|
19
|
+
var el = `<div class="tag-plugin ${args.posts ? 'users-posts-wrap' : 'users-wrap'}">`
|
|
20
20
|
if (api) {
|
|
21
|
-
el += `<div class="ds-friends" ${ctx.args.joinTags(args, ['size']).join(' ')} api="${api}"><div class="grid-box"></div></div>`
|
|
21
|
+
el += `<div class="ds-friends${args.posts ? '_and_posts' : ''}" ${ctx.args.joinTags(args, ['size']).join(' ')} api="${api}"><div class="grid-box"></div></div>`
|
|
22
22
|
} else if (args.group) {
|
|
23
23
|
const links = ctx.theme.config.links || {}
|
|
24
24
|
el += '<div class="grid-box">'
|
|
@@ -30,7 +30,7 @@ module.exports = ctx => function(args) {
|
|
|
30
30
|
if (item?.url && item?.title) {
|
|
31
31
|
el += `<div class="grid-cell site-card">`
|
|
32
32
|
el += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.url}">`
|
|
33
|
-
el += `<img src="${item.cover || item.screenshot || ('https://image.thum.io/get/width/1280/crop/720/' + item.url)}" onerror="javascript:this.removeAttribute("data-src");this.src="${ctx.theme.config.default.cover}";"/>`
|
|
33
|
+
el += `<img src="${item.cover || item.snapshot || item.screenshot || ('https://image.thum.io/get/width/1280/crop/720/' + item.url)}" onerror="javascript:this.removeAttribute("data-src");this.src="${ctx.theme.config.default.cover}";"/>`
|
|
34
34
|
el += `<div class="info">`
|
|
35
35
|
el += `<img src="${item.icon || item.avatar || ctx.theme.config.default.link}" onerror="javascript:this.removeAttribute("data-src");this.src="${item.icon || item.avatar || ctx.theme.config.default.link}";"/>`
|
|
36
36
|
el += `<span class="title">${item.title}</span>`
|
|
@@ -23,13 +23,23 @@
|
|
|
23
23
|
.post-list .post-card
|
|
24
24
|
display: block
|
|
25
25
|
margin: 1rem 0
|
|
26
|
-
border-radius: $border-card
|
|
26
|
+
border-radius: $border-card-l
|
|
27
27
|
background: var(--card)
|
|
28
28
|
hoverable-card()
|
|
29
29
|
overflow: hidden
|
|
30
30
|
z-index: 0
|
|
31
|
-
|
|
32
31
|
position: relative
|
|
32
|
+
--img-br: 100%
|
|
33
|
+
--img-sat: 100%
|
|
34
|
+
--blur-px: 1em
|
|
35
|
+
--blur-sat: 120%
|
|
36
|
+
&:hover
|
|
37
|
+
--img-br: 75%
|
|
38
|
+
--img-sat: 120%
|
|
39
|
+
--blur-sat: 200%
|
|
40
|
+
img
|
|
41
|
+
filter: brightness(var(--img-br)) saturate(var(--img-sat))
|
|
42
|
+
trans1 all
|
|
33
43
|
.excerpt
|
|
34
44
|
margin: 1rem 0
|
|
35
45
|
@media screen and (max-width: $device-mobile)
|
|
@@ -62,9 +72,6 @@
|
|
|
62
72
|
svg
|
|
63
73
|
color: $c-red
|
|
64
74
|
|
|
65
|
-
.post-list.post .post-card:hover
|
|
66
|
-
img
|
|
67
|
-
filter: brightness(50%)
|
|
68
75
|
|
|
69
76
|
// common article
|
|
70
77
|
.post-list .md-text
|
|
@@ -100,7 +107,23 @@
|
|
|
100
107
|
img
|
|
101
108
|
width: 100%
|
|
102
109
|
object-fit: cover
|
|
103
|
-
aspect-ratio: hexo-config('article.cover_ratio')
|
|
110
|
+
aspect-ratio: hexo-config('article.cover_ratio')
|
|
111
|
+
z-index 0
|
|
112
|
+
&:before
|
|
113
|
+
content: ''
|
|
114
|
+
z-index 1
|
|
115
|
+
position: absolute
|
|
116
|
+
left: 0
|
|
117
|
+
right: 0
|
|
118
|
+
height: 128px
|
|
119
|
+
backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
|
|
120
|
+
trans1 all
|
|
121
|
+
&[position=top]:before
|
|
122
|
+
top: 0
|
|
123
|
+
mask: linear-gradient(black, rgba(black, 0.75), transparent)
|
|
124
|
+
&[position=bottom]:before
|
|
125
|
+
bottom: 0
|
|
126
|
+
mask: linear-gradient(transparent, rgba(black, 0.75), black)
|
|
104
127
|
.cover-info
|
|
105
128
|
padding: 1.5rem 1rem
|
|
106
129
|
position: absolute
|
|
@@ -108,6 +131,7 @@
|
|
|
108
131
|
width: 'calc(100% - %s * 2)' % 1rem
|
|
109
132
|
--text-banner: white
|
|
110
133
|
color: var(--text-banner)
|
|
134
|
+
z-index: 2
|
|
111
135
|
&[position=top]
|
|
112
136
|
top: 0
|
|
113
137
|
background-image: linear-gradient(rgba(0,0,0,0.2),rgba(0,0,0,0))
|
|
@@ -116,20 +140,25 @@
|
|
|
116
140
|
background-image: linear-gradient(rgba(0,0,0,0),rgba(0,0,0,0.2))
|
|
117
141
|
div+div
|
|
118
142
|
margin-top: 4px
|
|
119
|
-
.
|
|
120
|
-
font-size: $fs-13
|
|
143
|
+
.text
|
|
121
144
|
color: unset
|
|
122
|
-
|
|
145
|
+
trans1 all
|
|
146
|
+
text-shadow: 0 2px 4px rgba(0,0,0,0.2)
|
|
147
|
+
.topic
|
|
148
|
+
font-size: $fs-13
|
|
149
|
+
.headline
|
|
123
150
|
font-weight: 500
|
|
124
151
|
font-size: $fsh3
|
|
152
|
+
.caption
|
|
153
|
+
font-size: $fs-14
|
|
125
154
|
@media screen and (max-width: $device-mobile)
|
|
126
155
|
padding: 1rem
|
|
127
156
|
div+div
|
|
128
157
|
margin-top: 2px
|
|
129
|
-
.
|
|
158
|
+
.headline
|
|
130
159
|
font-size: $fsh4
|
|
131
|
-
.
|
|
132
|
-
font-size: $fs-
|
|
160
|
+
.caption
|
|
161
|
+
font-size: $fs-13
|
|
133
162
|
h2
|
|
134
163
|
margin: .25rem 0
|
|
135
164
|
font-size: $fsh4
|
|
@@ -31,20 +31,34 @@
|
|
|
31
31
|
// 动画配置
|
|
32
32
|
.article.banner
|
|
33
33
|
.bg+.content
|
|
34
|
-
trans1 all
|
|
35
34
|
--blur-bg: rgba(black, 0)
|
|
36
35
|
--blur-px: 0px
|
|
37
36
|
--blur-sat: 100%
|
|
38
|
-
|
|
39
|
-
@supports ((-webkit-backdrop-filter:blur(var(--blur-px))) or (backdrop-filter:blur(var(--blur-px))))
|
|
40
|
-
background: var(--blur-bg)
|
|
41
|
-
backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
|
|
42
|
-
-webkit-backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
|
|
43
|
-
&:hover
|
|
44
|
-
.bg+.content
|
|
37
|
+
&:hover
|
|
45
38
|
--blur-bg: rgba(black, 0.1)
|
|
46
|
-
--blur-px:
|
|
39
|
+
--blur-px: 1em
|
|
47
40
|
--blur-sat: 150%
|
|
41
|
+
background: var(--blur-bg)
|
|
42
|
+
trans1 all
|
|
43
|
+
&:before,&:after
|
|
44
|
+
content: ''
|
|
45
|
+
position: absolute
|
|
46
|
+
z-index 0
|
|
47
|
+
left: 0
|
|
48
|
+
width: 100%
|
|
49
|
+
backdrop-filter: saturate(var(--blur-sat)) blur(var(--blur-px))
|
|
50
|
+
trans1 all
|
|
51
|
+
&:before
|
|
52
|
+
top: 0
|
|
53
|
+
height: 4rem
|
|
54
|
+
mask: linear-gradient(black, rgba(black, 0.75), transparent)
|
|
55
|
+
&:after
|
|
56
|
+
bottom: 0
|
|
57
|
+
height: 5rem
|
|
58
|
+
mask: linear-gradient(transparent, rgba(black, 0.75), black)
|
|
59
|
+
.top,.bottom
|
|
60
|
+
z-index 1
|
|
61
|
+
|
|
48
62
|
|
|
49
63
|
.article.banner
|
|
50
64
|
--button-hover-bg: rgba(black, 0.05)
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
.users-posts-wrap .grid-box
|
|
2
|
+
display: grid
|
|
3
|
+
grid-template-columns: 1fr
|
|
4
|
+
grid-gap: 2px
|
|
5
|
+
overflow: hidden
|
|
6
|
+
border-radius: $border-card
|
|
7
|
+
|
|
8
|
+
.users-posts-wrap .user-post-card
|
|
9
|
+
display: grid
|
|
10
|
+
grid-template-columns: 1fr 2fr
|
|
11
|
+
grid-gap: 16px
|
|
12
|
+
font-weight: 500
|
|
13
|
+
border-radius: 4px
|
|
14
|
+
background: var(--block)
|
|
15
|
+
padding: 1rem
|
|
16
|
+
div,span
|
|
17
|
+
line-height: 1.2
|
|
18
|
+
.labels
|
|
19
|
+
margin-top: 4px
|
|
20
|
+
display: flex
|
|
21
|
+
flex-wrap: wrap
|
|
22
|
+
align-items: center
|
|
23
|
+
justify-content: center
|
|
24
|
+
pointer-events: none
|
|
25
|
+
user-select: none
|
|
26
|
+
.label
|
|
27
|
+
color: white
|
|
28
|
+
font-size: 12px
|
|
29
|
+
padding: 3px 6px 2px 6px
|
|
30
|
+
margin: 4px 2px 0 2px
|
|
31
|
+
line-height: 1
|
|
32
|
+
border-radius: 16px
|
|
33
|
+
.avatar-box
|
|
34
|
+
display: flex
|
|
35
|
+
justify-content: center
|
|
36
|
+
flex-direction: column
|
|
37
|
+
align-items: center
|
|
38
|
+
padding: 1rem
|
|
39
|
+
.card-link
|
|
40
|
+
color: var(--text-p1)
|
|
41
|
+
display: flex
|
|
42
|
+
justify-content: flex-start
|
|
43
|
+
flex-direction: column
|
|
44
|
+
align-items: center
|
|
45
|
+
text-align: center
|
|
46
|
+
border-radius: 4px
|
|
47
|
+
position: relative
|
|
48
|
+
flex-shrink: 0
|
|
49
|
+
trans1 width
|
|
50
|
+
span
|
|
51
|
+
display: -webkit-box
|
|
52
|
+
-webkit-box-orient: vertical
|
|
53
|
+
overflow: hidden
|
|
54
|
+
-webkit-line-clamp: 1
|
|
55
|
+
position: relative
|
|
56
|
+
.title
|
|
57
|
+
font-size: $fs-14
|
|
58
|
+
font-weight: 500
|
|
59
|
+
margin-top: 1rem
|
|
60
|
+
max-width: 100%
|
|
61
|
+
img
|
|
62
|
+
object-fit: cover
|
|
63
|
+
display: block
|
|
64
|
+
width: 64px
|
|
65
|
+
height: 64px
|
|
66
|
+
background: var(--card)
|
|
67
|
+
border-radius: 64px
|
|
68
|
+
floatable-trans()
|
|
69
|
+
|
|
70
|
+
.previews
|
|
71
|
+
display: flex
|
|
72
|
+
justify-content: space-between
|
|
73
|
+
flex-direction: column
|
|
74
|
+
height: 100%
|
|
75
|
+
position: relative
|
|
76
|
+
.empty
|
|
77
|
+
min-height: 1rem
|
|
78
|
+
.desc
|
|
79
|
+
font-size: 1.2rem
|
|
80
|
+
color: var(--text-p3)
|
|
81
|
+
font-weight: 400
|
|
82
|
+
margin: 1rem 0
|
|
83
|
+
margin-right: auto
|
|
84
|
+
position: relative
|
|
85
|
+
&:before
|
|
86
|
+
position: absolute
|
|
87
|
+
font-weight: 900
|
|
88
|
+
font-size: 32px
|
|
89
|
+
color: var(--block-border)
|
|
90
|
+
top: 0
|
|
91
|
+
content: '“'
|
|
92
|
+
left: -20px
|
|
93
|
+
trans1 all
|
|
94
|
+
.spacer
|
|
95
|
+
height: 100%
|
|
96
|
+
.posts
|
|
97
|
+
margin: 0.5rem 0 1rem 0
|
|
98
|
+
display: flex
|
|
99
|
+
flex-direction: column
|
|
100
|
+
align-items: flex-start
|
|
101
|
+
.post-link
|
|
102
|
+
display: flex
|
|
103
|
+
flex-direction: column
|
|
104
|
+
color: var(--text-p1)
|
|
105
|
+
position: relative
|
|
106
|
+
trans1 color
|
|
107
|
+
&+.post-link
|
|
108
|
+
margin-top: 1rem
|
|
109
|
+
&:before
|
|
110
|
+
content: ''
|
|
111
|
+
position: absolute
|
|
112
|
+
left: -12px
|
|
113
|
+
top: 2px
|
|
114
|
+
height: 'calc(%s - 2px)' % $fs-14
|
|
115
|
+
width: 4px
|
|
116
|
+
border-radius: 4px
|
|
117
|
+
background: var(--block-border)
|
|
118
|
+
trans1 all
|
|
119
|
+
&:hover:before
|
|
120
|
+
background: $color-hover
|
|
121
|
+
// height: calc(100% - 4px)
|
|
122
|
+
height: 100%
|
|
123
|
+
top: 0
|
|
124
|
+
span
|
|
125
|
+
display: -webkit-box
|
|
126
|
+
-webkit-box-orient: vertical
|
|
127
|
+
overflow: hidden
|
|
128
|
+
-webkit-line-clamp: 1
|
|
129
|
+
position: relative
|
|
130
|
+
.title
|
|
131
|
+
font-size: $fs-14
|
|
132
|
+
font-weight: 500
|
|
133
|
+
max-width: 100%
|
|
134
|
+
display: -webkit-box
|
|
135
|
+
-webkit-box-orient: vertical
|
|
136
|
+
overflow: hidden
|
|
137
|
+
-webkit-line-clamp: 2
|
|
138
|
+
position: relative
|
|
139
|
+
.date
|
|
140
|
+
font-size: $fs-12
|
|
141
|
+
color: var(--text-p3)
|
|
142
|
+
margin-top: 0.25rem
|
|
143
|
+
.no-post
|
|
144
|
+
font-size: $fs-13
|
|
145
|
+
color: var(--text-p4)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
// transform
|
|
149
|
+
.users-posts-wrap .user-post-card
|
|
150
|
+
&:hover
|
|
151
|
+
.desc
|
|
152
|
+
&:before
|
|
153
|
+
color: $color-hover
|
|
154
|
+
transform: scale(1.2) translateX(-4px)
|
|
155
|
+
.card-link:hover
|
|
156
|
+
img
|
|
157
|
+
transform: scale(1.2) rotate(8deg)
|
|
158
|
+
box-shadow: $boxshadow-card-float
|
|
159
|
+
.post-link:hover
|
|
160
|
+
color: $color-hover
|
|
@@ -48,20 +48,33 @@
|
|
|
48
48
|
overflow: hidden
|
|
49
49
|
-webkit-line-clamp: 1
|
|
50
50
|
|
|
51
|
-
.
|
|
51
|
+
.labels
|
|
52
52
|
position: absolute
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
top: 2px
|
|
54
|
+
right: 2px
|
|
55
|
+
display: flex
|
|
56
|
+
flex-wrap: wrap
|
|
57
|
+
justify-content: flex-end
|
|
58
|
+
pointer-events: none
|
|
59
|
+
user-select: none
|
|
60
|
+
opacity 1
|
|
61
|
+
trans1 all
|
|
62
|
+
.label
|
|
63
|
+
font-weight: 500
|
|
64
|
+
color: white
|
|
65
|
+
font-size: 12px
|
|
66
|
+
padding: 3px 6px 2px 6px
|
|
67
|
+
margin: 2px
|
|
68
|
+
line-height: 1
|
|
69
|
+
border-radius: 16px
|
|
60
70
|
|
|
61
71
|
// transform
|
|
62
72
|
.sites-wrap .site-card .card-link
|
|
63
73
|
>img
|
|
64
74
|
floatable-trans()
|
|
65
75
|
&:hover
|
|
76
|
+
.labels
|
|
77
|
+
opacity 0
|
|
78
|
+
transform: translateY(-4px)
|
|
66
79
|
>img
|
|
67
80
|
floatable-float()
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
utils.jq(() => {
|
|
2
|
+
$(function () {
|
|
3
|
+
const els = document.getElementsByClassName('ds-friends_and_posts');
|
|
4
|
+
for (var i = 0; i < els.length; i++) {
|
|
5
|
+
const el = els[i];
|
|
6
|
+
const api = el.getAttribute('api');
|
|
7
|
+
if (api == null) {
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
const default_avatar = def.avatar;
|
|
11
|
+
// layout
|
|
12
|
+
utils.request(el, api, function(data) {
|
|
13
|
+
for (let item of (data.content || data)) {
|
|
14
|
+
var cell = `<div class="grid-cell user-post-card">`;
|
|
15
|
+
cell += `<div class="avatar-box">`;
|
|
16
|
+
cell += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.html_url || item.url}">`;;
|
|
17
|
+
cell += `<img src="${item.avatar_url || item.avatar || item.icon || default_avatar}" onerror="javascript:this.removeAttribute(\'data-src\');this.src=\'${default_avatar}\';"/>`;
|
|
18
|
+
cell += `<span class="title">${item.title || item.login}</span>`;
|
|
19
|
+
cell += `</a>`;
|
|
20
|
+
cell += `<div class="labels">`;
|
|
21
|
+
for (let label of item.labels) {
|
|
22
|
+
if (label.lightness > 75) {
|
|
23
|
+
cell += `<div class="label" style="background:#${label.color};color:hsla(${label.hue}, ${label.saturation}%, 20%, 1);">${label.name}</div>`;
|
|
24
|
+
} else if (label.saturation > 90 && label.lightness > 40) {
|
|
25
|
+
cell += `<div class="label" style="background:#${label.color};color:hsla(${label.hue}, 50%, 20%, 1);">${label.name}</div>`;
|
|
26
|
+
} else {
|
|
27
|
+
cell += `<div class="label" style="background:#${label.color};color:white">${label.name}</div>`;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
cell += `</div>`;
|
|
31
|
+
cell += `</div>`;
|
|
32
|
+
cell += `<div class="previews">`;
|
|
33
|
+
if (item.description) {
|
|
34
|
+
cell += `<div class="desc">${item.description || item.issue_number || ''}</div>`;
|
|
35
|
+
} else {
|
|
36
|
+
cell += `<div class="desc">#${item.issue_number}</div>`;
|
|
37
|
+
}
|
|
38
|
+
cell += `<div class="posts">`;
|
|
39
|
+
if (item.posts?.length > 0) {
|
|
40
|
+
for (let post of item.posts) {
|
|
41
|
+
cell += `<a class="post-link" target="_blank" rel="external nofollow noopener noreferrer" href="${post.link}">`;
|
|
42
|
+
cell += `<span class="title">${post.title}</span>`;
|
|
43
|
+
cell += `<span class="date">${post.published}</span>`;
|
|
44
|
+
cell += `</a>`;
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
cell += `<span class="no-post">${item.feed?.length > 0 ? 'RSS 解析失败' : '未设置 RSS 链接'}</span>`;
|
|
48
|
+
}
|
|
49
|
+
cell += `</div>`;
|
|
50
|
+
cell += `</div>`;
|
|
51
|
+
cell += `</div>`;
|
|
52
|
+
$(el).find('.grid-box').append(cell);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -14,14 +14,21 @@ utils.jq(() => {
|
|
|
14
14
|
for (let item of data.content) {
|
|
15
15
|
var cell = `<div class="grid-cell site-card">`;
|
|
16
16
|
cell += `<a class="card-link" target="_blank" rel="external nofollow noopener noreferrer" href="${item.url}">`;
|
|
17
|
-
cell += `<img src="${item.cover || item.screenshot}" onerror="javascript:this.removeAttribute(\'data-src\');this.src=\'${default_cover}\';"/>`;
|
|
17
|
+
cell += `<img src="${item.cover || item.snapshot || item.screenshot}" onerror="javascript:this.removeAttribute(\'data-src\');this.src=\'${default_cover}\';"/>`;
|
|
18
18
|
cell += `<div class="info">`;
|
|
19
19
|
cell += `<img src="${item.icon || item.avatar || default_avatar}" onerror="javascript:this.removeAttribute(\'data-src\');this.src=\'${default_avatar}\';"/>`;
|
|
20
20
|
cell += `<span class="title">${item.title}</span>`;
|
|
21
21
|
cell += `<span class="desc">${item.description || item.url}</span>`;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
cell += `</div>`;
|
|
23
|
+
cell += `<div class="labels">`;
|
|
24
|
+
for (let label of item.labels) {
|
|
25
|
+
if (label.lightness > 75) {
|
|
26
|
+
cell += `<div class="label" style="background:#${label.color};color:hsla(${label.hue}, ${label.saturation}%, 20%, 1);">${label.name}</div>`;
|
|
27
|
+
} else if (label.saturation > 90 && label.lightness > 40) {
|
|
28
|
+
cell += `<div class="label" style="background:#${label.color};color:hsla(${label.hue}, 50%, 20%, 1);">${label.name}</div>`;
|
|
29
|
+
} else {
|
|
30
|
+
cell += `<div class="label" style="background:#${label.color};color:white">${label.name}</div>`;
|
|
31
|
+
}
|
|
25
32
|
}
|
|
26
33
|
cell += `</div>`;
|
|
27
34
|
cell += `</a>`;
|