darkmode auto, light, dark
This commit is contained in:
@@ -86,5 +86,28 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="p-2 px-3" onclick="topFunction()" id="topScroll">
|
||||
<i class="fas fa-angle-up"></i>
|
||||
</button>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
var topScroll = document.getElementById("topScroll");
|
||||
window.onscroll = function() {scrollFunction()};
|
||||
|
||||
console.log(topScroll);
|
||||
function scrollFunction() {
|
||||
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
|
||||
topScroll.style.display = "block";
|
||||
} else {
|
||||
topScroll.style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function topFunction() {
|
||||
document.body.scrollTop = 0;
|
||||
document.documentElement.scrollTop = 0;
|
||||
}
|
||||
</script>
|
||||
|
||||
{{ end }}
|
||||
Reference in New Issue
Block a user