st2.scss 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. @import url("https://fonts.googleapis.com/css?family=DM+Sans:400,500,700&display=swap");
  2. * {
  3. box-sizing: border-box;
  4. }
  5. html, body {
  6. margin: 0;
  7. padding: 0;
  8. width: 100%;
  9. height: 100%;
  10. }
  11. body {
  12. display: flex;
  13. align-items: center;
  14. justify-content: center;
  15. padding: 30px 10px;
  16. font-family: 'DM Sans', sans-serif;
  17. transition: background .4s ease-in;
  18. background-color: #c394f8;
  19. &.blue {
  20. background-color: #428aa6;
  21. }
  22. }
  23. input[type=radio] {
  24. display: none;
  25. }
  26. .card {
  27. position: absolute;
  28. width: 60%;
  29. height: 100%;
  30. left: 0;
  31. right: 0;
  32. margin: auto;
  33. transition: transform .4s ease;
  34. cursor: pointer;
  35. }
  36. .container {
  37. width: 100%;
  38. max-width: 800px;
  39. max-height: 600px;
  40. height: 100%;
  41. transform-style: preserve-3d;
  42. display: flex;
  43. justify-content: center;
  44. flex-direction: column;
  45. align-items: center;
  46. }
  47. .cards {
  48. position: relative;
  49. width: 100%;
  50. height: 100%;
  51. margin-bottom: 20px;
  52. }
  53. img {
  54. width: 100%;
  55. height: 100%;
  56. border-radius: 10px;
  57. object-fit: cover;
  58. }
  59. #item-1:checked ~ .cards #song-3, #item-2:checked ~ .cards #song-1, #item-3:checked ~ .cards #song-2 {
  60. transform: translatex(-40%) scale(.8);
  61. opacity: .4;
  62. z-index: 0;
  63. }
  64. #item-1:checked ~ .cards #song-2, #item-2:checked ~ .cards #song-3, #item-3:checked ~ .cards #song-1 {
  65. transform: translatex(40%) scale(.8);
  66. opacity: .4;
  67. z-index: 0;
  68. }
  69. #item-1:checked ~ .cards #song-1, #item-2:checked ~ .cards #song-2, #item-3:checked ~ .cards #song-3 {
  70. transform: translatex(0) scale(1);
  71. opacity: 1;
  72. z-index: 1;
  73. img {
  74. box-shadow: 0px 0px 5px 0px rgba(81, 81, 81, 0.47);
  75. }
  76. }
  77. .player {
  78. background-color: #fff;
  79. border-radius: 8px;
  80. min-width: 320px;
  81. padding: 16px 10px;
  82. }
  83. .upper-part {
  84. position: relative;
  85. display: flex;
  86. align-items: center;
  87. margin-bottom: 12px;
  88. height: 36px;
  89. overflow: hidden;
  90. }
  91. .play-icon{ margin-right: 10px; }
  92. .song-info {
  93. width: calc(100% - 32px);
  94. display: block;
  95. }
  96. .song-info .title {
  97. color: #403d40;
  98. font-size: 14px;
  99. line-height: 24px;
  100. }
  101. .sub-line {
  102. display: flex;
  103. justify-content: space-between;
  104. width: 100%;
  105. }
  106. .subtitle, .time {
  107. font-size: 12px;
  108. line-height: 16px;
  109. color: #c6c5c6;
  110. }
  111. .time {
  112. font-size: 12px;
  113. line-height: 16px;
  114. color: #a5a5a5;
  115. font-weight: 500;
  116. margin-left: auto;
  117. }
  118. .progress-bar {
  119. height: 3px;
  120. width: 100%;
  121. background-color: #e9efff;
  122. border-radius: 2px;
  123. overflow: hidden;
  124. }
  125. .progress {
  126. display: block;
  127. position: relative;
  128. width: 60%;
  129. height: 100%;
  130. background-color: #2992dc;
  131. border-radius: 6px;
  132. }
  133. .info-area {
  134. width: 100%;
  135. position: absolute;
  136. top: 0;
  137. left: 30px;
  138. transition: transform .4s ease-in;
  139. }
  140. #item-2:checked ~ .player #test {
  141. transform: translateY(0);
  142. }
  143. #item-2:checked ~ .player #test {
  144. transform: translateY(-40px);
  145. }
  146. #item-3:checked ~ .player #test {
  147. transform: translateY(-80px);
  148. }