Skip to content

Commit

Permalink
Fix Bugs
Browse files Browse the repository at this point in the history
修复了在部分浏览器下启用“隐藏看板娘”功能之后导致浏览器卡顿的问题
  • Loading branch information
Dreamer-Paul committed Jan 2, 2019
1 parent 6015bee commit 6bb82fd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
10 changes: 5 additions & 5 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @package Pio
* @author Dreamer-Paul
* @version 2.1
* @version 2.1.5
* @link https://paugram.com
*/

Expand Down Expand Up @@ -39,7 +39,7 @@ function paul_update($name, $version){

echo "</div>";
}
paul_update("Pio", "2.1");
paul_update("Pio", "2.1.5");

// 读取模型文件夹
$models = array();
Expand Down Expand Up @@ -88,13 +88,13 @@ function paul_update($name, $version){
'static', _t('展现模式'), _t('自定义看板娘的展现模式。静态模式将不启用按钮交互功能'));
$form -> addInput($custom_mode);

// 是否在手机上隐藏
// 隐藏看板娘
$hidden = new Typecho_Widget_Helper_Form_Element_Radio('hidden',
array(
'0' => _t('关闭'),
'1' => _t('开启'),
),
'0', _t('浏览体验'), _t('是否在手机版上隐藏看板娘'));
'0', _t('隐藏看板娘'), _t('开启后将在移动设备上隐藏看板娘'));
$form -> addInput($hidden);

// 是否开启时间小贴士
Expand All @@ -103,7 +103,7 @@ function paul_update($name, $version){
'0' => _t('关闭'),
'1' => _t('开启'),
),
'0', _t('时间小贴士'), _t('是否开启时间小贴士,在没有访问来源的情况下展示,将覆盖入站提示'));
'0', _t('时间小贴士'), _t('开启后将在没有访问来源的情况下展示,覆盖入站提示'));
$form -> addInput($tips);

// 自定义文字配置
Expand Down
26 changes: 16 additions & 10 deletions static/pio.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Pio Plugin
# By: Dreamer-Paul
# Last Update: 2018.12.30
# Last Update: 2019.1.2
一个支持换模型的 Live2D 插件,供 Typecho 使用。
Expand Down Expand Up @@ -232,16 +232,22 @@ var Paul_Girl = function (prop) {
}
};

// 判断模式并运行
switch (prop.mode){
case "static": begin.static(); break;
case "fixed": begin.fixed(); break;
case "draggable": begin.draggable(); break;
}

if(prop.hidden === true){ current.body.classList.add("hidden") }
// 运行
this.init = function () {
if(prop.hidden === true && window.innerWidth < 400){
current.body.classList.add("hidden");
}
else{
switch (prop.mode){
case "static": begin.static(); break;
case "fixed": begin.fixed(); break;
case "draggable": begin.draggable(); break;
}

loadlive2d("pio", prop.model[0]);
loadlive2d("pio", prop.model[0]);
}
};
this.init();
};

// 请保留版权说明
Expand Down

0 comments on commit 6bb82fd

Please sign in to comment.