Algorithm animation plays an important role in the education of computing and the development of algorithms. But the lack of explicit modeling of visualization specifications makes it difficult to reuse the algorithm implementations and the specifications. A context-aware algorithm animation framework named CA3F is proposed in this paper to solve the problem. In the CA3F framework, the algorithm execution is abstracted as the creation of algorithm contexts, while the algorithm animation is considered as the visualization of algorithms driven by the change of contexts. Algorithm contexts are modeled as visualization specification explicitly and, in consequence, an algorithm implementation becomes independent of the algorithm animation so as to enhance the reusability of the visualization specification. A group of various sort algorithm animations are developed to demonstrate and evaluate the use of CA3F framework.