forked from xszyou/Fay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1、集成live2d看板娘; 2、修改ngrok穿透是否开启的判断逻辑;
- Loading branch information
Showing
7 changed files
with
213 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// live2d_path 参数建议使用绝对路径 | ||
const live2d_path = "https://fastly.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/"; | ||
//const live2d_path = "/live2d-widget/"; | ||
|
||
// 封装异步加载资源的方法 | ||
function loadExternalResource(url, type) { | ||
return new Promise((resolve, reject) => { | ||
let tag; | ||
|
||
if (type === "css") { | ||
tag = document.createElement("link"); | ||
tag.rel = "stylesheet"; | ||
tag.href = url; | ||
} | ||
else if (type === "js") { | ||
tag = document.createElement("script"); | ||
tag.src = url; | ||
} | ||
if (tag) { | ||
tag.onload = () => resolve(url); | ||
tag.onerror = () => reject(url); | ||
document.head.appendChild(tag); | ||
} | ||
}); | ||
} | ||
|
||
// 加载 waifu.css live2d.min.js waifu-tips.js | ||
if (screen.width >= 768) { | ||
Promise.all([ | ||
loadExternalResource(live2d_path + "waifu.css", "css"), | ||
loadExternalResource(live2d_path + "live2d.min.js", "js"), | ||
loadExternalResource(live2d_path + "waifu-tips.js", "js") | ||
]).then(() => { | ||
// 配置选项的具体用法见 README.md | ||
initWidget({ | ||
waifuPath: "/static/live2d/waifu-tips.json", | ||
//apiPath: "https://live2d.fghrsh.net/api/", | ||
cdnPath: "https://fastly.jsdelivr.net/gh/fghrsh/live2d_api/", | ||
tools: ["switch-model", "quit"] | ||
}); | ||
}); | ||
} | ||
|
||
console.log(` | ||
く__,.ヘヽ. / ,ー、 〉 | ||
\ ', !-─‐-i / /´ | ||
/`ー' L//`ヽ、 | ||
/ /, /| , , ', | ||
イ / /-‐/ i L_ ハ ヽ! i | ||
レ ヘ 7イ`ト レ'ァ-ト、!ハ| | | ||
!,/7 '0' ´0iソ| | | ||
|.从" _ ,,,, / |./ | | ||
レ'| i>.、,,__ _,.イ / .i | | ||
レ'| | / k_7_/レ'ヽ, ハ. | | ||
| |/i 〈|/ i ,.ヘ | i | | ||
.|/ / i: ヘ! \ | | ||
kヽ>、ハ _,.ヘ、 /、! | ||
!'〈//`T´', \ `'7'ーr' | ||
レ'ヽL__|___i,___,ンレ|ノ | ||
ト-,/ |___./ | ||
'ー' !_,.: | ||
`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"mouseover": [{ | ||
"selector": "#live2d", | ||
"text": ["干嘛呢你,快把手拿开~~", "鼠…鼠标放错地方了!", "你要干嘛呀?", "喵喵喵?", "怕怕(ノ≧∇≦)ノ", "非礼呀!救命!", "这样的话,只能使用武力了!", "我要生气了哦", "不要动手动脚的!", "真…真的是不知羞耻!", "Hentai!"] | ||
}, { | ||
"selector": "#waifu-tool-hitokoto", | ||
"text": ["猜猜我要说些什么?", "我从青蛙王子那里听到了不少人生经验。"] | ||
}, { | ||
"selector": "#waifu-tool-asteroids", | ||
"text": ["要不要来玩飞机大战?", "这个按钮上写着「不要点击」。", "怎么,你想来和我玩个游戏?", "听说这样可以蹦迪!"] | ||
}, { | ||
"selector": "#waifu-tool-switch-model", | ||
"text": ["你是不是不爱人家了呀,呜呜呜~", "要见见我的姐姐嘛?", "想要看我妹妹嘛?", "要切换看板娘吗?"] | ||
}, { | ||
"selector": "#waifu-tool-switch-texture", | ||
"text": ["喜欢换装 PLAY 吗?", "这次要扮演什么呢?", "变装!", "让我们看看接下来会发生什么!"] | ||
}, { | ||
"selector": "#waifu-tool-photo", | ||
"text": ["你要给我拍照呀?一二三~茄子~", "要不,我们来合影吧!", "保持微笑就好了~"] | ||
}, { | ||
"selector": "#waifu-tool-info", | ||
"text": ["想要知道更多关于我的事么?", "这里记录着我搬家的历史呢。", "你想深入了解我什么呢?"] | ||
}, { | ||
"selector": "#waifu-tool-quit", | ||
"text": ["到了要说再见的时候了吗?", "呜呜 QAQ 后会有期……", "不要抛弃我呀……", "我们,还能再见面吗……", "哼,你会后悔的!"] | ||
}, { | ||
"selector": ".character_left", | ||
"text": ["这是我的人设,修改之后记得重新启动哦"] | ||
}, { | ||
"selector": ".character_right", | ||
"text": ["这是我的性格,修改之后记得重新启动哦"] | ||
}, { | ||
"selector": ".right_main", | ||
"text": ["我可以做你的售货员了"] | ||
}, { | ||
"selector": ".btn_close", | ||
"text": ["你是不想和我说话了吗"] | ||
}, { | ||
"selector": ".btn_open", | ||
"text": ["快点击,我可以和你谈谈心了"] | ||
}], | ||
"click": [{ | ||
"selector": "#live2d", | ||
"text": ["是…是不小心碰到了吧…", "萝莉控是什么呀?", "你看到我的小熊了吗?", "再摸的话我可要报警了!⌇●﹏●⌇", "110 吗,这里有个变态一直在摸我(ó﹏ò。)", "不要摸我了,我会告诉老婆来打你的!", "干嘛动我呀!小心我咬你!", "别摸我,有什么好摸的!"] | ||
},{ | ||
"selector": ".btn_close", | ||
"text": ["再见!"] | ||
}, { | ||
"selector": ".btn_open", | ||
"text": ["我要上线了"] | ||
}], | ||
"seasons": [{ | ||
"date": "01/01", | ||
"text": "<span>元旦</span>了呢,新的一年又开始了,今年是{year}年~" | ||
}, { | ||
"date": "02/14", | ||
"text": "又是一年<span>情人节</span>,{year}年找到对象了嘛~" | ||
}, { | ||
"date": "03/08", | ||
"text": "今天是<span>国际妇女节</span>!" | ||
}, { | ||
"date": "03/12", | ||
"text": "今天是<span>植树节</span>,要保护环境呀!" | ||
}, { | ||
"date": "04/01", | ||
"text": "悄悄告诉你一个秘密~<span>今天是愚人节,不要被骗了哦~</span>" | ||
}, { | ||
"date": "05/01", | ||
"text": "今天是<span>五一劳动节</span>,计划好假期去哪里了吗~" | ||
}, { | ||
"date": "06/01", | ||
"text": "<span>儿童节</span>了呢,快活的时光总是短暂,要是永远长不大该多好啊…" | ||
}, { | ||
"date": "09/03", | ||
"text": "<span>中国人民抗日战争胜利纪念日</span>,铭记历史、缅怀先烈、珍爱和平、开创未来。" | ||
}, { | ||
"date": "09/10", | ||
"text": "<span>教师节</span>,在学校要给老师问声好呀~" | ||
}, { | ||
"date": "10/01", | ||
"text": "<span>国庆节</span>到了,为祖国母亲庆生!" | ||
}, { | ||
"date": "11/05-11/12", | ||
"text": "今年的<span>双十一</span>是和谁一起过的呢~" | ||
}, { | ||
"date": "12/20-12/31", | ||
"text": "这几天是<span>圣诞节</span>,主人肯定又去剁手买买买了~" | ||
}], | ||
"time": [{ | ||
"hour": "6-7", | ||
"text": "早上好!一日之计在于晨,美好的一天就要开始了~" | ||
}, { | ||
"hour": "8-11", | ||
"text": "上午好!工作顺利嘛,不要久坐,多起来走动走动哦!" | ||
}, { | ||
"hour": "12-13", | ||
"text": "中午了,工作了一个上午,现在是午餐时间!" | ||
}, { | ||
"hour": "14-17", | ||
"text": "午后很容易犯困呢,今天的运动目标完成了吗?" | ||
}, { | ||
"hour": "18-19", | ||
"text": "傍晚了!窗外夕阳的景色很美丽呢,最美不过夕阳红~" | ||
}, { | ||
"hour": "20-21", | ||
"text": "晚上好,今天过得怎么样?" | ||
}, { | ||
"hour": "22-23", | ||
"text": ["已经这么晚了呀,早点休息吧,晚安~", "深夜时要爱护眼睛呀!"] | ||
}, { | ||
"hour": "0-5", | ||
"text": "你是夜猫子呀?这么晚还不睡觉,明天起的来嘛?" | ||
}], | ||
"message": { | ||
"default": ["好久不见,日子过得好快呢……", "大坏蛋!你都多久没理人家了呀,嘤嘤嘤~", "嗨~快来逗我玩吧!", "拿小拳拳锤你胸口!", "记得把小家加入收藏夹哦!"], | ||
"console": "哈哈,你打开了控制台,是想要看看我的小秘密吗?", | ||
"copy": "你都复制了些什么呀,转载要记得加上出处哦!", | ||
"visibilitychange": "哇,你终于回来了~" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.