Skip to content

Commit 85a95bf

Browse files
update
1 parent e0d8a63 commit 85a95bf

File tree

4 files changed

+185
-3
lines changed

4 files changed

+185
-3
lines changed

README.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# 访客统计使用说明
2+
3+
## 📊 关于访客统计
4+
5+
本站使用 **不蒜子(Busuanzi)** 统计服务,可以统计**所有访客**的真实访问数据。
6+
7+
## 🔍 如何查看访客统计
8+
9+
### 方法 1:点击按钮
10+
点击网页**左下角**的隐蔽 **📊 图标**(半透明,悬停时会显示)
11+
12+
### 方法 2:快捷键(推荐)
13+
**Ctrl + Shift + S** (Mac 用户按 Cmd + Shift + S)
14+
15+
### 输入密码
16+
默认密码:**rise123**
17+
18+
## ⚠️ 重要提示
19+
20+
### 本地测试显示"加载中"是正常的!
21+
22+
不蒜子统计**必须部署到服务器**才能工作:
23+
- ❌ 本地打开(`file://`)无法统计,会显示"加载中"
24+
- ✅ 部署到 GitHub Pages 或服务器后才能正常显示数据
25+
- ✅ 通过 `http://``https://` 访问才有效
26+
27+
**部署后就能看到真实的访问统计了!**
28+
29+
## 📈 统计内容
30+
31+
- 🌐 **本站总访问量** - 整个网站所有页面的访问次数(PV)
32+
- 👥 **本站访客数** - 访问网站的独立用户数(UV)
33+
- 📄 **本页访问量** - 当前页面的访问次数
34+
35+
## 🔐 修改密码
36+
37+
编辑文件:`assets/js/main.js`**1088**
38+
39+
```javascript
40+
const OWNER_PASSWORD = "rise123";
41+
```
42+
43+
## 💡 说明
44+
45+
- ✅ 使用不蒜子服务,数据**所有人共享**
46+
- ✅ 统计全网访客的真实访问量
47+
- ✅ 只有你(输入密码)能看到统计数据
48+
- ✅ 访客看不到统计,不影响页面显示
49+
- ✅ 完全免费,无需注册
50+
51+
## 🚀 如何部署(让统计生效)
52+
53+
### 方法 1:GitHub Pages
54+
```bash
55+
git add .
56+
git commit -m "add visitor stats"
57+
git push origin main
58+
```
59+
然后在 GitHub 仓库设置中开启 Pages
60+
61+
### 方法 2:其他服务器
62+
上传到任何支持静态网页的服务器即可
63+
64+
**部署后访问网站,统计数据就会正常显示!**
65+
66+
## 📝 其他
67+
68+
- **关闭面板**:点击"关闭"按钮
69+
- **查看原始数据**:访问 [不蒜子官网](http://busuanzi.ibruce.info/)
70+
71+
---
72+
73+
就这么简单!😊

assets/css/style.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,4 +1469,16 @@ main .caption { opacity: 1 !important; }
14691469
.hero-overlay .hero-title {
14701470
margin-top: 0;
14711471
}
1472+
}
1473+
1474+
/* ===== Visitor Stats Button (Hidden at bottom) ===== */
1475+
#statsBtn:hover {
1476+
opacity: 0.8 !important;
1477+
background: rgba(91, 124, 250, 0.2) !important;
1478+
transform: scale(1.15);
1479+
}
1480+
1481+
#statsBtn:active {
1482+
transform: scale(0.9);
1483+
opacity: 1 !important;
14721484
}

assets/js/main.js

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ window.addEventListener("load", ()=>{
538538
setupBackToTop();
539539
setupFadeInAnimations();
540540
setupActiveNav();
541+
setupVisitorCounter();
541542
});
542543

543544
/* ===== Hero video interactions ===== */
@@ -1080,4 +1081,94 @@ function setupFadeInAnimations(){
10801081
});
10811082

10821083
elements.forEach(el => observer.observe(el));
1084+
}
1085+
1086+
/* ===== Busuanzi Visitor Counter (Owner Only) ===== */
1087+
function setupVisitorCounter(){
1088+
const OWNER_PASSWORD = "rise123"; // 修改为你自己的密码
1089+
1090+
// 创建统计面板
1091+
function createStatsPanel(){
1092+
const panel = document.createElement('div');
1093+
panel.id = 'visitorStatsPanel';
1094+
panel.style.cssText = `
1095+
position: fixed;
1096+
bottom: 20px;
1097+
right: 20px;
1098+
background: white;
1099+
border: 2px solid #5b7cfa;
1100+
border-radius: 12px;
1101+
padding: 20px;
1102+
max-width: 350px;
1103+
box-shadow: 0 4px 20px rgba(0,0,0,0.2);
1104+
z-index: 9999;
1105+
font-family: system-ui, -apple-system, Segoe UI;
1106+
font-size: 14px;
1107+
display: none;
1108+
`;
1109+
panel.innerHTML = `
1110+
<div style="margin-bottom: 16px; font-weight: 700; font-size: 16px; color: #5b7cfa; border-bottom: 2px solid #e6e6e6; padding-bottom: 10px;">📊 访客统计(不蒜子)</div>
1111+
<div style="margin-bottom: 8px; color: #333; line-height: 1.8;">
1112+
<div style="margin-bottom: 8px; display: flex; justify-content: space-between;">
1113+
<span>🌐 本站总访问量:</span>
1114+
<strong style="color: #5b7cfa;"><span id="busuanzi_value_site_pv">--</span> 次</strong>
1115+
</div>
1116+
<div style="margin-bottom: 8px; display: flex; justify-content: space-between;">
1117+
<span>👥 本站访客数:</span>
1118+
<strong style="color: #5b7cfa;"><span id="busuanzi_value_site_uv">--</span> 人</strong>
1119+
</div>
1120+
<div style="margin-bottom: 8px; display: flex; justify-content: space-between;">
1121+
<span>📄 本页访问量:</span>
1122+
<strong style="color: #5b7cfa;"><span id="busuanzi_value_page_pv">--</span> 次</strong>
1123+
</div>
1124+
</div>
1125+
<div style="margin-top: 12px; padding-top: 12px; border-top: 1px solid #e6e6e6; font-size: 12px; color: #999;">
1126+
统计数据由 <a href="http://busuanzi.ibruce.info/" target="_blank" style="color: #5b7cfa;">不蒜子</a> 提供
1127+
</div>
1128+
<button id="closeStats" style="width: 100%; padding: 10px; margin-top: 12px; background: #5b7cfa; color: white; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600;">关闭</button>
1129+
`;
1130+
document.body.appendChild(panel);
1131+
1132+
// 关闭按钮
1133+
document.getElementById('closeStats').addEventListener('click', () => {
1134+
panel.style.display = 'none';
1135+
});
1136+
1137+
return panel;
1138+
}
1139+
1140+
// 打开统计面板(需要密码)
1141+
function showStatsPanel(){
1142+
const pwd = prompt('请输入访客统计密码:');
1143+
if(pwd === OWNER_PASSWORD){
1144+
const panel = document.getElementById('visitorStatsPanel') || createStatsPanel();
1145+
panel.style.display = 'block';
1146+
1147+
// 等待不蒜子数据加载
1148+
setTimeout(() => {
1149+
const pv = document.getElementById('busuanzi_value_site_pv');
1150+
if(pv && pv.textContent === '--'){
1151+
pv.textContent = '加载中...';
1152+
}
1153+
}, 500);
1154+
} else if(pwd !== null){
1155+
alert('密码错误!');
1156+
}
1157+
}
1158+
1159+
window.showStatsPanel = showStatsPanel;
1160+
1161+
// 绑定按钮
1162+
const statsBtn = document.getElementById('statsBtn');
1163+
if(statsBtn){
1164+
statsBtn.addEventListener('click', showStatsPanel);
1165+
}
1166+
1167+
// 添加快捷键:Ctrl+Shift+S 打开统计
1168+
document.addEventListener('keydown', (e) => {
1169+
if(e.ctrlKey && e.shiftKey && e.code === 'KeyS'){
1170+
e.preventDefault();
1171+
showStatsPanel();
1172+
}
1173+
});
10831174
}

index.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,21 +188,21 @@ <h3>Continuous Success achieved by RISE</h3>
188188
<div class="carousel-track" id="track">
189189
<article class="carousel-card">
190190
<div class="video-wrapper">
191-
<video style="pointer-events: none;" src="https://assets.kinetixai.cn/rise3/backpack_continuous_21_RISE_compressed.mp4" autoplay muted loop playsinline preload="metadata"></video>
191+
<video style="pointer-events: none;" src="https://assets.kinetixai.cn/rise3/backpack_continuous_21_RISE_v2.mp4" autoplay muted loop playsinline preload="metadata"></video>
192192
</div>
193193
<div class="carousel-caption">Backpack Packing</div>
194194
</article>
195195

196196
<article class="carousel-card">
197197
<div class="video-wrapper">
198-
<video style="pointer-events: none;" src="https://assets.kinetixai.cn/rise3/conveyor_continuous_11_RISE_compressed.mp4" autoplay muted loop playsinline preload="metadata"></video>
198+
<video style="pointer-events: none;" src="https://assets.kinetixai.cn/rise3/conveyor_continuous_11_RISE_v2.mp4" autoplay muted loop playsinline preload="metadata"></video>
199199
</div>
200200
<div class="carousel-caption">Dynamic Brick Sorting</div>
201201
</article>
202202

203203
<article class="carousel-card">
204204
<div class="video-wrapper">
205-
<video style="pointer-events: none;" src="https://assets.kinetixai.cn/rise3/box_continuous_10_RISE_compressed.mp4" autoplay muted loop playsinline preload="metadata"></video>
205+
<video style="pointer-events: none;" src="https://assets.kinetixai.cn/rise3/box_continuous_10_RISE_v2.mp4" autoplay muted loop playsinline preload="metadata"></video>
206206
</div>
207207
<div class="carousel-caption">Box Closing</div>
208208
</article>
@@ -682,6 +682,9 @@ <h2>BibTeX</h2>
682682

683683
</main>
684684

685+
<!-- 隐蔽的访客统计入口 - 左下角 -->
686+
<div id="statsBtn" style="position: fixed; bottom: 10px; left: 10px; width: 24px; height: 24px; background: rgba(200, 200, 200, 0.15); border-radius: 4px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; opacity: 0.3; transition: all 0.2s; z-index: 50;" title="访客统计 (Ctrl+Shift+S)">📊</div>
687+
685688
<!-- Modal -->
686689
<div id="modal" style="display:none; position:fixed; inset:0; background:rgba(0,0,0,.82); z-index:100; align-items:center; justify-content:center; padding:18px" onclick="closeModal()">
687690
<div style="max-width:1100px; width:100%" onclick="event.stopPropagation()">
@@ -697,6 +700,9 @@ <h2>BibTeX</h2>
697700
</svg>
698701
</button>
699702

703+
<!-- 不蒜子访客统计 -->
704+
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
705+
700706
<script src="assets/js/main.js"></script>
701707
<script>
702708
document.querySelectorAll("video").forEach(v=>{

0 commit comments

Comments
 (0)