';
diff --git a/source/css/_layout/md.styl b/source/css/_layout/md.styl
index c81556b..8bb63e3 100644
--- a/source/css/_layout/md.styl
+++ b/source/css/_layout/md.styl
@@ -68,9 +68,6 @@ article.md.content
.tag-plugin,iframe
margin-top: var(--gap-p)
margin-bottom: var(--gap-p)
- p,.tag-plugin
- .highlight,table
- --gap-p: 1rem
iframe
display: block
diff --git a/source/css/_layout/sidebar/widgets.styl b/source/css/_layout/sidebar/widgets.styl
index 5021613..429f972 100644
--- a/source/css/_layout/sidebar/widgets.styl
+++ b/source/css/_layout/sidebar/widgets.styl
@@ -100,5 +100,4 @@
display: none
&+.timenode
margin-top: 0.75rem
- .body
- max-height: 40vh
+
\ No newline at end of file
diff --git a/source/css/_layout/tag-plugins/split.styl b/source/css/_layout/tag-plugins/split.styl
index 20b16e6..50d3129 100644
--- a/source/css/_layout/tag-plugins/split.styl
+++ b/source/css/_layout/tag-plugins/split.styl
@@ -1,10 +1,10 @@
-.md .tag-plugin.split
- margin: 0.5rem 0
.tag-plugin.split
display: grid
grid-gap: 16px
grid-template-columns: repeat(auto-fill, "calc((100% - 1 * %s) / 2)" % 16px)
- >div>
+ >.cell
+ margin: 1rem 0
+ >.cell>
p
line-height: 1.5
:first-child
@@ -18,11 +18,15 @@
.tag-plugin.split
- &[bg]>div
+ @media screen and (max-width: $device-tablet)
+ display: block
+
+.tag-plugin.split
+ &[bg]>.cell
padding: 1rem
border-radius: $border-card
- &[bg='block']>div
+ &[bg='block']>.cell
background: var(--block)
- &[bg='card']>div
+ &[bg='card']>.cell
background: var(--card)
box-shadow: $boxshadow-card
\ No newline at end of file
diff --git a/source/css/_layout/tag-plugins/timeline.styl b/source/css/_layout/tag-plugins/timeline.styl
index eef45bd..d7ff3d4 100644
--- a/source/css/_layout/tag-plugins/timeline.styl
+++ b/source/css/_layout/tag-plugins/timeline.styl
@@ -113,15 +113,32 @@
.tag-plugin.copy
width: 240px
+.tag-plugin.timeline[api]
+ &.stellar-fcircle-api .timenode:hover .header
+ .user-info
+ background: inherit
+ span
+ color: inherit
+ a.body
+ color: var(--text-p1)
+ trans2: transform box-shadow
+ line-height: 1.25
+ padding: 0.75rem 1rem
+ &:hover
+ transform: translateY(-1px)
+ box-shadow: $boxshadow-card-float
-.tag-plugin.timeline.stellar-timeline-api .body
- max-height: convert(hexo-config('tag_plugins.timeline.max-height'))
+
+.tag-plugin.timeline[api] .body
overflow: scroll
- p.title
+ p.title
font-size: 1rem
font-weight: 700
margin: 0.5rem 0 0.75rem
line-height: 1.25
+ &:only-child
+ margin-bottom: 0.5rem
+ font-weight: 500
a
color: inherit
&:hover
@@ -136,7 +153,7 @@
pre code
font-size: $fs-12
-.tag-plugin.timeline.stellar-timeline-api .body .footer
+.tag-plugin.timeline[api] .body .footer
margin: 0 0 -0.5rem
padding: 0.5rem 0 1rem
user-select: none
@@ -159,7 +176,7 @@
font-size: $fs-12
align-items: stretch
-.tag-plugin.timeline.stellar-timeline-api .body .footer
+.tag-plugin.timeline[api] .body .footer
.item
border-width: 1px
border-style: solid
diff --git a/source/js/plugins/fcircle.js b/source/js/plugins/fcircle.js
new file mode 100644
index 0000000..00e7249
--- /dev/null
+++ b/source/js/plugins/fcircle.js
@@ -0,0 +1,91 @@
+const FCircle = {
+ requestAPI: (url, callback, timeout) => {
+ let retryTimes = 5;
+ function request() {
+ return new Promise((resolve, reject) => {
+ let status = 0; // 0 等待 1 完成 2 超时
+ let timer = setTimeout(() => {
+ if (status === 0) {
+ status = 2;
+ timer = null;
+ reject('请求超时');
+ if (retryTimes == 0) {
+ timeout();
+ }
+ }
+ }, 5000);
+ fetch(url).then(function(response) {
+ if (status !== 2) {
+ clearTimeout(timer);
+ resolve(response);
+ timer = null;
+ status = 1;
+ }
+ if (response.ok) {
+ return response.json();
+ }
+ throw new Error('Network response was not ok.');
+ }).then(function(data) {
+ retryTimes = 0;
+ callback(data);
+ }).catch(function(error) {
+ if (retryTimes > 0) {
+ retryTimes -= 1;
+ setTimeout(() => {
+ request();
+ }, 5000);
+ } else {
+ timeout();
+ }
+ });
+ });
+ }
+ request();
+ },
+ layoutDiv: (cfg) => {
+ const el = $(cfg.el)[0];
+ $(el).append('
');
+ FCircle.requestAPI(cfg.api, function(data) {
+ $(el).find('.loading-wrap').remove();
+ const arr = data.article_data || [];
+ const limit = el.getAttribute('limit');
+ arr.forEach((item, i) => {
+ if (limit && i >= limit) {
+ return;
+ }
+ var cell = '
';
+ $(el).append(cell);
+ });
+ }, function() {
+ $(el).find('.loading-wrap svg').remove();
+ $(el).find('.loading-wrap').append('
');
+ $(el).find('.loading-wrap').addClass('error');
+ });
+ },
+}
+
+$(function () {
+ const els = document.getElementsByClassName('stellar-fcircle-api');
+ for (var i = 0; i < els.length; i++) {
+ const el = els[i];
+ const api = el.getAttribute('api');
+ if (api == null) {
+ continue;
+ }
+ var obj = new Object();
+ obj.el = el;
+ obj.api = api;
+ FCircle.layoutDiv(obj);
+ }
+});