page-bilibiliFavList.php 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <?php
  2. /**
  3. Template Name: 哔哩哔哩收藏模板
  4. */
  5. get_header();
  6. ?>
  7. <meta name="referrer" content="same-origin" />
  8. <style>
  9. .comments {
  10. display: none;
  11. }
  12. .site-content {
  13. max-width: 1280px;
  14. }
  15. .fav-list {
  16. margin: 0 -10px -20px;
  17. flex-wrap: wrap;
  18. padding: 1rem 3%;
  19. justify-content: center;
  20. }
  21. .folder {
  22. border: 1px solid gray;
  23. overflow: hidden;
  24. transition: max-height .5s ease-out;
  25. max-height: 200px;
  26. border-radius: 10px;
  27. color: #fff;
  28. box-shadow: 0 0 10px rgb(0 0 0 / 10%), 0 5px 20px rgb(0 0 0 / 20%);
  29. }
  30. .folder-img {
  31. height: 200px;
  32. object-fit: cover;
  33. width: 100%;
  34. }
  35. .folder-top {
  36. height: 200px;
  37. display: block;
  38. position: relative;
  39. }
  40. .folder-detail {
  41. height: 100%;
  42. top: 0;
  43. left: 0;
  44. right: 0;
  45. position: absolute;
  46. text-align: center;
  47. background: rgba(0, 0, 0, .5);
  48. }
  49. .expand-button {
  50. background-color: transparent;
  51. height: 50px;
  52. align-self: center;
  53. font-size: 16px;
  54. border: 0;
  55. outline: 0;
  56. background-color: rgba(255, 255, 255, 0.6);
  57. color: var(--theme-skin, #505050);
  58. padding: 15px;
  59. border-radius: var(--style_menu_radius, 12px);
  60. box-shadow: 0 0 2px 0 rgb(0 0 0 / 12%), 0 2px 2px 0 rgb(0 0 0 / 24%);
  61. transition: all 0.8s ease !important;
  62. }
  63. .folder hr {
  64. margin: 0;
  65. background: grey;
  66. }
  67. .folder-content {
  68. padding: 5px;
  69. display: flex;
  70. justify-content: center;
  71. flex-wrap: wrap;
  72. }
  73. .column {
  74. margin-bottom: 20px;
  75. padding: 0 5px;
  76. transition: .5s;
  77. max-width: 100%;
  78. flex: 0 0 100%;
  79. }
  80. .folder-item {
  81. border: 1px solid gray;
  82. height: 0;
  83. color: #fff;
  84. display: block;
  85. overflow: hidden;
  86. text-align: center;
  87. position: relative;
  88. padding-bottom: 60%;
  89. box-shadow: 0 0 10px rgb(0 0 0 / 10%), 0 5px 20px rgb(0 0 0 / 20%);
  90. border-radius: 10px;
  91. }
  92. .item-img {
  93. width: 100%;
  94. user-select: none;
  95. object-fit: cover;
  96. transition: filter 2s;
  97. }
  98. .item-info {
  99. height: 40%;
  100. top: 0;
  101. left: 0;
  102. right: 0;
  103. padding: 10px;
  104. position: absolute;
  105. background: rgba(0, 0, 0, .5);
  106. transition: transform 1s;
  107. transform: translateY(150%);
  108. }
  109. .item-title {
  110. overflow: hidden;
  111. white-space: nowrap;
  112. text-overflow: ellipsis;
  113. margin-top: 0;
  114. }
  115. .item-intro {
  116. overflow: hidden;
  117. white-space: nowrap;
  118. text-overflow: ellipsis;
  119. }
  120. .load-more {
  121. flex: 0 0 100%;
  122. text-align: center;
  123. padding-top: 5px;
  124. padding-bottom: 5px;
  125. }
  126. @media screen and (min-width: 600px) {
  127. .folder-img {
  128. height: 200px;
  129. object-fit: cover;
  130. width: auto;
  131. }
  132. .folder-detail {
  133. height: 200px;
  134. display: flex;
  135. flex-direction: column;
  136. justify-content: center;
  137. position: inherit;
  138. align-self: center;
  139. width: 100%;
  140. text-align: center;
  141. background: rgba(0, 0, 0, .3);
  142. }
  143. .folder-top {
  144. display: flex;
  145. position: relative;
  146. }
  147. .folder-content {
  148. padding: 15px;
  149. }
  150. .column {
  151. max-width: 33.33333%;
  152. flex: 0 0 33.33333%;
  153. }
  154. .load-more {
  155. padding-top: 10px;
  156. padding-bottom: 10px;
  157. }
  158. }
  159. body.dark .expand-button {
  160. background-color: rgba(38, 38, 38, 0.6);
  161. color: var(--theme-skin-dark);
  162. }
  163. </style>
  164. </head>
  165. <?php while (have_posts()) : the_post(); ?>
  166. <?php $bgm = (iro_opt('bilibili_id')) ? new \Sakura\API\BilibiliFavList() : null; ?>
  167. <?php if (!empty($bgm) && (!iro_opt('patternimg') || !get_post_thumbnail_id(get_the_ID()))) : ?>
  168. <span class="linkss-title"><?php the_title(); ?></span>
  169. <?php endif; ?>
  170. <article <?php post_class("post-item"); ?>>
  171. <?php the_content('', true); ?>
  172. <?php if (!empty($bgm)) : ?>
  173. <section class="fav-list">
  174. <?php echo $bgm->get_folders(); ?>
  175. </section>
  176. <?php else : ?>
  177. <div class="row">
  178. <p> <?php _e("Please fill in the Bilibili UID in Sakura Options.", "sakurairo"); ?></p>
  179. </div>
  180. <?php endif; ?>
  181. </article>
  182. <?php endwhile; ?>
  183. <script src="<?php global $shared_lib_basepath;
  184. echo $shared_lib_basepath ?>/js/page-bilibilifav.js" type="text/javascript"></script>
  185. <?php
  186. get_footer();