jargon

Roe2Js :: "Stone Wall" Pan (CSS)

Jun 10th, 2024 (edited)
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Background scrolling animation */
  2. .background {
  3.     position: fixed;
  4.     top: 0;
  5.     left: 0;
  6.     width: 100%;
  7.     height: 100%;
  8.     background-image: url(/GFX/stonwall.png);
  9.     background-size: auto;
  10.     background-repeat: repeat;
  11.     animation: scrollBackground 7s linear infinite;
  12.     z-index: -1;
  13. }
  14.  
  15. @keyframes scrollBackground {
  16.     from {
  17.         background-position: 0 0;
  18.     }
  19.     to {
  20.         background-position: 24px 24px;
  21.     }
  22. }
  23.  
  24. /* Class to apply the panning animation to any element with the specific background */
  25. .panning-background {
  26.     background-image: url(/GFX/stonwall.png);
  27.     background-size: auto;
  28.     background-repeat: repeat;
  29.     animation: scrollBackground 7s linear infinite;
  30. }
  31.  
Add Comment
Please, Sign In to add comment