功能介绍
推荐喜欢二次元/做动漫/漫画相关站点的站长集成该功能,启用后会有全屏樱花飘落,非常的唯美好看!
配置教程
首先利用宝塔或则FTP打开/inc/options下的admin-options.php文件把下面代码放在20行左右
- array(
- ‘id’ => ‘is_cherry’,
- ‘type’ => ‘switcher’,
- ‘title’ => ‘樱花特效’,
- ‘label’ => ‘启用后全站会飘落樱花’,
- ‘default’ => false,
- ),
最后在主题根目录下打开functions.php将以下代码放在最后即可
- //+———————————————————————-
- //| 樱花特效
- //+———————————————————————-
- if (_cao(‘is_cherry’)) {
- add_action(‘wp_footer’, function () {
- echo <<<EOT
- <script type=“text/javascript” src=“https://van.ygit.net/wp-content/themes/van/assets/js/beautify/snowfall.js”></script>
- <div class=“meiha”></div>
- <style>
- .meiha {
- position: fixed;
- top: 0;
- right: 0;
- z–index: 999;
- width: 350px;
- height: 231px;
- pointer–events: none;
- }
- .snowfall–flakes {
- pointer–events: none;
- animation: sakura 1s linear 0s infinite;
- }
- .snowfall–flakes {
- animation: sakura 1s linear 0s infinite;
- }
- .night .snowfall–flakes {
- background: transparent !important;
- }
- @keyframes sakura {
- 0% {
- transform: rotate3d(0, 0, 0, 0deg);
- }
- 25% {
- transform: rotate3d(1, 1, 0, 60deg);
- }
- 50% {
- transform: rotate3d(1, 1, 0, 0deg);
- }
- 75% {
- transform: rotate3d(1, 0, 0, 60deg);
- }
- 100% {
- transform: rotate3d(1, 0, 0, 0deg);
- }
- }
- </style>
- EOT;
- }, 100);
- }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。