Skip to content
Snippets Groups Projects
Commit 569194b0 authored by HouTeng Chan's avatar HouTeng Chan
Browse files

Update file attributions.html

parent 52963431
No related branches found
No related tags found
No related merge requests found
......@@ -32,6 +32,14 @@
.row.mt-4 {
margin-left: 130px;
}
.scroll-progress {
position: fixed;
right: 0;
top: 0;
width: 10px;
background-color: hsl(17, 100%, 50%); /* Use the same color as sidebar links for consistency */
transition: height 0.2s ease-out;
}
</style>
</head>
......@@ -51,6 +59,7 @@
<li><a href="#topic3">Topic3</a></li>
<li><a href="#topic4"">Topic4</a></li>
</ul>
<div class="scroll-progress"></div>
</div>
<div class="row mt-4">
......@@ -113,3 +122,11 @@
{% endblock %}
<script>
document.addEventListener("scroll", function() {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.querySelector('.scroll-progress').style.height = scrolled + "%";
});
</script>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment