Files
typecho-theme-simpleblog/footer.php
2025-08-24 22:31:46 +08:00

87 lines
2.7 KiB
PHP

<footer class="site-footer section-inner">
<p class="copyright">&copy; <?php echo date('Y'); ?> <a href="<?php $this->options->siteUrl(); ?>" class="site-name"><?php $this->options->title(); ?></a></p>
<!-- 请不要删除作者信息,谢谢!-->
<p class="theme-by"><?php _e('主题来源:'); ?> <a href="https://lhcy.org" target="_blank">林海草原</a></p>
<!-- 请不要删除作者信息,谢谢!-->
</footer> <!-- footer -->
</main>
<?php $this->footer(); ?>
<!-- 在 footer.php 的 </body> 标签前添加 -->
<a id="back_to_top" href="#" class="back_to_top" style="display: none;"><span>↑</span></a>
<style>
a.back_to_top {
text-decoration: none;
position: fixed;
bottom: 20px;
right: 20px;
background: var(--accent-color);
height: 43px;
width: 43px;
border-radius: 50%;
line-height: 43px;
font-size: 32px;
text-align: center;
transition: all 0.3s ease;
display: none;
z-index: 1000;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}
a.back_to_top:hover {
background: #6667ab;
transform: translateY(-3px);
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
a.back_to_top span {
color: #fff;
display: block;
}
@media (max-width: 768px) {
a.back_to_top {
bottom: 20px;
right: 20px;
height: 40px;
width: 40px;
line-height: 40px;
font-size: 32px;
}
}
@media (max-width: 480px) {
a.back_to_top {
bottom: 15px;
right: 15px;
height: 40px;
width: 40px;
line-height: 40px;
font-size: 32px;
}
}
</style>
<script>
document.addEventListener('DOMContentLoaded', function() {
var backToTopBtn = document.getElementById('back_to_top');
window.addEventListener('scroll', function() {
backToTopBtn.style.display = window.pageYOffset > 30 ? 'block' : 'none';
});
backToTopBtn.addEventListener('click', function(e) {
e.preventDefault();
window.scrollTo({ top: 0, behavior: 'smooth' });
});
});
</script>
</body>
</html>