60sapi接口搭建完毕,数据库连接测试成功,登录注册部分简单完成

This commit is contained in:
2025-09-02 19:45:50 +08:00
parent b139fb14d9
commit e1f8885c6c
150 changed files with 53045 additions and 8 deletions

View File

@@ -0,0 +1,40 @@
.background-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
overflow: hidden;
}
.rainbow-gradient {
position: absolute;
top: -50%;
left: -50%;
width: 200%;
height: 200%;
background: linear-gradient(
217deg,
rgba(255, 0, 0, 0.6),
rgba(255, 0, 0, 0) 70.71%
), linear-gradient(
127deg,
rgba(0, 255, 0, 0.6),
rgba(0, 255, 0, 0) 70.71%
), linear-gradient(
336deg,
rgba(0, 0, 255, 0.6),
rgba(0, 0, 255, 0) 70.71%
);
animation: rainbow-rotate 15s linear infinite;
}
@keyframes rainbow-rotate {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}

View File

@@ -0,0 +1,155 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
color: #333;
background-color: #f5f5f5;
position: relative;
min-height: 100vh;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 20px;
position: relative;
z-index: 1;
background-color: rgba(255, 255, 255, 0.85);
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
header {
text-align: center;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid #eaeaea;
}
header h1 {
color: #07a35a;
margin-bottom: 10px;
font-size: 2rem;
}
.update-time {
color: #888;
font-size: 0.9rem;
}
.hot-list {
list-style: none;
}
.hot-item {
padding: 15px;
margin-bottom: 10px;
border-radius: 8px;
background-color: white;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
transition: transform 0.2s, box-shadow 0.2s;
display: flex;
align-items: center;
}
.hot-item:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.hot-rank {
font-size: 1.2rem;
font-weight: bold;
color: #ff8200;
margin-right: 15px;
min-width: 30px;
text-align: center;
}
.hot-rank.top-1 {
color: #ff4500;
}
.hot-rank.top-2, .hot-rank.top-3 {
color: #ff6600;
}
.hot-content {
flex: 1;
}
.hot-title {
font-size: 1.1rem;
margin-bottom: 5px;
color: #333;
text-decoration: none;
display: block;
}
.hot-title:hover {
color: #07a35a;
}
.hot-value {
font-size: 0.85rem;
color: #888;
}
.loading {
text-align: center;
padding: 20px;
color: #888;
}
footer {
text-align: center;
margin-top: 30px;
padding-top: 15px;
border-top: 1px solid #eaeaea;
color: #888;
font-size: 0.9rem;
}
/* 响应式设计 */
/* 手机端 */
@media (max-width: 576px) {
.container {
padding: 15px;
margin: 10px;
}
header h1 {
font-size: 1.5rem;
}
.hot-item {
padding: 12px;
}
.hot-rank {
font-size: 1rem;
min-width: 25px;
margin-right: 10px;
}
.hot-title {
font-size: 1rem;
}
}
/* 平板端 */
@media (min-width: 577px) and (max-width: 992px) {
.container {
max-width: 90%;
}
header h1 {
font-size: 1.8rem;
}
}
/* 电脑端 - 默认样式已经设置 */

View File

@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>微博热搜榜</title>
<link rel="stylesheet" href="./css/style.css">
<link rel="stylesheet" href="./css/background.css">
</head>
<body>
<div class="background-container">
<div class="rainbow-gradient"></div>
</div>
<div class="container">
<header>
<h1>微博热搜榜</h1>
<div class="update-time" id="updateTime"></div>
</header>
<main>
<div class="hot-list" id="hotList">
<div class="loading">加载中...</div>
</div>
</main>
<footer>
<p>数据来源于微博热搜榜</p>
</footer>
</div>
<script src="./js/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,94 @@
// API接口列表
const API_ENDPOINTS = [
"https://60s-cf.viki.moe/v2/weibo",
"https://60s.viki.moe/v2/weibo",
"https://60s.b23.run/v2/weibo",
"https://60s.114128.xyz/v2/weibo",
"https://60s-cf.114128.xyz/v2/weibo"
];
// 当前使用的API索引
let currentApiIndex = 0;
// DOM元素
const hotListElement = document.getElementById('hotList');
const updateTimeElement = document.getElementById('updateTime');
// 格式化时间
function formatDate(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = String(date.getHours()).padStart(2, '0');
const minutes = String(date.getMinutes()).padStart(2, '0');
const seconds = String(date.getSeconds()).padStart(2, '0');
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
// 渲染热搜列表
function renderHotList(data) {
hotListElement.innerHTML = '';
data.forEach((item, index) => {
const hotItem = document.createElement('div');
hotItem.className = 'hot-item';
const rankClass = index < 3 ? `top-${index + 1}` : '';
hotItem.innerHTML = `
<div class="hot-rank ${rankClass}">${index + 1}</div>
<div class="hot-content">
<a href="${item.link}" class="hot-title" target="_blank">${item.title}</a>
${item.hot_value ? `<div class="hot-value">${item.hot_value}</div>` : ''}
</div>
`;
hotListElement.appendChild(hotItem);
});
// 更新时间
updateTimeElement.textContent = `更新时间:${formatDate(new Date())}`;
}
// 获取微博热搜数据
async function fetchWeiboHotList() {
try {
const response = await fetch(API_ENDPOINTS[currentApiIndex]);
if (!response.ok) {
throw new Error('网络响应不正常');
}
const result = await response.json();
if (result.code === 200 && result.data) {
renderHotList(result.data);
} else {
throw new Error('数据格式错误');
}
} catch (error) {
console.error('获取数据失败:', error);
// 尝试切换到下一个API
currentApiIndex = (currentApiIndex + 1) % API_ENDPOINTS.length;
// 显示错误信息
hotListElement.innerHTML = `
<div class="loading">
获取数据失败,正在尝试其他接口...
</div>
`;
// 延迟后重试
setTimeout(fetchWeiboHotList, 2000);
}
}
// 页面加载完成后获取数据
document.addEventListener('DOMContentLoaded', () => {
fetchWeiboHotList();
// 每隔5分钟刷新一次数据
setInterval(fetchWeiboHotList, 5 * 60 * 1000);
});

View File

@@ -0,0 +1,7 @@
[
"https://60s-cf.viki.moe",
"https://60s.viki.moe",
"https://60s.b23.run",
"https://60s.114128.xyz",
"https://60s-cf.114128.xyz"
]

View File

@@ -0,0 +1,261 @@
{
"code": 200,
"message": "获取成功。数据来自官方/权威源头,以确保稳定与实时。开源地址 https://github.com/vikiboss/60s反馈群 595941841",
"data": [
{
"title": "00后男生0.6秒飞针采血惊呆患者",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=00%E5%90%8E%E7%94%B7%E7%94%9F0.6%E7%A7%92%E9%A3%9E%E9%92%88%E9%87%87%E8%A1%80%E6%83%8A%E5%91%86%E6%82%A3%E8%80%85"
},
{
"title": "普京带3位副总理10多位部长到中国",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E6%99%AE%E4%BA%AC%E5%B8%A63%E4%BD%8D%E5%89%AF%E6%80%BB%E7%90%8610%E5%A4%9A%E4%BD%8D%E9%83%A8%E9%95%BF%E5%88%B0%E4%B8%AD%E5%9B%BD"
},
{
"title": "始终高举上海精神旗帜",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%A7%8B%E7%BB%88%E9%AB%98%E4%B8%BE%E4%B8%8A%E6%B5%B7%E7%B2%BE%E7%A5%9E%E6%97%97%E5%B8%9C"
},
{
"title": "女生苦练化妆1年的变化",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%A5%B3%E7%94%9F%E8%8B%A6%E7%BB%83%E5%8C%96%E5%A6%861%E5%B9%B4%E7%9A%84%E5%8F%98%E5%8C%96"
},
{
"title": "香港1200架无人机重现日本投降矣",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E9%A6%99%E6%B8%AF1200%E6%9E%B6%E6%97%A0%E4%BA%BA%E6%9C%BA%E9%87%8D%E7%8E%B0%E6%97%A5%E6%9C%AC%E6%8A%95%E9%99%8D%E7%9F%A3"
},
{
"title": "尚公主全阵容官宣",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%B0%9A%E5%85%AC%E4%B8%BB%E5%85%A8%E9%98%B5%E5%AE%B9%E5%AE%98%E5%AE%A3"
},
{
"title": "真的可以永远相信刘宇舞台",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E7%9C%9F%E7%9A%84%E5%8F%AF%E4%BB%A5%E6%B0%B8%E8%BF%9C%E7%9B%B8%E4%BF%A1%E5%88%98%E5%AE%87%E8%88%9E%E5%8F%B0"
},
{
"title": "九三阅兵徒步方队铿锵步伐",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E4%B9%9D%E4%B8%89%E9%98%85%E5%85%B5%E5%BE%92%E6%AD%A5%E6%96%B9%E9%98%9F%E9%93%BF%E9%94%B5%E6%AD%A5%E4%BC%90"
},
{
"title": "唐朝诡事录",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%94%90%E6%9C%9D%E8%AF%A1%E4%BA%8B%E5%BD%95"
},
{
"title": "抗战胜利80周年第3场记者招待会",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E6%8A%97%E6%88%98%E8%83%9C%E5%88%A980%E5%91%A8%E5%B9%B4%E7%AC%AC3%E5%9C%BA%E8%AE%B0%E8%80%85%E6%8B%9B%E5%BE%85%E4%BC%9A"
},
{
"title": "王曼昱钱天一3比2蒯曼孙颖莎",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E7%8E%8B%E6%9B%BC%E6%98%B1%E9%92%B1%E5%A4%A9%E4%B8%803%E6%AF%942%E8%92%AF%E6%9B%BC%E5%AD%99%E9%A2%96%E8%8E%8E"
},
{
"title": "张维伊对96岁的姥姥说长命百岁",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%BC%A0%E7%BB%B4%E4%BC%8A%E5%AF%B996%E5%B2%81%E7%9A%84%E5%A7%A5%E5%A7%A5%E8%AF%B4%E9%95%BF%E5%91%BD%E7%99%BE%E5%B2%81"
},
{
"title": "孟子义李昀锐定妆照",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%AD%9F%E5%AD%90%E4%B9%89%E6%9D%8E%E6%98%80%E9%94%90%E5%AE%9A%E5%A6%86%E7%85%A7"
},
{
"title": "以为张艺兴穿的蓝色抹胸",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E4%BB%A5%E4%B8%BA%E5%BC%A0%E8%89%BA%E5%85%B4%E7%A9%BF%E7%9A%84%E8%93%9D%E8%89%B2%E6%8A%B9%E8%83%B8"
},
{
"title": "尚公主开机",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%B0%9A%E5%85%AC%E4%B8%BB%E5%BC%80%E6%9C%BA"
},
{
"title": "心动的信号8",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%BF%83%E5%8A%A8%E7%9A%84%E4%BF%A1%E5%8F%B78"
},
{
"title": "霍建华病娇疯批演爽了",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E9%9C%8D%E5%BB%BA%E5%8D%8E%E7%97%85%E5%A8%87%E7%96%AF%E6%89%B9%E6%BC%94%E7%88%BD%E4%BA%86"
},
{
"title": "普京抵达天津",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E6%99%AE%E4%BA%AC%E6%8A%B5%E8%BE%BE%E5%A4%A9%E6%B4%A5"
},
{
"title": "龚俊的体面只给旅游前几天",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E9%BE%9A%E4%BF%8A%E7%9A%84%E4%BD%93%E9%9D%A2%E5%8F%AA%E7%BB%99%E6%97%85%E6%B8%B8%E5%89%8D%E5%87%A0%E5%A4%A9"
},
{
"title": "开学焦虑更严重的另有其人",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%BC%80%E5%AD%A6%E7%84%A6%E8%99%91%E6%9B%B4%E4%B8%A5%E9%87%8D%E7%9A%84%E5%8F%A6%E6%9C%89%E5%85%B6%E4%BA%BA"
},
{
"title": "那英小发雷霆",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E9%82%A3%E8%8B%B1%E5%B0%8F%E5%8F%91%E9%9B%B7%E9%9C%86"
},
{
"title": "居然有演员一句台词背1小时",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%B1%85%E7%84%B6%E6%9C%89%E6%BC%94%E5%91%98%E4%B8%80%E5%8F%A5%E5%8F%B0%E8%AF%8D%E8%83%8C1%E5%B0%8F%E6%97%B6"
},
{
"title": "谁教魏哲鸣冷脸跳这些的",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E8%B0%81%E6%95%99%E9%AD%8F%E5%93%B2%E9%B8%A3%E5%86%B7%E8%84%B8%E8%B7%B3%E8%BF%99%E4%BA%9B%E7%9A%84"
},
{
"title": "朱孝天爆冷出局",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E6%9C%B1%E5%AD%9D%E5%A4%A9%E7%88%86%E5%86%B7%E5%87%BA%E5%B1%80"
},
{
"title": "俄军称掌握战略主动权",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E4%BF%84%E5%86%9B%E7%A7%B0%E6%8E%8C%E6%8F%A1%E6%88%98%E7%95%A5%E4%B8%BB%E5%8A%A8%E6%9D%83"
},
{
"title": "谈恋爱3个月定律",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E8%B0%88%E6%81%8B%E7%88%B13%E4%B8%AA%E6%9C%88%E5%AE%9A%E5%BE%8B"
},
{
"title": "沈腾说错了最怕人笨还不勤快",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E6%B2%88%E8%85%BE%E8%AF%B4%E9%94%99%E4%BA%86%E6%9C%80%E6%80%95%E4%BA%BA%E7%AC%A8%E8%BF%98%E4%B8%8D%E5%8B%A4%E5%BF%AB"
},
{
"title": "王菲最新状态",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E7%8E%8B%E8%8F%B2%E6%9C%80%E6%96%B0%E7%8A%B6%E6%80%81"
},
{
"title": "张紫宁转行当拉拉队经理人了",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%BC%A0%E7%B4%AB%E5%AE%81%E8%BD%AC%E8%A1%8C%E5%BD%93%E6%8B%89%E6%8B%89%E9%98%9F%E7%BB%8F%E7%90%86%E4%BA%BA%E4%BA%86"
},
{
"title": "金价大涨两大原因",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E9%87%91%E4%BB%B7%E5%A4%A7%E6%B6%A8%E4%B8%A4%E5%A4%A7%E5%8E%9F%E5%9B%A0"
},
{
"title": "陕西Shaanxi官方标准拼音",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E9%99%95%E8%A5%BFShaanxi%E5%AE%98%E6%96%B9%E6%A0%87%E5%87%86%E6%8B%BC%E9%9F%B3"
},
{
"title": "边伯贤跳刀马刀马",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E8%BE%B9%E4%BC%AF%E8%B4%A4%E8%B7%B3%E5%88%80%E9%A9%AC%E5%88%80%E9%A9%AC"
},
{
"title": "冷冻太久的肉就不要再吃了",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%86%B7%E5%86%BB%E5%A4%AA%E4%B9%85%E7%9A%84%E8%82%89%E5%B0%B1%E4%B8%8D%E8%A6%81%E5%86%8D%E5%90%83%E4%BA%86"
},
{
"title": "95后00后恋爱有代沟",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=95%E5%90%8E00%E5%90%8E%E6%81%8B%E7%88%B1%E6%9C%89%E4%BB%A3%E6%B2%9F"
},
{
"title": "易烊千玺抢票",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E6%98%93%E7%83%8A%E5%8D%83%E7%8E%BA%E6%8A%A2%E7%A5%A8"
},
{
"title": "孙闻被乒协处罚",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%AD%99%E9%97%BB%E8%A2%AB%E4%B9%92%E5%8D%8F%E5%A4%84%E7%BD%9A"
},
{
"title": "这居然是白举纲",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E8%BF%99%E5%B1%85%E7%84%B6%E6%98%AF%E7%99%BD%E4%B8%BE%E7%BA%B2"
},
{
"title": "纪凌尘出演孟子义新剧",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E7%BA%AA%E5%87%8C%E5%B0%98%E5%87%BA%E6%BC%94%E5%AD%9F%E5%AD%90%E4%B9%89%E6%96%B0%E5%89%A7"
},
{
"title": "外卖员妈妈暴雨中将孩子托付派出所",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%A4%96%E5%8D%96%E5%91%98%E5%A6%88%E5%A6%88%E6%9A%B4%E9%9B%A8%E4%B8%AD%E5%B0%86%E5%AD%A9%E5%AD%90%E6%89%98%E4%BB%98%E6%B4%BE%E5%87%BA%E6%89%80"
},
{
"title": "我点外卖没用上券就这样",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E6%88%91%E7%82%B9%E5%A4%96%E5%8D%96%E6%B2%A1%E7%94%A8%E4%B8%8A%E5%88%B8%E5%B0%B1%E8%BF%99%E6%A0%B7"
},
{
"title": "孙颖莎小时候真来过新疆",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%AD%99%E9%A2%96%E8%8E%8E%E5%B0%8F%E6%97%B6%E5%80%99%E7%9C%9F%E6%9D%A5%E8%BF%87%E6%96%B0%E7%96%86"
},
{
"title": "印尼首都交通瘫痪",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%8D%B0%E5%B0%BC%E9%A6%96%E9%83%BD%E4%BA%A4%E9%80%9A%E7%98%AB%E7%97%AA"
},
{
"title": "停狗位停满了小狗",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%81%9C%E7%8B%97%E4%BD%8D%E5%81%9C%E6%BB%A1%E4%BA%86%E5%B0%8F%E7%8B%97"
},
{
"title": "怪不得校服裤子屁股锃亮",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E6%80%AA%E4%B8%8D%E5%BE%97%E6%A0%A1%E6%9C%8D%E8%A3%A4%E5%AD%90%E5%B1%81%E8%82%A1%E9%94%83%E4%BA%AE"
},
{
"title": "这一幕幕中国浪漫看得心暖暖",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E8%BF%99%E4%B8%80%E5%B9%95%E5%B9%95%E4%B8%AD%E5%9B%BD%E6%B5%AA%E6%BC%AB%E7%9C%8B%E5%BE%97%E5%BF%83%E6%9A%96%E6%9A%96"
},
{
"title": "林书豪退役",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E6%9E%97%E4%B9%A6%E8%B1%AA%E9%80%80%E5%BD%B9"
},
{
"title": "小猫咪舔毛把自己累睡着",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%B0%8F%E7%8C%AB%E5%92%AA%E8%88%94%E6%AF%9B%E6%8A%8A%E8%87%AA%E5%B7%B1%E7%B4%AF%E7%9D%A1%E7%9D%80"
},
{
"title": "iPhone17国行预计涨价500元",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=iPhone17%E5%9B%BD%E8%A1%8C%E9%A2%84%E8%AE%A1%E6%B6%A8%E4%BB%B7500%E5%85%83"
},
{
"title": "土耳其总统埃尔多安抵达天津",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%9C%9F%E8%80%B3%E5%85%B6%E6%80%BB%E7%BB%9F%E5%9F%83%E5%B0%94%E5%A4%9A%E5%AE%89%E6%8A%B5%E8%BE%BE%E5%A4%A9%E6%B4%A5"
},
{
"title": "脱口秀和Ta的朋友们",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E8%84%B1%E5%8F%A3%E7%A7%80%E5%92%8CTa%E7%9A%84%E6%9C%8B%E5%8F%8B%E4%BB%AC"
},
{
"title": "孟子义暮晚摇",
"hot_value": 0,
"link": "https://s.weibo.com/weibo?q=%E5%AD%9F%E5%AD%90%E4%B9%89%E6%9A%AE%E6%99%9A%E6%91%87"
}
]
}