@@ -196,7 +196,11 @@ function toggleFullscreen(state) {
196196
197197function startAnimation () {
198198 if (! raf .value && ! isPaused .value ) {
199- raf .value = requestAnimationFrame (animate);
199+ if (FINAL_CONFIG .value .animation .type === ' scroll' ) {
200+ raf .value = requestAnimationFrame (animate);
201+ } else {
202+ raf .value = requestAnimationFrame (animateMarquee);
203+ }
200204 }
201205}
202206
@@ -233,6 +237,29 @@ function animate(timestamp) {
233237 raf .value = requestAnimationFrame (animate);
234238}
235239
240+ function animateMarquee (timestamp ) {
241+ if (isPaused .value ) return ;
242+ if (! lastTimestamp .value ) lastTimestamp .value = timestamp;
243+
244+ const deltaTime = timestamp - lastTimestamp .value ;
245+ const marqueeSpeed = (FINAL_CONFIG .value .animation .speedMs / 4 ) / 1000 ;
246+
247+ if (deltaTime >= marqueeSpeed) {
248+ init .value += marqueeSpeed;
249+ if (init .value >= (tableContainer .value .scrollHeight - tableContainer .value .clientHeight )) {
250+ init .value = 0 ;
251+ }
252+ if (tableContainer .value ) {
253+ tableContainer .value .scrollTo ({
254+ top: init .value ,
255+ behavior: ' auto' ,
256+ });
257+ }
258+ lastTimestamp .value = timestamp;
259+ }
260+ raf .value = requestAnimationFrame (animateMarquee);
261+ }
262+
236263function pauseAnimation () {
237264 isPaused .value = true ;
238265 cancelAnimationFrame (raf .value );
@@ -278,6 +305,20 @@ watch(
278305 }
279306);
280307
308+ watch (
309+ () => FINAL_CONFIG .value .animation .type ,
310+ (_newVal ) => {
311+ pauseAnimation ();
312+ init .value = 0 ;
313+ scrollIndex .value = 0 ;
314+ tableContainer .value .scrollTo ({
315+ top: 0 ,
316+ behavior: ' auto' ,
317+ });
318+ resumeAnimation ();
319+ }
320+ );
321+
281322const breakpoint = computed (() => FINAL_CONFIG .value .responsiveBreakpoint );
282323
283324onMounted (() => {
0 commit comments