polaroid-pets.css 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. .gallery {
  2. --d: 10s;
  3. display: grid;
  4. width: 27.098vw;
  5. margin-left: 5.088vw;
  6. }
  7. .gallery > .pets-img {
  8. grid-area: 1/1;
  9. width: 100%;
  10. aspect-ratio: 1;
  11. object-fit: cover;
  12. border: 10px solid #f2f2f2;
  13. box-shadow: 0 0 4px rgba(0, 0, 0, 0.4666666667);
  14. z-index: 2;
  15. animation: slide var(--d) infinite, z-order var(--d) infinite steps(1);
  16. }
  17. .gallery .pets-img:last-child {
  18. animation-name: slide, z-order-last;
  19. }
  20. .gallery > .pets-img:nth-child(1) {
  21. animation-delay: calc(0 * var(--d));
  22. --r: -17deg;
  23. }
  24. .gallery > .pets-img:nth-child(2) {
  25. animation-delay: calc(-0.2 * var(--d));
  26. --r: 1deg;
  27. }
  28. .gallery > .pets-img:nth-child(3) {
  29. animation-delay: calc(-0.4 * var(--d));
  30. --r: 16deg;
  31. }
  32. .gallery > .pets-img:nth-child(4) {
  33. animation-delay: calc(-0.6 * var(--d));
  34. --r: 19deg;
  35. }
  36. .gallery > .pets-img:nth-child(5) {
  37. animation-delay: calc(-0.8 * var(--d));
  38. --r: -13deg;
  39. }
  40. @keyframes slide {
  41. 16.67% {
  42. transform: translateX(90%) rotate(var(--r));
  43. }
  44. 33.33% {
  45. transform: translateX(0%) rotate(var(--r));
  46. }
  47. }
  48. @keyframes z-order {
  49. 16.67%, 33.33% {
  50. z-index: 1;
  51. }
  52. 66.33% {
  53. z-index: 2;
  54. }
  55. }
  56. @keyframes z-order-last {
  57. 16.67%, 33.33% {
  58. z-index: 1;
  59. }
  60. 83.33% {
  61. z-index: 2;
  62. }
  63. }
  64. /* body {
  65. margin: 0;
  66. min-height: 100vh;
  67. display: grid;
  68. place-content: center;
  69. background: #CDB380;
  70. overflow: hidden;
  71. } */