声明:本站源码仅做学习研究,严禁用于任何商业用途以及任何变现!
功能介绍
推荐喜欢二次元/做动漫/漫画相关站点的站长集成该功能,启用后会有全屏樱花飘落,非常的唯美好看!
配置教程
首先利用宝塔或则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://www.52oc.cn/wp-content/themes/van/assets/js/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);
}
声明:本站所有文章,来源于互联网收集至此,所有资源仅供学习研究,商业运营请支持正版。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理 !