|
863 | 863 | line-height: 1.45; |
864 | 864 | } |
865 | 865 |
|
| 866 | +/* ── blog ── */ |
| 867 | +.blog-grid { |
| 868 | + display: grid; |
| 869 | + grid-template-columns: repeat(3, 1fr); |
| 870 | + gap: 2px; |
| 871 | +} |
| 872 | + |
| 873 | +.blog-card { |
| 874 | + padding: 1.5rem 1.65rem; |
| 875 | + background: var(--surface); |
| 876 | + border: 1px solid var(--border); |
| 877 | + clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px)); |
| 878 | + display: flex; |
| 879 | + flex-direction: column; |
| 880 | + gap: 0.5rem; |
| 881 | + transition: all 0.3s ease; |
| 882 | +} |
| 883 | + |
| 884 | +.blog-card:hover { |
| 885 | + background: var(--surface-2); |
| 886 | + border-color: var(--border-h); |
| 887 | +} |
| 888 | + |
| 889 | +.blog-date { |
| 890 | + font-family: var(--mono); |
| 891 | + font-size: 0.78rem; |
| 892 | + color: var(--text-3); |
| 893 | +} |
| 894 | + |
| 895 | +.blog-title { |
| 896 | + font-family: var(--display); |
| 897 | + font-size: 1.15rem; |
| 898 | + font-weight: 700; |
| 899 | + color: var(--text); |
| 900 | + line-height: 1.35; |
| 901 | +} |
| 902 | + |
| 903 | +.blog-excerpt { |
| 904 | + font-size: 0.88rem; |
| 905 | + color: var(--text-2); |
| 906 | + line-height: 1.55; |
| 907 | + display: -webkit-box; |
| 908 | + -webkit-line-clamp: 2; |
| 909 | + -webkit-box-orient: vertical; |
| 910 | + overflow: hidden; |
| 911 | +} |
| 912 | + |
| 913 | +.blog-more { |
| 914 | + margin-top: 1.5rem; |
| 915 | + text-align: center; |
| 916 | +} |
| 917 | + |
| 918 | +.blog-more a { |
| 919 | + font-family: var(--mono); |
| 920 | + font-size: 0.85rem; |
| 921 | + font-weight: 600; |
| 922 | + color: var(--text-3); |
| 923 | + transition: color 0.2s; |
| 924 | +} |
| 925 | + |
| 926 | +.blog-more a:hover { color: var(--blue); } |
| 927 | + |
866 | 928 | /* ── footer ── */ |
867 | 929 | .foot { |
868 | 930 | padding: 1.75rem 0; |
|
961 | 1023 | .stats { flex-direction: column; } |
962 | 1024 | .stat { border-right: none; border-bottom: 1px solid var(--border); } |
963 | 1025 | .stat:last-child { border-bottom: none; } |
964 | | - .timeline, .products, .matrix, .mx-scenarios { grid-template-columns: 1fr !important; } |
| 1026 | + .timeline, .products, .matrix, .mx-scenarios, .blog-grid { grid-template-columns: 1fr !important; } |
965 | 1027 | .mx-total { flex-direction: column; gap: 1.25rem; } |
966 | 1028 | .foot-in { flex-direction: column; gap: 0.75rem; align-items: flex-start; } |
967 | 1029 | } |
@@ -1275,6 +1337,18 @@ <h3 class="prod-name" style="color:var(--red);text-shadow:0 0 30px var(--red-glo |
1275 | 1337 | </div> |
1276 | 1338 | </section> |
1277 | 1339 |
|
| 1340 | +<div class="divider"><span class="num">005</span> BLOG</div> |
| 1341 | +<section class="sec" id="blog"> |
| 1342 | + <div class="w"> |
| 1343 | + <div class="sec-head rv"> |
| 1344 | + <div class="sec-tag">最新动态</div> |
| 1345 | + <h2 class="sec-title">Blog</h2> |
| 1346 | + </div> |
| 1347 | + <div class="blog-grid rv" id="blogGrid"></div> |
| 1348 | + <div class="blog-more rv"><a href="/wiki/blog/">查看全部文章 →</a></div> |
| 1349 | + </div> |
| 1350 | +</section> |
| 1351 | + |
1278 | 1352 | </main> |
1279 | 1353 |
|
1280 | 1354 | <footer class="foot"> |
@@ -1337,6 +1411,41 @@ <h3 class="prod-name" style="color:var(--red);text-shadow:0 0 30px var(--red-glo |
1337 | 1411 |
|
1338 | 1412 | document.querySelectorAll('.rv').forEach(function(el) { io.observe(el); }); |
1339 | 1413 |
|
| 1414 | + var blogGrid = document.getElementById('blogGrid'); |
| 1415 | + if (blogGrid) { |
| 1416 | + fetch('/wiki/blog/') |
| 1417 | + .then(function(r) { return r.text(); }) |
| 1418 | + .then(function(html) { |
| 1419 | + var doc = new DOMParser().parseFromString(html, 'text/html'); |
| 1420 | + var articles = doc.querySelectorAll('article'); |
| 1421 | + var count = 0; |
| 1422 | + articles.forEach(function(article) { |
| 1423 | + if (count >= 6) return; |
| 1424 | + var titleEl = article.querySelector('h2 a') || article.querySelector('h2'); |
| 1425 | + if (!titleEl) return; |
| 1426 | + var title = titleEl.textContent.trim(); |
| 1427 | + if (!title) return; |
| 1428 | + var href = titleEl.getAttribute('href') || ''; |
| 1429 | + if (href && !href.startsWith('http')) href = '/wiki' + href; |
| 1430 | + var excerpt = ''; |
| 1431 | + var contentEl = article.querySelector('.md-post__content p, section p'); |
| 1432 | + if (contentEl) excerpt = contentEl.textContent.trim().substring(0, 80); |
| 1433 | + var dateStr = ''; |
| 1434 | + var timeEl = article.querySelector('time'); |
| 1435 | + if (timeEl) dateStr = timeEl.getAttribute('datetime') || timeEl.textContent.trim(); |
| 1436 | + var card = document.createElement('a'); |
| 1437 | + card.className = 'blog-card'; |
| 1438 | + card.href = href; |
| 1439 | + if (dateStr) card.innerHTML += '<div class="blog-date">' + dateStr + '</div>'; |
| 1440 | + card.innerHTML += '<div class="blog-title">' + title + '</div>'; |
| 1441 | + if (excerpt) card.innerHTML += '<div class="blog-excerpt">' + excerpt + '</div>'; |
| 1442 | + blogGrid.appendChild(card); |
| 1443 | + count++; |
| 1444 | + }); |
| 1445 | + }) |
| 1446 | + .catch(function() {}); |
| 1447 | + } |
| 1448 | + |
1340 | 1449 | fetch('https://api.github.com/orgs/chainreactors/repos?per_page=100') |
1341 | 1450 | .then(function(r) { return r.json(); }) |
1342 | 1451 | .then(function(repos) { |
|
0 commit comments