功能介绍

推荐喜欢二次元/做动漫/漫画相关站点的站长集成该功能,启用后会有全屏樱花飘落,非常的唯美好看!

配置教程

首先利用宝塔或则FTP打开/inc/options下的admin-options.php文件把下面代码放在20行左右

  1. array(
  2. ‘id’ => ‘is_cherry’,
  3. ‘type’ => ‘switcher’,
  4. ‘title’ => ‘樱花特效’,
  5. ‘label’ => ‘启用后全站会飘落樱花’,
  6. ‘default’ => false,
  7. ),

最后在主题根目录下打开functions.php将以下代码放在最后即可

  1. //+———————————————————————-
  2. //| 樱花特效
  3. //+———————————————————————-
  4. if (_cao(‘is_cherry’)) {
  5. add_action(‘wp_footer’, function () {
  6. echo <<<EOT
  7. <script type=“text/javascript” src=“https://van.ygit.net/wp-content/themes/van/assets/js/beautify/snowfall.js”></script>
  8. <div class=“meiha”></div>
  9. <style>
  10. .meiha {
  11. position: fixed;
  12. top: 0;
  13. right: 0;
  14. zindex: 999;
  15. width: 350px;
  16. height: 231px;
  17. pointerevents: none;
  18. }
  19.  
  20. .snowfallflakes {
  21. pointerevents: none;
  22. animation: sakura 1s linear 0s infinite;
  23. }
  24.  
  25. .snowfallflakes {
  26. animation: sakura 1s linear 0s infinite;
  27. }
  28.  
  29. .night .snowfallflakes {
  30. background: transparent !important;
  31. }
  32.  
  33. @keyframes sakura {
  34. 0% {
  35. transform: rotate3d(0, 0, 0, 0deg);
  36. }
  37.  
  38. 25% {
  39. transform: rotate3d(1, 1, 0, 60deg);
  40. }
  41.  
  42. 50% {
  43. transform: rotate3d(1, 1, 0, 0deg);
  44. }
  45.  
  46. 75% {
  47. transform: rotate3d(1, 0, 0, 60deg);
  48. }
  49.  
  50. 100% {
  51. transform: rotate3d(1, 0, 0, 0deg);
  52. }
  53. }
  54. </style>
  55. EOT;
  56. }, 100);
  57. }

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注