Skip to content

Commit 75e6909

Browse files
Zoomable pictures and fix webkit video (#16)
- zoom @ShrutheeshIR - videos play on ios --------- Co-authored-by: ShrutheeshIR <shrutheesh99@gmail.com>
1 parent aa5173d commit 75e6909

File tree

3 files changed

+91
-5
lines changed

3 files changed

+91
-5
lines changed

papers/spasm/index.html

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ <h1 class="title is-1 publication-title">Differentiable Particle Optimization fo
145145
<div class="hero-body">
146146
<video id="teaser" autoplay muted loop playsinline height="100%">
147147
<source src="./static/videos/hero.webm"
148-
type="video/mp4">
148+
type="video/webm">
149149
</video>
150150
<h2 class="subtitle has-text-centered">
151151
<span class="dnerf">SPaSM</span> solves sequential manipulation problems in <b><i>milliseconds</i></b>
@@ -172,7 +172,7 @@ <h2 class="title is-3">Abstract</h2>
172172
</p>
173173
<p>
174174
Unlike hierarchical approaches, SPaSM jointly optimizes object placements and robot trajectories to handle scenarios where motion feasibility constrains placement options.
175-
Experimental evaluation on challenging benchmarks demonstrates solution times in the realm of <b>milliseconds</b> with a 100% success rate; a 4000x speedup compared to existing approaches.
175+
Experimental evaluation on challenging benchmarks demonstrates solution times in the realm of <b>milliseconds</b> with a 100% success rate; a <b>4000x</b> speedup compared to existing approaches.
176176
</p>
177177
</div>
178178
</div>
@@ -211,10 +211,12 @@ <h3 class="title is-4">Trajectory Optimization</h3>
211211
alt="Interpolate start reference image."/>
212212
<p>Initial State</p>
213213
</div>
214-
<div class="column interpolation-video-column">
214+
<div class="column interpolation-video-column zoom-container" id="zoomDiv1">
215+
<div class="zoom-content">
215216
<div id="interpolation-image-wrapper">
216217
Loading...
217218
</div>
219+
</div>
218220
<input class="slider is-fullwidth is-large is-info"
219221
id="interpolation-slider"
220222
step="1" min="0" max="100" value="0" type="range">
@@ -240,10 +242,12 @@ <h3 class="title is-4">More Trajectory Optimization</h3>
240242
alt="Interpolate start reference image."/>
241243
<p>Initial State</p>
242244
</div>
243-
<div class="column interpolation-video-column">
245+
<div class="column interpolation-video-column zoom-container" id="zoomDiv2">
246+
<div class="zoom-content">
244247
<div id="interpolation-image-wrapper-2">
245248
Loading...
246249
</div>
250+
</div>
247251
<input class="slider is-fullwidth is-large is-info"
248252
id="interpolation-slider-2"
249253
step="1" min="0" max="100" value="0" type="range">
@@ -266,7 +270,7 @@ <h3 class="title is-4">More Trajectory Optimization</h3>
266270
<div class="container is-max-desktop content">
267271
<h2 class="title">BibTeX (preprint)</h2>
268272
<pre><code>@article{chen2025spasm,
269-
author={Lucas Chen and Shrutheesh Raman Iyer and Zachary Kingston},
273+
author={Lucas Chen and Shrutheesh R. Iyer and Zachary Kingston},
270274
title={Differentiable Particle Optimization for Fast Sequential Manipulation},
271275
year={2025},
272276
eprint={2510.07674},

papers/spasm/static/css/index.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,3 +155,38 @@ body {
155155
#interpolation-image-wrapper img {
156156
border-radius: 5px;
157157
}
158+
159+
.zoom-container {
160+
display: inline-block;
161+
cursor: zoom-in;
162+
position: relative;
163+
transition: transform 0.3s ease;
164+
transform-origin: center center;
165+
z-index: 1;
166+
}
167+
#zoomOverlay {
168+
display: none; /* hidden by default */
169+
position: fixed;
170+
inset: 0;
171+
background: rgba(0, 0, 0, 0.6);
172+
backdrop-filter: blur(2px);
173+
z-index: 998;
174+
opacity: 0;
175+
transition: opacity 0.3s ease;
176+
}
177+
178+
/* --- Active zoomed state --- */
179+
.zoom-container.zoomed {
180+
position: fixed;
181+
top: 50%;
182+
left: 50%;
183+
transform: translate(-50%, -50%) scale(1.25);
184+
transform-origin: center center;
185+
z-index: 999;
186+
cursor: zoom-out;
187+
}
188+
189+
.zoom-container.zoomed ~ #zoomOverlay {
190+
display: block;
191+
opacity: 1;
192+
}

papers/spasm/static/js/index.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,50 @@ function setInterpolationImage2(i) {
101101
image.oncontextmenu = function() { return false; };
102102
$('#interpolation-image-wrapper-2').empty().append(image);
103103
}
104+
105+
// zoom.js
106+
document.addEventListener('DOMContentLoaded', () => {
107+
const zoomables = document.querySelectorAll('.zoom-container');
108+
const overlay = document.getElementById('zoomOverlay');
109+
let currentZoom = null;
110+
111+
zoomables.forEach(container => {
112+
container.addEventListener('click', e => {
113+
if (e.target.closest('input, button, select, a, textarea, .no-zoom')) return;
114+
115+
// Close previously zoomed item if another is clicked
116+
if (currentZoom && currentZoom !== container) closeZoom(currentZoom);
117+
118+
if (container.classList.contains('zoomed')) {
119+
closeZoom(container);
120+
} else {
121+
openZoom(container);
122+
}
123+
});
124+
});
125+
126+
overlay.addEventListener('click', () => {
127+
if (currentZoom) closeZoom(currentZoom);
128+
});
129+
130+
window.addEventListener('keydown', e => {
131+
const key = e.key || e.code || '';
132+
if ((key === 'Escape' || key === 'Esc') && currentZoom) {
133+
closeZoom(currentZoom);
134+
}
135+
}, true);
136+
137+
function openZoom(el) {
138+
el.classList.add('zoomed');
139+
overlay.style.display = 'block';
140+
requestAnimationFrame(() => (overlay.style.opacity = '1'));
141+
currentZoom = el;
142+
}
143+
144+
function closeZoom(el) {
145+
el.classList.remove('zoomed');
146+
overlay.style.opacity = '0';
147+
setTimeout(() => (overlay.style.display = 'none'), 300);
148+
currentZoom = null;
149+
}
150+
});

0 commit comments

Comments
 (0)