svg-animation.js 671 B

123456789101112131415161718192021222324252627
  1. $(document).ready(function () {
  2. var bearPaw = Snap("#bear-paw-left");
  3. if (bearPaw) {
  4. var rotatePaw = function () {
  5. Snap.animate(-20, 20, function (val) {
  6. bearPaw.transform("r" + [val, 340, 400]);
  7. }, 2500);
  8. setTimeout(function(){
  9. Snap.animate(20, -20, function (val) {
  10. bearPaw.transform("r" + [val, 340, 400]);
  11. }, 2500);
  12. },2500);
  13. };
  14. rotatePaw();
  15. setInterval(rotatePaw,5000);
  16. }
  17. var sun = Snap("#sun");
  18. if (sun) {
  19. var rotateSun = function () {
  20. Snap.animate(0, 360, function (val) {
  21. sun.transform("r" + [val, 1400, 230]);
  22. }, 2500);
  23. };
  24. rotateSun();
  25. setInterval(rotateSun,2500);
  26. }
  27. });