255-effect-cards.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>Swiper demo</title>
  6. <meta
  7. name="viewport"
  8. content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"
  9. />
  10. <!-- Link Swiper's CSS -->
  11. <link
  12. rel="stylesheet"
  13. href="../swiper-bundle.min.css"
  14. />
  15. <!-- Demo styles -->
  16. <style>
  17. html,
  18. body {
  19. position: relative;
  20. height: 100%;
  21. }
  22. body {
  23. background: #eee;
  24. font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  25. font-size: 14px;
  26. color: #000;
  27. margin: 0;
  28. padding: 0;
  29. }
  30. body {
  31. background: #fff;
  32. font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  33. font-size: 14px;
  34. color: #000;
  35. margin: 0;
  36. padding: 0;
  37. }
  38. html,
  39. body {
  40. position: relative;
  41. height: 100%;
  42. }
  43. body {
  44. display: flex;
  45. justify-content: center;
  46. align-items: center;
  47. }
  48. .swiper {
  49. width: 240px;
  50. height: 320px;
  51. }
  52. .swiper-slide {
  53. display: flex;
  54. align-items: center;
  55. justify-content: center;
  56. border-radius: 18px;
  57. font-size: 22px;
  58. font-weight: bold;
  59. color: #fff;
  60. }
  61. .swiper-slide:nth-child(1n) {
  62. background-color: rgb(206, 17, 17);
  63. }
  64. .swiper-slide:nth-child(2n) {
  65. background-color: rgb(0, 140, 255);
  66. }
  67. .swiper-slide:nth-child(3n) {
  68. background-color: rgb(10, 184, 111);
  69. }
  70. .swiper-slide:nth-child(4n) {
  71. background-color: rgb(211, 122, 7);
  72. }
  73. .swiper-slide:nth-child(5n) {
  74. background-color: rgb(118, 163, 12);
  75. }
  76. .swiper-slide:nth-child(6n) {
  77. background-color: rgb(180, 10, 47);
  78. }
  79. .swiper-slide:nth-child(7n) {
  80. background-color: rgb(35, 99, 19);
  81. }
  82. .swiper-slide:nth-child(8n) {
  83. background-color: rgb(0, 68, 255);
  84. }
  85. .swiper-slide:nth-child(9n) {
  86. background-color: rgb(218, 12, 218);
  87. }
  88. .swiper-slide:nth-child(10n) {
  89. background-color: rgb(54, 94, 77);
  90. }
  91. </style>
  92. </head>
  93. <body>
  94. <!-- Swiper -->
  95. <div class="swiper mySwiper">
  96. <div class="swiper-wrapper">
  97. <div class="swiper-slide">Slide 1</div>
  98. <div class="swiper-slide">Slide 2</div>
  99. <div class="swiper-slide">Slide 3</div>
  100. <div class="swiper-slide">Slide 4</div>
  101. <div class="swiper-slide">Slide 5</div>
  102. <div class="swiper-slide">Slide 6</div>
  103. <div class="swiper-slide">Slide 7</div>
  104. <div class="swiper-slide">Slide 8</div>
  105. <div class="swiper-slide">Slide 9</div>
  106. </div>
  107. </div>
  108. <!-- Swiper JS -->
  109. <script src="../swiper-bundle.min.js"></script>
  110. <!-- Initialize Swiper -->
  111. <script>
  112. var swiper = new Swiper(".mySwiper", {
  113. effect: "cards",
  114. grabCursor: true,
  115. });
  116. </script>
  117. </body>
  118. </html>