entry.scss 1001 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. $max-child: 5;
  2. @for $i from 1 through $max-child {
  3. * > .enter-x:nth-child(#{$i}) {
  4. transform: translateX(50px);
  5. }
  6. * > .-enter-x:nth-child(#{$i}) {
  7. transform: translateX(-50px);
  8. }
  9. * > .enter-x:nth-child(#{$i}),
  10. * > .-enter-x:nth-child(#{$i}) {
  11. // z-index: 10 - $i;
  12. opacity: 0;
  13. animation: enter-x-animation 0.3s ease-in-out 0.2s;
  14. animation-delay: 0.1s * $i;
  15. animation-fill-mode: forwards;
  16. }
  17. * > .enter-y:nth-child(#{$i}) {
  18. transform: translateY(50px);
  19. }
  20. * > .-enter-y:nth-child(#{$i}) {
  21. transform: translateY(-50px);
  22. }
  23. * > .enter-y:nth-child(#{$i}),
  24. * > .-enter-y:nth-child(#{$i}) {
  25. // z-index: 10 - $i;
  26. opacity: 0;
  27. animation: enter-y-animation 0.3s ease-in-out 0.2s;
  28. animation-delay: 0.1s * $i;
  29. animation-fill-mode: forwards;
  30. }
  31. }
  32. @keyframes enter-x-animation {
  33. to {
  34. opacity: 1;
  35. transform: translateX(0);
  36. }
  37. }
  38. @keyframes enter-y-animation {
  39. to {
  40. opacity: 1;
  41. transform: translateY(0);
  42. }
  43. }