😚BUG修补:解决在原生butterfly下,pjax适配问题
This commit is contained in:
parent
68034a2268
commit
69e7e41082
@ -26,7 +26,7 @@
|
||||
--shadow-color: var(--shadow-color-light);
|
||||
--border-color: var(--border-color-light);
|
||||
--modal-bg-color: rgba(255, 255, 255, 0.5);
|
||||
--modal-content-bg-color: rgba(239, 250, 255, 0.7);
|
||||
--modal-content-bg-color: rgba(239, 250, 255, 0.5);
|
||||
--load-more-btn-bg-color: var(--container-bg-color);
|
||||
}
|
||||
|
||||
@ -155,10 +155,10 @@ body {
|
||||
|
||||
#modal-author-avatar {
|
||||
display: block;
|
||||
margin: 0 auto 10px;
|
||||
margin: 0 auto;
|
||||
border-radius: 50%;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ body {
|
||||
display: block;
|
||||
text-align: center;
|
||||
font-size: 15px;
|
||||
margin: 25px 0;
|
||||
margin: 15px 0;
|
||||
color: var(--hover-color);
|
||||
text-decoration: none;
|
||||
}
|
||||
@ -242,6 +242,11 @@ body {
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
height: 150px;
|
||||
transition: border 0.3s;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
border: 1px solid var(--hover-color);
|
||||
}
|
||||
|
||||
.card-title {
|
||||
@ -319,6 +324,13 @@ body {
|
||||
width: 140px;
|
||||
height: 140px;
|
||||
opacity: 0.4;
|
||||
transition: transform 0.6s ease, bottom 0.3s ease, right 0.3s ease; /* 0.3秒的平滑过渡效果 */
|
||||
}
|
||||
|
||||
#friend-circle-lite-root .card:hover .card-bg {
|
||||
transform: scale(1.1);
|
||||
bottom: -10px;
|
||||
right: -8px;
|
||||
}
|
||||
|
||||
#load-more-btn {
|
||||
@ -327,7 +339,7 @@ body {
|
||||
background-color: var(--container-bg-color);
|
||||
cursor: pointer;
|
||||
width: 200px;
|
||||
border-radius: 20px;
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--border-color);
|
||||
padding: 3px;
|
||||
transition: all 0.3s;
|
||||
|
@ -17,7 +17,7 @@ function initialize_fc_lite() {
|
||||
|
||||
const loadMoreBtn = document.createElement('button');
|
||||
loadMoreBtn.id = 'load-more-btn';
|
||||
loadMoreBtn.innerText = '显示更多';
|
||||
loadMoreBtn.innerText = '再来亿点';
|
||||
root.appendChild(loadMoreBtn);
|
||||
|
||||
// 创建统计信息容器
|
||||
@ -42,7 +42,7 @@ function initialize_fc_lite() {
|
||||
}
|
||||
}
|
||||
|
||||
fetch(`${UserConfig.private_api_url}all.json`)
|
||||
fetch(`${UserConfig.private_api_url}all`)
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
localStorage.setItem(cacheKey, JSON.stringify(data));
|
||||
@ -50,7 +50,7 @@ function initialize_fc_lite() {
|
||||
processArticles(data);
|
||||
})
|
||||
.finally(() => {
|
||||
loadMoreBtn.innerText = '显示更多'; // 恢复按钮文本
|
||||
loadMoreBtn.innerText = '再来亿点'; // 恢复按钮文本
|
||||
});
|
||||
}
|
||||
|
||||
@ -152,7 +152,7 @@ function initialize_fc_lite() {
|
||||
|
||||
const authorArticles = allArticles.filter(article => article.author === author);
|
||||
// 仅仅取前五个,防止文章过多导致模态框过长,如果不够五个则全部取出
|
||||
authorArticles.slice(0, 5).forEach(article => {
|
||||
authorArticles.slice(0, 4).forEach(article => {
|
||||
const articleDiv = document.createElement('div');
|
||||
articleDiv.className = 'modal-article';
|
||||
|
||||
@ -203,12 +203,19 @@ function initialize_fc_lite() {
|
||||
};
|
||||
};
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
setTimeout(initialize_fc_lite, 0);
|
||||
});
|
||||
//document.addEventListener("DOMContentLoaded", function() {
|
||||
// setTimeout(initialize_fc_lite, 0);
|
||||
//});
|
||||
|
||||
document.addEventListener('pjax:complete', function() {
|
||||
setTimeout(initialize_fc_lite, 0);
|
||||
});
|
||||
//document.addEventListener('pjax:complete', function() {
|
||||
// setTimeout(initialize_fc_lite, 0);
|
||||
//});
|
||||
|
||||
setTimeout(initialize_fc_lite, 0);
|
||||
//setTimeout(initialize_fc_lite, 0);
|
||||
|
||||
function whenDOMReady() {
|
||||
initialize_fc_lite();
|
||||
}
|
||||
|
||||
whenDOMReady()
|
||||
document.addEventListener("pjax:complete", whenDOMReady)
|
2
main/fclite.min.css
vendored
2
main/fclite.min.css
vendored
File diff suppressed because one or more lines are too long
2
main/fclite.min.js
vendored
2
main/fclite.min.js
vendored
File diff suppressed because one or more lines are too long
@ -30,7 +30,7 @@ async def root():
|
||||
@app.get('/all')
|
||||
async def get_all_articles():
|
||||
try:
|
||||
with open('all.json', 'r', encoding='utf-8') as f:
|
||||
with open('./all.json', 'r', encoding='utf-8') as f:
|
||||
articles_data = json.load(f)
|
||||
return JSONResponse(content=articles_data)
|
||||
except FileNotFoundError:
|
||||
@ -41,7 +41,7 @@ async def get_all_articles():
|
||||
@app.get('/errors')
|
||||
async def get_error_friends():
|
||||
try:
|
||||
with open('errors.json', 'r', encoding='utf-8') as f:
|
||||
with open('./errors.json', 'r', encoding='utf-8') as f:
|
||||
errors_data = json.load(f)
|
||||
return JSONResponse(content=errors_data)
|
||||
except FileNotFoundError:
|
||||
@ -52,7 +52,7 @@ async def get_error_friends():
|
||||
@app.get('/random')
|
||||
async def get_random_article():
|
||||
try:
|
||||
with open('all.json', 'r', encoding='utf-8') as f:
|
||||
with open('./all.json', 'r', encoding='utf-8') as f:
|
||||
articles_data = json.load(f)
|
||||
if articles_data.get("article_data"):
|
||||
random_article = random.choice(articles_data["article_data"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user