summaryrefslogtreecommitdiff
path: root/Live2dHistoire
diff options
context:
space:
mode:
authormayx2025-08-07 12:27:42 +0000
committermayx2025-08-07 12:27:42 +0000
commitada0170bc0db4dd5b576ffcfdaaeb63e36454e1b (patch)
treea8047dad4a97593b506d872f8b7753e118a99538 /Live2dHistoire
parent16c29c6d1f68637c22aa1d59c6c211fa766e1e55 (diff)
Update 4 files
- /_data/proxylist.yml - /Live2dHistoire/README.md - /Live2dHistoire/live2d/js/message.js - /proxylist.md
Diffstat (limited to 'Live2dHistoire')
-rw-r--r--Live2dHistoire/README.md4
-rw-r--r--Live2dHistoire/live2d/js/message.js130
2 files changed, 66 insertions, 68 deletions
diff --git a/Live2dHistoire/README.md b/Live2dHistoire/README.md
index 6cd0553..d1ba4b3 100644
--- a/Live2dHistoire/README.md
+++ b/Live2dHistoire/README.md
@@ -1,4 +1,5 @@
# Live2d的看板娘——伊斯特瓦尔(Histoire)
+[Original Repo](https://github.com/eeg1412/Live2dHistoire)
#### 可用于网页端显示Live2D版的伊斯特瓦尔(Histoire) emlog插件版可以看这里:[传送门](https://www.wikimoe.com/?post=75)
#### 基于[《给博客添加能动的看板娘(Live2D)-将其添加到网页上吧》](https://imjad.cn/archives/lab/add-dynamic-poster-girl-with-live2d-to-your-blog-02)上的源码进行修改。
#### 在原先的基础上加上了如下功能:
@@ -93,9 +94,6 @@ var talkAPI = "";//如果有类似图灵机器人的聊天接口请填写接口
注意路径别弄错了噢 ~
PHP 程序推荐使用主题函数获取绝对路径。
-### 效果预览
-![](https://t1.aixinxi.net/o_1c3mofql9osmpeb1hfvsbv1hqua.gif-j.jpg)
-
### 模型说明
本插件仅供学习和交流使用,禁止用于商业用途。
diff --git a/Live2dHistoire/live2d/js/message.js b/Live2dHistoire/live2d/js/message.js
index 775ffc4..6442299 100644
--- a/Live2dHistoire/live2d/js/message.js
+++ b/Live2dHistoire/live2d/js/message.js
@@ -190,7 +190,7 @@ if (!norunFlag) {
if (typeof EventSource !== 'undefined' && text instanceof EventSource) {
var outputContainer = $('.message')[0];
var eventFlag = false;
- text.onmessage = function(event) {
+ text.onmessage = function (event) {
if (event.data == "[DONE]") {
text.close();
return;
@@ -317,6 +317,70 @@ if (!norunFlag) {
$('#showTalkBtn').hide();
}
+ // //获取用户名
+ // var live2dUser = sessionStorage.getItem("live2duser");
+ // if(live2dUser !== null){
+ // $('#AIuserName').val(live2dUser);
+ // }
+ //获取位置
+ var landL = sessionStorage.getItem("historywidth");
+ var landB = sessionStorage.getItem("historyheight");
+ if (landL == null || landB == null) {
+ landL = '5px'
+ landB = '0px'
+ }
+ $('#landlord').css('left', landL + 'px');
+ $('#landlord').css('bottom', landB + 'px');
+ //移动
+ function getEvent() {
+ return window.event || arguments.callee.caller.arguments[0];
+ }
+ var smcc = document.getElementById("landlord");
+ var moveX = 0;
+ var moveY = 0;
+ var moveBottom = 0;
+ var moveLeft = 0;
+ var moveable = false;
+ var docMouseMoveEvent = document.onmousemove;
+ var docMouseUpEvent = document.onmouseup;
+ smcc.onmousedown = function () {
+ var ent = getEvent();
+ moveable = true;
+ moveX = ent.clientX;
+ moveY = ent.clientY;
+ var obj = smcc;
+ moveBottom = parseInt(obj.style.bottom);
+ moveLeft = parseInt(obj.style.left);
+ if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0) {
+ window.getSelection().removeAllRanges();
+ }
+ document.onmousemove = function () {
+ if (moveable) {
+ var ent = getEvent();
+ var x = moveLeft + ent.clientX - moveX;
+ var y = moveBottom + (moveY - ent.clientY);
+ obj.style.left = x + "px";
+ obj.style.bottom = y + "px";
+ }
+ };
+ document.onmouseup = function () {
+ if (moveable) {
+ var historywidth = obj.style.left;
+ var historyheight = obj.style.bottom;
+ historywidth = historywidth.replace('px', '');
+ historyheight = historyheight.replace('px', '');
+ sessionStorage.setItem("historywidth", historywidth);
+ sessionStorage.setItem("historyheight", historyheight);
+ document.onmousemove = docMouseMoveEvent;
+ document.onmouseup = docMouseUpEvent;
+ moveable = false;
+ moveX = 0;
+ moveY = 0;
+ moveBottom = 0;
+ moveLeft = 0;
+ }
+ };
+ };
//获取音乐信息初始化
var bgmListInfo = $('input[name=live2dBGM]');
if (bgmListInfo.length == 0) {
@@ -385,70 +449,6 @@ if (!norunFlag) {
showMessage('音乐似乎加载不出来了呢!', 0);
});
}
- // //获取用户名
- // var live2dUser = sessionStorage.getItem("live2duser");
- // if(live2dUser !== null){
- // $('#AIuserName').val(live2dUser);
- // }
- //获取位置
- var landL = sessionStorage.getItem("historywidth");
- var landB = sessionStorage.getItem("historyheight");
- if (landL == null || landB == null) {
- landL = '5px'
- landB = '0px'
- }
- $('#landlord').css('left', landL + 'px');
- $('#landlord').css('bottom', landB + 'px');
- //移动
- function getEvent() {
- return window.event || arguments.callee.caller.arguments[0];
- }
- var smcc = document.getElementById("landlord");
- var moveX = 0;
- var moveY = 0;
- var moveBottom = 0;
- var moveLeft = 0;
- var moveable = false;
- var docMouseMoveEvent = document.onmousemove;
- var docMouseUpEvent = document.onmouseup;
- smcc.onmousedown = function () {
- var ent = getEvent();
- moveable = true;
- moveX = ent.clientX;
- moveY = ent.clientY;
- var obj = smcc;
- moveBottom = parseInt(obj.style.bottom);
- moveLeft = parseInt(obj.style.left);
- if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0) {
- window.getSelection().removeAllRanges();
- }
- document.onmousemove = function () {
- if (moveable) {
- var ent = getEvent();
- var x = moveLeft + ent.clientX - moveX;
- var y = moveBottom + (moveY - ent.clientY);
- obj.style.left = x + "px";
- obj.style.bottom = y + "px";
- }
- };
- document.onmouseup = function () {
- if (moveable) {
- var historywidth = obj.style.left;
- var historyheight = obj.style.bottom;
- historywidth = historywidth.replace('px', '');
- historyheight = historyheight.replace('px', '');
- sessionStorage.setItem("historywidth", historywidth);
- sessionStorage.setItem("historyheight", historyheight);
- document.onmousemove = docMouseMoveEvent;
- document.onmouseup = docMouseUpEvent;
- moveable = false;
- moveX = 0;
- moveY = 0;
- moveBottom = 0;
- moveLeft = 0;
- }
- };
- };
}
$(document).ready(function () {
var AIimgSrc = [