Skip to content

Commit ace86ec

Browse files
scroll indicator
1 parent b6c8b88 commit ace86ec

File tree

4 files changed

+66
-2
lines changed

4 files changed

+66
-2
lines changed

index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ body {
8787
-webkit-overflow-scrolling: touch;
8888
scrollbar-width: auto;
8989
-ms-overflow-style: scrollbar;
90+
position: relative; /* For absolute positioning of scroll indicator */
9091
}
9192

9293
#controls-box::-webkit-scrollbar {
@@ -108,6 +109,7 @@ body {
108109
#controls-box::-webkit-scrollbar-thumb:hover {
109110
background: #555;
110111
}
112+
111113
.controls-container {
112114
display: flex;
113115
justify-content: center;

index.html

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
</label>
5555
</template>
5656
<link rel="stylesheet" href="./index.css">
57+
<link rel="stylesheet" href="./scroll-indicator.css">
5758
<script type="importmap">
5859
{
5960
"imports": {
@@ -98,15 +99,15 @@
9899
<div id="controls-box">
99100
<div id="raptor-project-page" class="controls-container" style="display: none;">
100101
<center>
101-
<h1 style="margin: 0; margin-bottom: 5px;"><img src="./blob/logo.svg" style="width: 13rem; vertical-align: middle;"></img>: A Foundation Policy for Quadrotor Control</h1>
102+
<h1 style="margin: 0; margin-top: 10px; margin-bottom: 5px;"><img src="./blob/logo.svg" style="width: 13rem; vertical-align: middle;"></img>: A Foundation Policy for Quadrotor Control</h1>
102103
<h3 style="margin: 0; margin-bottom: 10px;">Jonas Eschmann, Dario Albani, Giuseppe Loianno</h3>
103104
<a class="fancy-button fancy-button-small" href="">Paper on ArXiV</a>
104105
<a class="fancy-button fancy-button-small" href="https://github.com/rl-tools/foundation-policy">Code on Github</a>
105106
<div id="video-container" style="margin: 10px; max-width: 900px; margin-left: auto; margin-right: auto;">
106107
<div id="video-container-inner" style="position: relative; width: 100%; height: 0; padding-bottom: 56.25%; /* 16:9 aspect ratio */">
107108
</div>
108109
</div>
109-
<div style="margin: 10px;">
110+
<div style="margin: 10px; max-width: 900px;">
110111
This web app allows you to torture the <img src="./blob/logo.svg" style="width: 7rem; vertical-align: middle;"></img> foundation policy using different quadrotor models, reference trajectories and disturbances.
111112
You can reset the episodes by pressing "Sample Initial States". You can simulate step-by-step using "Pause on Reset" and then "Step" throught the episode.
112113
<br>
@@ -268,6 +269,7 @@ <h4 style="margin: 0px; margin-top: 5px;">Reproducing Oscillations Caused by Lin
268269
<div id="perturbation-groups" class="controls-container">
269270
</div>
270271
</div>
272+
<div id="scroll-indicator"></div>
271273
<div id="drag-and-drop-overlay">Drop RLtools HDF5 checkpoint here!</div>
272274
</body>
273275
</html>

index.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,28 @@ if (document.readyState === 'loading') {
533533
main()
534534
}
535535

536+
function setupScrollIndicatorHiding() {
537+
const scrollIndicator = document.getElementById('scroll-indicator');
538+
const controlsBox = document.getElementById('controls-box');
539+
if (scrollIndicator && controlsBox) {
540+
controlsBox.addEventListener('scroll', function() {
541+
const isAtBottom = controlsBox.scrollTop + controlsBox.clientHeight >= controlsBox.scrollHeight - 1;
542+
if (isAtBottom) {
543+
console.log("reached bottom, hiding scroll indicator");
544+
scrollIndicator.classList.add('hidden');
545+
} else {
546+
scrollIndicator.classList.remove('hidden');
547+
}
548+
});
549+
}
550+
}
551+
552+
if (document.readyState === 'loading') {
553+
document.addEventListener("DOMContentLoaded", setupScrollIndicatorHiding);
554+
} else {
555+
setupScrollIndicatorHiding();
556+
}
557+
536558
const drag_and_drop_overlay = document.getElementById('drag-and-drop-overlay');
537559
let drag_and_drop_counter = 0;
538560

scroll-indicator.css

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#scroll-indicator {
2+
position: fixed;
3+
bottom: 16px;
4+
left: calc(50% - 6px);
5+
color: rgba(68, 68, 68, 0.9);
6+
font-size: 18px;
7+
pointer-events: none;
8+
z-index: 1000;
9+
background: rgba(255, 255, 255, 0.95);
10+
border-radius: 50%;
11+
width: 40px;
12+
height: 40px;
13+
display: flex;
14+
align-items: center;
15+
justify-content: center;
16+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
17+
animation: softPulse 2.5s ease-in-out infinite;
18+
19+
opacity: 0.8;
20+
transition: opacity 0.3s ease;
21+
}
22+
23+
#scroll-indicator.hidden {
24+
opacity: 0;
25+
pointer-events: none;
26+
display: none;
27+
}
28+
29+
@keyframes softPulse {
30+
0%, 100% {
31+
opacity: 0.9;
32+
transform: translateX(-50%) translateY(0px);
33+
}
34+
50% {
35+
opacity: 1.0;
36+
transform: translateX(-50%) translateY(2px);
37+
}
38+
}

0 commit comments

Comments
 (0)