home.html 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Document</title>
  8. <style>
  9. @keyframes rotate {
  10. 0% {
  11. transform: rotate(0deg);
  12. }
  13. 100% {
  14. transform: rotate(360deg);
  15. }
  16. }
  17. .inner {
  18. transform-origin: center center;
  19. width: 15rem;
  20. height: 15rem;
  21. }
  22. .inner img {
  23. width: 15rem;
  24. }
  25. #small-img {
  26. width: 16rem;
  27. position: absolute;
  28. top: 0;
  29. left: 0;
  30. background: rgba(0, 0, 0, transparent);
  31. }
  32. </style>
  33. </head>
  34. <body>
  35. <div class="container">
  36. <div class="inner">
  37. <img src="1.jpg" alt="" id="big-img">
  38. <!-- <img src="2.jpg" alt="" id="small-img"> -->
  39. </div>
  40. </div>
  41. <!-- <button id="start">开始</button>
  42. <button id="stop">停止</button> -->
  43. <script>
  44. window.onload = function () {
  45. setTimeout(() => {
  46. var inner = document.querySelector(".inner");
  47. inner.style.animation = "rotate 5s linear infinite";
  48. setTimeout(function () {
  49. inner.style.animation = "";
  50. }, 5000);
  51. setTimeout(()=>{
  52. window.location.href= "page2.html"
  53. },3000)
  54. }, 2000)
  55. }
  56. </script>
  57. </body>
  58. </html>