mirror of
https://github.com/yv1ing/MollyBlog.git
synced 2025-09-16 14:53:45 +08:00
fix: Fixed some bugs
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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 -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
@@ -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 -->
|
||||
|
||||
Reference in New Issue
Block a user