Add animation player (#1877)

* Add auto slide controller.

* Fix the animation blocks.

* renamed as animation_player

* Bug fixes

* Refine animation player controls
This commit is contained in:
Yudong Jin
2026-03-31 21:24:11 +08:00
committed by GitHub
parent e3c74cfa01
commit 6e600f5ba7
27 changed files with 597 additions and 160 deletions
+10 -10
View File
@@ -399,19 +399,19 @@ For a deque, both the front and rear can perform enqueue and dequeue operations.
As shown in the figure below, we treat the head and tail nodes of the doubly linked list as the front and rear of the deque, implementing functionality to add and remove nodes at both ends.
=== "LinkedListDeque"
=== "<1>"
![Enqueue and dequeue operations in linked list implementation of deque](deque.assets/linkedlist_deque_step1.png)
=== "push_last()"
=== "<2>"
![linkedlist_deque_push_last](deque.assets/linkedlist_deque_step2_push_last.png)
=== "push_first()"
=== "<3>"
![linkedlist_deque_push_first](deque.assets/linkedlist_deque_step3_push_first.png)
=== "pop_last()"
=== "<4>"
![linkedlist_deque_pop_last](deque.assets/linkedlist_deque_step4_pop_last.png)
=== "pop_first()"
=== "<5>"
![linkedlist_deque_pop_first](deque.assets/linkedlist_deque_step5_pop_first.png)
The implementation code is shown below:
@@ -424,19 +424,19 @@ The implementation code is shown below:
As shown in the figure below, similar to implementing a queue based on an array, we can also use a circular array to implement a deque.
=== "ArrayDeque"
=== "<1>"
![Enqueue and dequeue operations in array implementation of deque](deque.assets/array_deque_step1.png)
=== "push_last()"
=== "<2>"
![array_deque_push_last](deque.assets/array_deque_step2_push_last.png)
=== "push_first()"
=== "<3>"
![array_deque_push_first](deque.assets/array_deque_step3_push_first.png)
=== "pop_last()"
=== "<4>"
![array_deque_pop_last](deque.assets/array_deque_step4_pop_last.png)
=== "pop_first()"
=== "<5>"
![array_deque_pop_first](deque.assets/array_deque_step5_pop_first.png)
Based on the queue implementation, we only need to add methods for "enqueue at front" and "dequeue from rear":