提交 f11c7319 编写于 作者: AndroidLeaves's avatar AndroidLeaves

update

上级 88e5c00c
......@@ -7,7 +7,7 @@
*/
// -------------------------------------------------------
// 是否是开发环境,配合手机端调试使用,正式发布设置为false
const isDev = false;
const isDev = true;
console.log(`开发环境 👉👉👉👉👉 ${isDev ? 'DEV' : 'RELEASE'}`);
console.log(`----------------------------------------`);
const remoteRoot = 'https://gitcode.net/enoyee/scriptable/-/raw/master/';
......@@ -42,8 +42,7 @@ class Widget extends BaseWidget {
contentFontColor: '#FFFFFF',
contentLineSpacing: 6,
// --------------------------
defaultBgShadowColor: '#000000',
defaultBgAlpha: 0.5,
blur: true,
bgUrl: 'https://gitcode.net/enoyee/scriptable/-/raw/master/img/bg_1.jpg',
// --------------------------
normalItemCount: 5,
......@@ -98,10 +97,7 @@ class Widget extends BaseWidget {
super(scriptName);
this.changeBgMode2OnLineBg(
this.defaultPreference.bgUrl,
{
shadowColor: this.defaultPreference.defaultBgShadowColor,
shadowColorAlpha: this.defaultPreference.defaultBgAlpha
}
{ blur: this.defaultPreference.blur }
);
}
......@@ -452,7 +448,7 @@ class Widget extends BaseWidget {
});
if (hotSelectIndex == 0) {
const hotbanArr = this.getHotban('[]');
const hotbanTitleArr = hotbanArr.map(hotban => hotban.title);
const hotbanTitleArr = hotbanArr.map(hotban => hotban.title.replaceAll(" ", ""));
await this.generateAlert('已添加榜单', `${hotbanTitleArr.length > 0 ? hotbanTitleArr.join('') : '暂无添加,默认微博热搜'}`, ['确定']);
} else if (hotSelectIndex == 1) {
await this.generateInputAlert({
......
......@@ -8,7 +8,7 @@
*/
// 当前环境版本号
const VERSION = 20221214
const VERSION = 20221215
// 组件配置文件名
const settingConfigName = 'settings.json';
// 组件默认配置
......@@ -284,7 +284,7 @@ class BaseWidget {
return typeText;
}
changeBgMode2OnLineBg = (bgUrl, options = { shadowColor: '#000', shadowColorAlpha: '0' }) => {
changeBgMode2OnLineBg = (bgUrl, options = { shadowColor: '#000', shadowColorAlpha: '0', blur: false, darkBlur: true, blurRadius: 30 }) => {
let widgetSetting = this.readWidgetSetting();
const { bgType, backgroundImageUrl } = widgetSetting
if (bgType == undefined || (bgType == '1' && backgroundImageUrl == undefined)) {
......@@ -2720,6 +2720,9 @@ class BaseWidget {
backgroundImagePath,
backgroundImageUrl,
shadowColor,
blur = false,
darkBlur = true,
blurRadius = 30,
shadowColorAlpha = '0',
backgroundGradientColor,
backgroundGradientAngle
......@@ -2738,7 +2741,9 @@ class BaseWidget {
bgImg = this.useFileManager().readImgCache(backgroundImagePath);
if (!bgImg) {
bgImg = await this.getImageByUrl(backgroundImageUrl);
if (shadowColor) {
if (blur) {
bgImg = await this.blurImage(bgImg, { w: bgImg.size.width, h: bgImg.size.height, x: 0, y: 0 }, darkBlur ? 'dark' : 'light', blurRadius);
} else if (shadowColor) {
bgImg = await this.loadShadowColor2Image(bgImg, new Color(shadowColor, Number(shadowColorAlpha)));
}
this.useFileManager().writeImgCache(this.scriptName, bgImg);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册