mirror of
http://junepve.top:3000/chicrobot/mainPage.git
synced 2026-10-30 01:51:29 +08:00
添加博客跳转
This commit is contained in:
1 parent
bf80cc9150
commit
816caaae5b
2 files changed
+21
-3
No files matched your search
+3
-3
@@ -226,7 +226,7 @@
|
||||
<div class="container" data-parallax="0.2">
|
||||
<h2 class="section-title"><span class="text-cyan">最新思路</span></h2>
|
||||
<div class="thoughts-grid">
|
||||
<article class="thought-card glass-card" onclick="window.open('/blog/post1', '_blank')">
|
||||
<article class="thought-card glass-card">
|
||||
<div class="thought-image" style="background-image: url('./static/code1.avif');"></div>
|
||||
<div class="thought-content">
|
||||
<h3>赛博朋克时代的前端架构思考</h3>
|
||||
@@ -235,7 +235,7 @@
|
||||
<span class="read-more">继续阅读 <i class="fas fa-arrow-right"></i></span>
|
||||
</div>
|
||||
</article>
|
||||
<article class="thought-card glass-card" onclick="window.open('/blog/post2', '_blank')">
|
||||
<article class="thought-card glass-card">
|
||||
<div class="thought-image" style="background-image: url('./static/code2.avif');"></div>
|
||||
<div class="thought-content">
|
||||
<h3>从0到1搭建个人技术栈</h3>
|
||||
@@ -244,7 +244,7 @@
|
||||
<span class="read-more">继续阅读 <i class="fas fa-arrow-right"></i></span>
|
||||
</div>
|
||||
</article>
|
||||
<article class="thought-card glass-card" onclick="window.open('/blog/post3', '_blank')">
|
||||
<article class="thought-card glass-card">
|
||||
<div class="thought-image" style="background-image: url('./static/code3.avif');"></div>
|
||||
<div class="thought-content">
|
||||
<h3>未来界面:玻璃拟态与全息效果</h3>
|
||||
|
||||
@@ -53,6 +53,9 @@ window.addEventListener('load', function() {
|
||||
const jenkinsUrl = `${window.location.protocol}//${currentHost}:9095`;
|
||||
const chatUrl = `${window.location.protocol}//${currentHost}/baseTalk`;
|
||||
const cloudreveUrl = `${window.location.protocol}//${currentHost}:5212`;
|
||||
// 构建博客文章URL,指向8090端口
|
||||
const blogBaseUrl = `${window.location.protocol}//${currentHost}:8090`;
|
||||
|
||||
// 设置链接的href属性和target属性,确保在新标签中打开
|
||||
const portainerLink = document.getElementById('portainerLink');
|
||||
const giteaLink = document.getElementById('giteaLink');
|
||||
@@ -60,6 +63,7 @@ window.addEventListener('load', function() {
|
||||
const jenkinsLink = document.getElementById('jenkinsLink');
|
||||
const chatLink = document.getElementById('chatLink');
|
||||
const cloudreveLink = document.getElementById('cloudreveLink');
|
||||
|
||||
if (portainerLink) {
|
||||
portainerLink.href = portainerUrl;
|
||||
portainerLink.target = '_blank';
|
||||
@@ -84,6 +88,20 @@ window.addEventListener('load', function() {
|
||||
cloudreveLink.href = cloudreveUrl;
|
||||
cloudreveLink.target = '_blank';
|
||||
}
|
||||
|
||||
// 处理博客文章链接
|
||||
const blogPosts = document.querySelectorAll('.thought-card');
|
||||
blogPosts.forEach((post, index) => {
|
||||
// 移除原有的onclick属性
|
||||
post.removeAttribute('onclick');
|
||||
// 添加新的点击事件监听器
|
||||
post.addEventListener('click', function() {
|
||||
// const postPath = `/blog/post${index + 1}`;
|
||||
// const postUrl = `${blogBaseUrl}${postPath}`;
|
||||
const postUrl = `${blogBaseUrl}`;
|
||||
window.open(postUrl, '_blank');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 粒子背景效果
|
||||
|
||||
Reference in new issue
Block a user