fix: Fixed some bugs

This commit is contained in:
2025-01-14 21:30:25 +08:00
parent a87eaec245
commit 859a7ec6fe
7 changed files with 69 additions and 5 deletions

View File

@@ -97,6 +97,14 @@ a:hover {
color: var(--secondary-text-color);
}
.special-footer {
width: 100%;
padding-top: 2rem;
padding-bottom: 2rem;
text-align: center;
color: var(--secondary-text-color);
}
.icp-text {
color: var(--secondary-text-color);
}

View File

@@ -9,6 +9,12 @@ if (localStorage.getItem("theme") === null) {
replaceCssFile();
setTheme();
window.addEventListener('resize', function() {
setFooter()
});
setFooter()
function changeTheme() {
if (theme === "dark") {
theme = "light";
@@ -55,4 +61,29 @@ function replaceCssFile() {
break;
}
}
}
function checkSpecialHeight() {
let element = document.querySelector('.body-container')
if (!element) {
return false;
}
let elementHeight = element.offsetHeight;
let viewportHeight = window.innerHeight;
return elementHeight >= viewportHeight * 0.7;
}
function setFooter() {
try {
if (checkSpecialHeight()) {
document.querySelector('.footer').style.display = 'none';
document.querySelector('.special-footer').style.display = 'block';
} else {
document.querySelector('.footer').style.display = 'block';
document.querySelector('.special-footer').style.display = 'none';
}
} catch (e) {
}
}

View File

@@ -39,7 +39,7 @@
<!-- body -->
<div class="container p-3">
<div class="container p-3 body-container">
<div class="row pt-lg-3">
<h3 class="history-post-title"># {{ .history_post.title }}</h3>
<div class="row pt-4">
@@ -100,6 +100,11 @@
</div>
</div>
<!-- footer -->
<div class="special-footer">
{{ .site_info.copyright }}
</div>
</div>
<!-- footer -->

View File

@@ -37,7 +37,7 @@
<!-- body -->
<div class="container p-3">
<div class="container p-3 body-container">
<div class="row pt-lg-3">
<h3 class="categorized-post-title"># {{ .categorized_post.title }}</h3>
<div class="row">
@@ -91,6 +91,11 @@
</div>
</div>
<!-- footer -->
<div class="special-footer">
{{ .site_info.copyright }}
</div>
</div>
<!-- footer -->

View File

@@ -40,7 +40,7 @@
</div>
<!-- body -->
<div class="container p-3">
<div class="container p-3 body-container">
<div class="row pt-lg-3">
<div class="col mx-auto">
<h3 class="friend-title"># {{ .friend.title }}</h3>
@@ -67,6 +67,11 @@
</div>
</div>
<!-- footer -->
<div class="special-footer">
{{ .site_info.copyright }}
</div>
</div>
<!-- footer -->

View File

@@ -37,7 +37,7 @@
<!-- body -->
<div class="container p-3">
<div class="container p-3 body-container">
<div class="row pt-lg-3">
<h3 class="search-post-title"># {{ .search_post.title }}</h3>
<div class="row pt-4">
@@ -98,6 +98,11 @@
</div>
</div>
<!-- footer -->
<div class="special-footer">
{{ .site_info.copyright }}
</div>
</div>
<!-- footer -->

View File

@@ -37,7 +37,7 @@
</div>
<!-- body -->
<div class="container p-3">
<div class="container p-3 body-container">
<div class="row pt-lg-3">
<h3 class="tagged-post-title"># {{ .tagged_post.title }}</h3>
<div class="row">
@@ -77,6 +77,11 @@
</div>
</div>
<!-- footer -->
<div class="special-footer">
{{ .site_info.copyright }}
</div>
</div>
<!-- tag word cloud -->