mirror of
https://github.com/Mabbs/mabbs.github.io
synced 2026-01-10 05:21:47 +08:00
Compare commits
253 Commits
AR-Backup-
...
AR-Backup-
| Author | SHA1 | Date | |
|---|---|---|---|
| 6dab77e73c | |||
| 1ab207cb19 | |||
| 3dd82ed54c | |||
| 0ab62cb2b3 | |||
| 37ead95307 | |||
| fe29177bbd | |||
| 6a4897140e | |||
| 2b0fd923ad | |||
| 86f82d5aac | |||
| 3c324af39e | |||
| d9f22d591a | |||
| 5b639a1cba | |||
| 73415fe7ec | |||
| ada0170bc0 | |||
| 16c29c6d1f | |||
| 043b1a6cf6 | |||
| 5c9e79c0fc | |||
| 0cf73875a7 | |||
| 82e9d43169 | |||
| be9602047b | |||
| 5300870620 | |||
| e809c313c2 | |||
| 19d91dffd4 | |||
| b2a074bead | |||
| 2c629c95b9 | |||
| d1e734ede7 | |||
| fdaf977573 | |||
| f401d33c48 | |||
| 4475fd7ffe | |||
| cdd14e03e9 | |||
| ef2ea62d40 | |||
| 53a96b52d6 | |||
| ba857c724b | |||
| 3ef5ec378d | |||
| e3cf4e5b9e | |||
| 4f3bab2162 | |||
| 4da75fcf15 | |||
| 0e8ac37673 | |||
| 4de724f972 | |||
| 0afcae7cd8 | |||
| dddeb23c41 | |||
| e4e0261e0a | |||
| fb76deac38 | |||
| d4165271bc | |||
| 39cada8eef | |||
| 833fcb15ad | |||
| 2e4dee01e9 | |||
| 84e7982879 | |||
| 4ee425d47c | |||
| 7ea27ffbda | |||
| d10e960a8d | |||
| 00ed1a9b50 | |||
| dba69d3ceb | |||
| c25290e716 | |||
| 7fbeaffac3 | |||
| 6030f3c83c | |||
| 840144b202 | |||
| 7c256532d3 | |||
| d60d41a008 | |||
| 5cc76892b3 | |||
| 0a34660f94 | |||
| 8fd0fd107f | |||
| c2351bc269 | |||
| 446c34abec | |||
| 3c0dee8e79 | |||
| 63ad82f16c | |||
| b7e3354701 | |||
| 2d757a0e7c | |||
| 7937972e19 | |||
| 5cbb262172 | |||
| 723af68b24 | |||
| ffd614df6c | |||
| c6b5330945 | |||
| b1929b927f | |||
| 38caae08aa | |||
| 46e17e7abd | |||
| 8b4ec38daa | |||
| d1ac198efa | |||
| 399a6e2b14 | |||
| 786f9bd602 | |||
| 2b40c9e852 | |||
| e5e305f0f3 | |||
| 6584393a15 | |||
| 6cb9535ecc | |||
| d00e310673 | |||
| 368f1eb0d7 | |||
| 98e38a212e | |||
| b3bc4d12c8 | |||
| e0aba75f77 | |||
| d1791b47f3 | |||
| fe5faeac16 | |||
| 953811453e | |||
| 4c6c0bfc11 | |||
| 17c27841b0 | |||
| 6de5898f85 | |||
| 824f34f25f | |||
| de996d9015 | |||
| dbc8d7fb3c | |||
| ac554c5535 | |||
| 97e0ef3c81 | |||
| 2e59f23e9f | |||
| 6e45815987 | |||
| 8b1135d688 | |||
| 3b70d3c4bd | |||
| 8a3ea7d2b0 | |||
| b818d1db8e | |||
| a56d77a472 | |||
| 72ab43b411 | |||
| 0f00469871 | |||
| 1df87ea39d | |||
| a5ace5b449 | |||
| 29c6d57faa | |||
| d01d9119de | |||
| d0ce029b94 | |||
| ebc280932e | |||
| 6d145383f5 | |||
| 9669d10f5c | |||
| d9984efa2a | |||
| 16fd0ffd59 | |||
| 028f8b7347 | |||
| a9a876bc6f | |||
| 3edfcdb60a | |||
| c454031365 | |||
| a9d4790eb7 | |||
| 2f59a946db | |||
| 1f5ef5079c | |||
| 9d255a0a6f | |||
| 9f2bed804e | |||
| 8211f6d1a2 | |||
| 8f440b43dd | |||
| 7fe88c21a6 | |||
| 526c8c35b7 | |||
| 9b3f0369f6 | |||
| e8f6fbe1e7 | |||
| 91dd8a34ea | |||
| c7cabd991a | |||
| 9382acdabd | |||
| 78d65eae30 | |||
| 7a450f5ec2 | |||
| 9170efdaa3 | |||
| d3eefbba2d | |||
| 3bfbd78385 | |||
| 8c26bc57d5 | |||
| 85594ca8b1 | |||
| 05ba801c23 | |||
| 2f6eadd14f | |||
| f455ccfdd7 | |||
| 87807dd50c | |||
| 85d90f5f2f | |||
| aa83c0efc1 | |||
| b0bf30adcd | |||
| ae668ef412 | |||
| 763f0768ea | |||
| b0704e26fc | |||
| 1b4fd0de9b | |||
| eee3103f93 | |||
| 3ab930348e | |||
| 19f5a7b7f9 | |||
| e6bf9e886e | |||
| 82d6628c12 | |||
| e7bc272a81 | |||
| 7785bc18c7 | |||
| 9a0af3f555 | |||
| b1d25236a5 | |||
| 7ce15b01f8 | |||
| c374f914ac | |||
| 24f8def5ab | |||
| 796511e5eb | |||
| bb46247e97 | |||
| 4fb00a1975 | |||
| e1977bd6ae | |||
| 4d12271d57 | |||
| 433d5110c2 | |||
| b666bd16b2 | |||
| bc094788c2 | |||
| c0b1009935 | |||
| 129c4d1b5b | |||
| a8b9118a20 | |||
| dff8a2d2c9 | |||
| 2952d9f63e | |||
| 3de3d63d77 | |||
| 3dab9f333a | |||
| 85aa965218 | |||
| 0e065bf282 | |||
| 680afdca5a | |||
| 9e7e727897 | |||
| f5accbcad4 | |||
| d3ef0a278b | |||
| 38c549606e | |||
| 443d65ac50 | |||
| c8ce8de1d9 | |||
| 03d9517241 | |||
| 9b9efd0f60 | |||
| 07a3d18350 | |||
| 550321e80a | |||
| 50c6c49c4c | |||
| 593b4fa003 | |||
| 46f1b8d742 | |||
| 7a525073f9 | |||
| dc37b70586 | |||
| 2fd191d418 | |||
| 99ec7de3cd | |||
| cd294479e0 | |||
| b7ab4e6356 | |||
| 934c04aea7 | |||
| 5c7773fb59 | |||
| 41ce7aabb0 | |||
| cbe4db5992 | |||
| 04e63388b6 | |||
| 106aa95def | |||
| f1e7070380 | |||
| 10a3521795 | |||
| 881ed13576 | |||
| 982a87e0bf | |||
| 5097364988 | |||
| c437b255f1 | |||
| efaaa32674 | |||
| 8a51f7a942 | |||
| afe8b95115 | |||
| 2aad4be863 | |||
| 74cb7d028c | |||
| d74fe7b4b8 | |||
| 8f7d02697d | |||
| 4afea923c5 | |||
| e6281bfa5f | |||
| a4e9d17cf1 | |||
| 975fcf9d8e | |||
| 1734d36dd5 | |||
| eefdb73475 | |||
| c622346eaa | |||
| 7609bb0b8f | |||
| 2298c9b271 | |||
| f9abd1e5d7 | |||
| 62ea62e8e8 | |||
| 3dc82a814a | |||
| 09c88ebf18 | |||
| 2aed9e9d90 | |||
| bfe05eef58 | |||
| 5713b1b477 | |||
| 52eb8cd0a7 | |||
| c17b6f0971 | |||
| e7ad732f8d | |||
| 8b6738dcef | |||
| c52e7ded82 | |||
| 2df79d6a44 | |||
| 59688d1e1f | |||
| 86edb37efb | |||
| d06229e705 | |||
| 385b842c80 | |||
| 1cd08a24bd | |||
| c664d9e93a | |||
| 8dcfcaeb7b | |||
| 57f8e30bf4 |
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
10
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!-- 欢迎提交PR!如果是修复 BUG 或 typo ,可直接删除此模板。若是添加友链,请确认满足以下条件(将 [ ] 替换为 [x] 打勾): -->
|
||||||
|
|
||||||
|
- [ ] 这个 PR 是关于添加Links的
|
||||||
|
- [ ] 我在申请之前加上了[贵站](https://mabbs.github.io)友链
|
||||||
|
- [ ] 我的网站 **全站启用 HTTPS**
|
||||||
|
- [ ] 我的博客满足: **原创文章比例>80%,数量>10** 的要求
|
||||||
|
- [ ] 我的网站满足 **站点稳定,不弃坑** 的要求
|
||||||
|
- [ ] 我的链接列表不需要客户端渲染 <!-- 如有请在下方列出合理原因 -->
|
||||||
|
|
||||||
|
我的网站是: <!-- 例如:https://example.com -->
|
||||||
@ -6,14 +6,14 @@
|
|||||||
|
|
||||||
# Template project: https://gitlab.com/pages/jekyll
|
# Template project: https://gitlab.com/pages/jekyll
|
||||||
# Docs: https://docs.gitlab.com/ee/pages/
|
# Docs: https://docs.gitlab.com/ee/pages/
|
||||||
image: ruby:2.6
|
image: ruby:2.7
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
JEKYLL_ENV: production
|
JEKYLL_ENV: production
|
||||||
LC_ALL: C.UTF-8
|
LC_ALL: C.UTF-8
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- gem install bundler
|
- gem install bundler -v 2.4.22
|
||||||
- bundle install
|
- bundle install
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
|
|||||||
8
404.md
8
404.md
@ -2,5 +2,13 @@
|
|||||||
layout: default
|
layout: default
|
||||||
title: 404 - 找不到页面
|
title: 404 - 找不到页面
|
||||||
---
|
---
|
||||||
|
|
||||||
# 找不到页面
|
# 找不到页面
|
||||||
你访问的资源 <code><script>document.write(window.location.pathname)</script></code> 不存在或者可能已经被永久移除。
|
你访问的资源 <code><script>document.write(window.location.pathname)</script></code> 不存在或者可能已经被永久移除。
|
||||||
|
|
||||||
|
或者看看近期的其他文章?
|
||||||
|
|
||||||
|
{% for post in site.posts limit:10 %}
|
||||||
|
- {{ post.date | date: "%Y/%m/%d" }} - [{{ post.title }}{% if post.layout == "encrypt" %} [加密] {% endif %}]({{ post.url }})
|
||||||
|
|
||||||
|
{% endfor %}
|
||||||
1
5b60338bca964816af2f0b76965a1b84.txt
Normal file
1
5b60338bca964816af2f0b76965a1b84.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
5b60338bca964816af2f0b76965a1b84
|
||||||
@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0"?>
|
|
||||||
<users>
|
|
||||||
<user>0ADFCE64B3557DC4DC5F2DC224C5FDDD</user>
|
|
||||||
</users>
|
|
||||||
10
BlogCard.svg
10
BlogCard.svg
@ -105,31 +105,31 @@
|
|||||||
<g class="stagger" style="animation-delay: 450ms" transform="translate(25, 0)">
|
<g class="stagger" style="animation-delay: 450ms" transform="translate(25, 0)">
|
||||||
<line x1="12" y1="6.25" x2="19" y2="6.25"
|
<line x1="12" y1="6.25" x2="19" y2="6.25"
|
||||||
style="stroke:rgb(255,255,255);stroke-width:2"/>
|
style="stroke:rgb(255,255,255);stroke-width:2"/>
|
||||||
<text class="stat bold" x="25" y="12.5">{{ site.posts[0].title }}</text>
|
<text class="stat bold" x="25" y="12.5">{{ site.posts[0].title | truncate: 18 }}</text>
|
||||||
</g>
|
</g>
|
||||||
</g><g transform="translate(0, 25)">
|
</g><g transform="translate(0, 25)">
|
||||||
<g class="stagger" style="animation-delay: 600ms" transform="translate(25, 0)">
|
<g class="stagger" style="animation-delay: 600ms" transform="translate(25, 0)">
|
||||||
<line x1="12" y1="6.25" x2="19" y2="6.25"
|
<line x1="12" y1="6.25" x2="19" y2="6.25"
|
||||||
style="stroke:rgb(255,255,255);stroke-width:2"/>
|
style="stroke:rgb(255,255,255);stroke-width:2"/>
|
||||||
<text class="stat bold" x="25" y="12.5">{{ site.posts[1].title }}</text>
|
<text class="stat bold" x="25" y="12.5">{{ site.posts[1].title | truncate: 18 }}</text>
|
||||||
</g>
|
</g>
|
||||||
</g><g transform="translate(0, 50)">
|
</g><g transform="translate(0, 50)">
|
||||||
<g class="stagger" style="animation-delay: 750ms" transform="translate(25, 0)">
|
<g class="stagger" style="animation-delay: 750ms" transform="translate(25, 0)">
|
||||||
<line x1="12" y1="6.25" x2="19" y2="6.25"
|
<line x1="12" y1="6.25" x2="19" y2="6.25"
|
||||||
style="stroke:rgb(255,255,255);stroke-width:2"/>
|
style="stroke:rgb(255,255,255);stroke-width:2"/>
|
||||||
<text class="stat bold" x="25" y="12.5">{{ site.posts[2].title }}</text>
|
<text class="stat bold" x="25" y="12.5">{{ site.posts[2].title | truncate: 18 }}</text>
|
||||||
</g>
|
</g>
|
||||||
</g><g transform="translate(0, 75)">
|
</g><g transform="translate(0, 75)">
|
||||||
<g class="stagger" style="animation-delay: 900ms" transform="translate(25, 0)">
|
<g class="stagger" style="animation-delay: 900ms" transform="translate(25, 0)">
|
||||||
<line x1="12" y1="6.25" x2="19" y2="6.25"
|
<line x1="12" y1="6.25" x2="19" y2="6.25"
|
||||||
style="stroke:rgb(255,255,255);stroke-width:2"/>
|
style="stroke:rgb(255,255,255);stroke-width:2"/>
|
||||||
<text class="stat bold" x="25" y="12.5">{{ site.posts[3].title }}</text>
|
<text class="stat bold" x="25" y="12.5">{{ site.posts[3].title | truncate: 18 }}</text>
|
||||||
</g>
|
</g>
|
||||||
</g><g transform="translate(0, 100)">
|
</g><g transform="translate(0, 100)">
|
||||||
<g class="stagger" style="animation-delay: 1050ms" transform="translate(25, 0)">
|
<g class="stagger" style="animation-delay: 1050ms" transform="translate(25, 0)">
|
||||||
<line x1="12" y1="6.25" x2="19" y2="6.25"
|
<line x1="12" y1="6.25" x2="19" y2="6.25"
|
||||||
style="stroke:rgb(255,255,255);stroke-width:2"/>
|
style="stroke:rgb(255,255,255);stroke-width:2"/>
|
||||||
<text class="stat bold" x="25" y="12.5">{{ site.posts[4].title }}</text>
|
<text class="stat bold" x="25" y="12.5">{{ site.posts[4].title | truncate: 18 }}</text>
|
||||||
</g>
|
</g>
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
20
Gemfile
20
Gemfile
@ -1,11 +1,17 @@
|
|||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
gem "jekyll", "~> 4.1.0"
|
gem "jekyll", "~> 3.9.3"
|
||||||
group :jekyll_plugins do
|
group :jekyll_plugins do
|
||||||
gem "jekyll-gist"
|
gem "jekyll-gist", "~> 1.5.0"
|
||||||
gem "jekyll-coffeescript"
|
gem "jekyll-coffeescript", "~> 1.1.1"
|
||||||
gem "jekyll-assets"
|
gem "jekyll-assets", "~> 1.0.0"
|
||||||
gem "jekyll-sitemap"
|
gem "jekyll-sitemap", "~> 1.4.0"
|
||||||
gem "jekyll-feed"
|
gem "jekyll-feed", "~> 0.15.1"
|
||||||
|
gem "jekyll-include-cache", "~> 0.2.1"
|
||||||
|
gem "jekyll-readme-index", "~> 0.3.0"
|
||||||
|
gem "jekyll-default-layout", "~> 0.1.5"
|
||||||
|
gem "jekyll-titles-from-headings", "~> 0.5.3"
|
||||||
gem "jekyll-theme-minimal"
|
gem "jekyll-theme-minimal"
|
||||||
gem "jekyll-paginate"
|
gem "jekyll-paginate", "~> 1.1.0"
|
||||||
|
gem "kramdown-parser-gfm", "~> 1.1.0"
|
||||||
|
gem "kramdown", "~> 2.3.2"
|
||||||
end
|
end
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
# Live2d的看板娘——伊斯特瓦尔(Histoire)
|
# Live2d的看板娘——伊斯特瓦尔(Histoire)
|
||||||
|
[Original Repo](https://github.com/eeg1412/Live2dHistoire)
|
||||||
#### 可用于网页端显示Live2D版的伊斯特瓦尔(Histoire) emlog插件版可以看这里:[传送门](https://www.wikimoe.com/?post=75)
|
#### 可用于网页端显示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)上的源码进行修改。
|
#### 基于[《给博客添加能动的看板娘(Live2D)-将其添加到网页上吧》](https://imjad.cn/archives/lab/add-dynamic-poster-girl-with-live2d-to-your-blog-02)上的源码进行修改。
|
||||||
#### 在原先的基础上加上了如下功能:
|
#### 在原先的基础上加上了如下功能:
|
||||||
@ -93,9 +94,6 @@ var talkAPI = "";//如果有类似图灵机器人的聊天接口请填写接口
|
|||||||
注意路径别弄错了噢 ~
|
注意路径别弄错了噢 ~
|
||||||
PHP 程序推荐使用主题函数获取绝对路径。
|
PHP 程序推荐使用主题函数获取绝对路径。
|
||||||
|
|
||||||
### 效果预览
|
|
||||||

|
|
||||||
|
|
||||||
|
|
||||||
### 模型说明
|
### 模型说明
|
||||||
本插件仅供学习和交流使用,禁止用于商业用途。
|
本插件仅供学习和交流使用,禁止用于商业用途。
|
||||||
|
|||||||
@ -1,45 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<title>Live2D!</title>
|
|
||||||
<link rel="stylesheet" href="live2d/css/live2d.css" />
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="landlord" style="left:5px;bottom:0px;">
|
|
||||||
<div class="message" style="opacity:0"></div>
|
|
||||||
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
|
|
||||||
<div class="live_talk_input_body">
|
|
||||||
<div class="live_talk_input_name_body">
|
|
||||||
<input name="name" type="text" class="live_talk_name white_input" id="AIuserName" autocomplete="off" placeholder="你的名字" />
|
|
||||||
</div>
|
|
||||||
<div class="live_talk_input_text_body">
|
|
||||||
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?"/>
|
|
||||||
<button type="button" class="live_talk_send_btn" id="talk_send">发送</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<input name="live_talk" id="live_talk" value="1" type="hidden" />
|
|
||||||
<div class="live_ico_box">
|
|
||||||
<div class="live_ico_item type_info" id="showInfoBtn"></div>
|
|
||||||
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
|
|
||||||
<div class="live_ico_item type_music" id="musicButton"></div>
|
|
||||||
<div class="live_ico_item type_youdu" id="youduButton"></div>
|
|
||||||
<div class="live_ico_item type_quit" id="hideButton"></div>
|
|
||||||
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
|
|
||||||
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
|
|
||||||
<input name="live2dBGM" value="https://t1.aixinxi.net/o_1c52p4qbp15idv6bl55h381moha.mp3" type="hidden">
|
|
||||||
<input name="live2dBGM" value="https://t1.aixinxi.net/o_1c52p8frrlmf1aled1e14m56una.mp3" type="hidden">
|
|
||||||
<input id="duType" value="douqilai,l2d_caihong" type="hidden">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div id="open_live2d">召唤伊斯特瓦尔</div>
|
|
||||||
<script type="text/javascript" src="https://apps.bdimg.com/libs/jquery/1.7.1/jquery.min.js"></script>
|
|
||||||
<script>
|
|
||||||
var message_Path = '/histoire/live2d/';//资源目录,如果目录不对请更改
|
|
||||||
var talkAPI = "";//如果有类似图灵机器人的聊天接口请填写接口路径
|
|
||||||
</script>
|
|
||||||
<script type="text/javascript" src="live2d/js/live2d.js"></script>
|
|
||||||
<script type="text/javascript" src="live2d/js/message.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -79,7 +79,7 @@
|
|||||||
background-color: rgba(74, 59, 114,0.9);
|
background-color: rgba(74, 59, 114,0.9);
|
||||||
}
|
}
|
||||||
.live_talk_input_name_body{
|
.live_talk_input_name_body{
|
||||||
width:70px;
|
width:100px;
|
||||||
box-sizing:border-box;
|
box-sizing:border-box;
|
||||||
height:24px;
|
height:24px;
|
||||||
border: 2px solid rgb(223, 179, 241);
|
border: 2px solid rgb(223, 179, 241);
|
||||||
|
|||||||
@ -1,35 +1,33 @@
|
|||||||
var home_Path = document.location.protocol +'//' + window.document.location.hostname +'/';
|
|
||||||
|
|
||||||
var userAgent = window.navigator.userAgent.toLowerCase();
|
var userAgent = window.navigator.userAgent.toLowerCase();
|
||||||
console.log(userAgent);
|
console.log(userAgent);
|
||||||
var norunAI = [ "android", "iphone", "ipod", "ipad", "windows phone"];
|
var norunAI = ["android", "iphone", "ipod", "ipad", "windows phone"];
|
||||||
var norunFlag = false;
|
var norunFlag = false;
|
||||||
|
|
||||||
|
|
||||||
for(var i=0;i<norunAI.length;i++){
|
for (var i = 0; i < norunAI.length; i++) {
|
||||||
if(userAgent.indexOf(norunAI[i]) > -1){
|
if (userAgent.indexOf(norunAI[i]) > -1) {
|
||||||
norunFlag = true;
|
norunFlag = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!window.WebGLRenderingContext){
|
if (!window.WebGLRenderingContext) {
|
||||||
norunFlag = true;
|
norunFlag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!norunFlag){
|
if (!norunFlag) {
|
||||||
var hitFlag = false;
|
var hitFlag = false;
|
||||||
var AIFadeFlag = false;
|
var AIFadeFlag = false;
|
||||||
var liveTlakTimer = null;
|
var liveTlakTimer = null;
|
||||||
var sleepTimer_ = null;
|
var sleepTimer_ = null;
|
||||||
var AITalkFlag = false;
|
var AITalkFlag = false;
|
||||||
var talkNum = 0;
|
var talkNum = 0;
|
||||||
(function (){
|
(function () {
|
||||||
function renderTip(template, context) {
|
function renderTip(template, context) {
|
||||||
var tokenReg = /(\\)?\{([^\{\}\\]+)(\\)?\}/g;
|
var tokenReg = /(\\)?\{([^\{\}\\]+)(\\)?\}/g;
|
||||||
return template.replace(tokenReg, function (word, slash1, token, slash2) {
|
return template.replace(tokenReg, function (word, slash1, token, slash2) {
|
||||||
if (slash1 || slash2) {
|
if (slash1 || slash2) {
|
||||||
return word.replace('\\', '');
|
return word.replace(/\\/g, '');
|
||||||
}
|
}
|
||||||
var variables = token.replace(/\s/g, '').split('.');
|
var variables = token.replace(/\s/g, '').split('.');
|
||||||
var currentObject = context;
|
var currentObject = context;
|
||||||
@ -48,60 +46,61 @@ if(!norunFlag){
|
|||||||
};
|
};
|
||||||
|
|
||||||
var re = /x/;
|
var re = /x/;
|
||||||
re.toString = function() {
|
console.log(re);
|
||||||
|
re.toString = function () {
|
||||||
showMessage('哈哈,你打开了控制台,是想要看看我的秘密吗?', 5000);
|
showMessage('哈哈,你打开了控制台,是想要看看我的秘密吗?', 5000);
|
||||||
return '';
|
return '';
|
||||||
};
|
};
|
||||||
|
|
||||||
$(document).on('copy', function (){
|
$(document).on('copy', function () {
|
||||||
showMessage('你都复制了些什么呀,转载要记得加上出处哦~~', 5000);
|
showMessage('你都复制了些什么呀,转载要记得加上出处哦~~', 5000);
|
||||||
});
|
});
|
||||||
|
|
||||||
function initTips(){
|
function initTips() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
cache: true,
|
cache: true,
|
||||||
url: message_Path+'message.json',
|
url: message_Path + 'message.json',
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function (result){
|
success: function (result) {
|
||||||
$.each(result.mouseover, function (index, tips){
|
$.each(result.mouseover, function (index, tips) {
|
||||||
$(tips.selector).mouseover(function (){
|
$(tips.selector).mouseover(function () {
|
||||||
var text = tips.text;
|
var text = tips.text;
|
||||||
if(Array.isArray(tips.text)) text = tips.text[Math.floor(Math.random() * tips.text.length + 1)-1];
|
if (Array.isArray(tips.text)) text = tips.text[Math.floor(Math.random() * tips.text.length + 1) - 1];
|
||||||
text = text.renderTip({text: $(this).text()});
|
text = text.renderTip({ text: $(this).text() });
|
||||||
showMessage(text, 3000);
|
showMessage(text, 3000);
|
||||||
talkValTimer();
|
talkValTimer();
|
||||||
clearInterval(liveTlakTimer);
|
clearInterval(liveTlakTimer);
|
||||||
liveTlakTimer = null;
|
liveTlakTimer = null;
|
||||||
});
|
});
|
||||||
$(tips.selector).mouseout(function (){
|
$(tips.selector).mouseout(function () {
|
||||||
showHitokoto();
|
showHitokoto();
|
||||||
if(liveTlakTimer == null){
|
if (liveTlakTimer == null) {
|
||||||
liveTlakTimer = window.setInterval(function(){
|
liveTlakTimer = window.setInterval(function () {
|
||||||
showHitokoto();
|
showHitokoto();
|
||||||
},15000);
|
}, 15000);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$.each(result.click, function (index, tips){
|
$.each(result.click, function (index, tips) {
|
||||||
$(tips.selector).click(function (){
|
$(tips.selector).click(function () {
|
||||||
if(hitFlag){
|
if (hitFlag) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
hitFlag = true;
|
hitFlag = true;
|
||||||
setTimeout(function(){
|
setTimeout(function () {
|
||||||
hitFlag = false;
|
hitFlag = false;
|
||||||
},8000);
|
}, 8000);
|
||||||
var text = tips.text;
|
var text = tips.text;
|
||||||
if(Array.isArray(tips.text)) text = tips.text[Math.floor(Math.random() * tips.text.length + 1)-1];
|
if (Array.isArray(tips.text)) text = tips.text[Math.floor(Math.random() * tips.text.length + 1) - 1];
|
||||||
text = text.renderTip({text: $(this).text()});
|
text = text.renderTip({ text: $(this).text() });
|
||||||
showMessage(text, 3000);
|
showMessage(text, 3000);
|
||||||
});
|
});
|
||||||
clearInterval(liveTlakTimer);
|
clearInterval(liveTlakTimer);
|
||||||
liveTlakTimer = null;
|
liveTlakTimer = null;
|
||||||
if(liveTlakTimer == null){
|
if (liveTlakTimer == null) {
|
||||||
liveTlakTimer = window.setInterval(function(){
|
liveTlakTimer = window.setInterval(function () {
|
||||||
showHitokoto();
|
showHitokoto();
|
||||||
},15000);
|
}, 15000);
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -110,20 +109,20 @@ if(!norunFlag){
|
|||||||
initTips();
|
initTips();
|
||||||
|
|
||||||
var text;
|
var text;
|
||||||
if(document.referrer !== '' && document.referrer.split('/')[2] !== window.location.host ){
|
if (document.referrer !== '' && document.referrer.split('/')[2] !== window.location.host) {
|
||||||
var referrer = document.createElement('a');
|
var referrer = document.createElement('a');
|
||||||
referrer.href = document.referrer;
|
referrer.href = document.referrer;
|
||||||
text = '嗨!来自 <span style="color:#0099cc;">' + referrer.hostname + '</span> 的朋友!';
|
text = '嗨!来自 <span style="color:#0099cc;">' + referrer.hostname + '</span> 的朋友!';
|
||||||
var domain = referrer.hostname.split('.')[1];
|
var domain = referrer.hostname.split('.')[1];
|
||||||
if (domain == 'baidu') {
|
if (domain == 'baidu') {
|
||||||
text = '嗨! 来自 百度搜索 的朋友!<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>';
|
text = '嗨! 来自 百度搜索 的朋友!<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>';
|
||||||
}else if (domain == 'so') {
|
} else if (domain == 'so') {
|
||||||
text = '嗨! 来自 360搜索 的朋友!<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>';
|
text = '嗨! 来自 360搜索 的朋友!<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>';
|
||||||
}else if (domain == 'google') {
|
} else if (domain == 'google') {
|
||||||
text = '嗨! 来自 谷歌搜索 的朋友!<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>';
|
text = '嗨! 来自 谷歌搜索 的朋友!<br>欢迎访问<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>';
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
if (window.location.href == home_Path) { //主页URL判断,需要斜杠结尾
|
if (window.location.pathname == "/") { //主页URL判断,需要斜杠结尾
|
||||||
var now = (new Date()).getHours();
|
var now = (new Date()).getHours();
|
||||||
if (now > 23 || now <= 5) {
|
if (now > 23 || now <= 5) {
|
||||||
text = '你是夜猫子呀?这么晚还不睡觉,明天起的来嘛?';
|
text = '你是夜猫子呀?这么晚还不睡觉,明天起的来嘛?';
|
||||||
@ -144,114 +143,139 @@ if(!norunFlag){
|
|||||||
} else {
|
} else {
|
||||||
text = '嗨~ 快来逗我玩吧!';
|
text = '嗨~ 快来逗我玩吧!';
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
text = '欢迎阅读<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>';
|
text = '欢迎阅读<span style="color:#0099cc;">「 ' + document.title.split(' | ')[0] + ' 」</span>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
showMessage(text, 12000);
|
showMessage(text, 12000);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
liveTlakTimer = setInterval(function(){
|
liveTlakTimer = setInterval(function () {
|
||||||
showHitokoto();
|
showHitokoto();
|
||||||
},15000);
|
}, 15000);
|
||||||
|
|
||||||
function showHitokoto(){
|
function showHitokoto() {
|
||||||
if(sessionStorage.getItem("Sleepy")!=="1"){
|
if (sessionStorage.getItem("Sleepy") !== "1") {
|
||||||
if(!AITalkFlag){
|
if (!AITalkFlag) {
|
||||||
$.getJSON('https://v1.hitokoto.cn/',function(result){
|
$.getJSON('https://hitokoto.mayx.eu.org/', function (result) {
|
||||||
talkValTimer();
|
talkValTimer();
|
||||||
showMessage(result.hitokoto, 0);
|
showMessage(result.hitokoto, 0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
hideMessage(0);
|
hideMessage(0);
|
||||||
if(sleepTimer_==null){
|
if (sleepTimer_ == null) {
|
||||||
sleepTimer_ = setInterval(function(){
|
sleepTimer_ = setInterval(function () {
|
||||||
checkSleep();
|
checkSleep();
|
||||||
},200);
|
}, 200);
|
||||||
}
|
}
|
||||||
console.log(sleepTimer_);
|
console.log(sleepTimer_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkSleep(){
|
function checkSleep() {
|
||||||
var sleepStatu = sessionStorage.getItem("Sleepy");
|
var sleepStatu = sessionStorage.getItem("Sleepy");
|
||||||
if(sleepStatu!=='1'){
|
if (sleepStatu !== '1') {
|
||||||
talkValTimer();
|
talkValTimer();
|
||||||
showMessage('你回来啦~', 0);
|
showMessage('你回来啦~', 0);
|
||||||
clearInterval(sleepTimer_);
|
clearInterval(sleepTimer_);
|
||||||
sleepTimer_= null;
|
sleepTimer_ = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMessage(text, timeout){
|
function showMessage(text, timeout) {
|
||||||
if(Array.isArray(text)) text = text[Math.floor(Math.random() * text.length + 1)-1];
|
if (Array.isArray(text)) text = text[Math.floor(Math.random() * text.length + 1) - 1];
|
||||||
//console.log('showMessage', text);
|
//console.log('showMessage', text);
|
||||||
$('.message').stop();
|
$('.message').stop();
|
||||||
$('.message').html(text);
|
if (typeof EventSource !== 'undefined' && text instanceof EventSource) {
|
||||||
|
var outputContainer = $('.message')[0];
|
||||||
|
var eventFlag = false;
|
||||||
|
text.onmessage = function (event) {
|
||||||
|
if (event.data == "[DONE]") {
|
||||||
|
text.close();
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
if (!eventFlag) {
|
||||||
|
talkValTimer();
|
||||||
|
outputContainer.textContent = "";
|
||||||
|
eventFlag = true;
|
||||||
|
}
|
||||||
|
var data = JSON.parse(event.data);
|
||||||
|
outputContainer.textContent += data.response;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$('.message').html(text);
|
||||||
|
}
|
||||||
$('.message').fadeTo(200, 1);
|
$('.message').fadeTo(200, 1);
|
||||||
//if (timeout === null) timeout = 5000;
|
//if (timeout === null) timeout = 5000;
|
||||||
//hideMessage(timeout);
|
//hideMessage(timeout);
|
||||||
}
|
}
|
||||||
function talkValTimer(){
|
function talkValTimer() {
|
||||||
$('#live_talk').val('1');
|
$('#live_talk').val('1');
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideMessage(timeout){
|
function hideMessage(timeout) {
|
||||||
//$('.message').stop().css('opacity',1);
|
//$('.message').stop().css('opacity',1);
|
||||||
if (timeout === null) timeout = 5000;
|
if (timeout === null) timeout = 5000;
|
||||||
$('.message').delay(timeout).fadeTo(200, 0);
|
$('.message').delay(timeout).fadeTo(200, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
function initLive2d (){
|
function initLive2d() {
|
||||||
$('#hideButton').on('click', function(){
|
$("#landlord").mouseenter(function () {
|
||||||
if(AIFadeFlag){
|
$(".live_ico_box").fadeIn();
|
||||||
|
});
|
||||||
|
$("#landlord").mouseleave(function () {
|
||||||
|
$(".live_ico_box").fadeOut();
|
||||||
|
});
|
||||||
|
$('#hideButton').on('click', function () {
|
||||||
|
if (AIFadeFlag) {
|
||||||
return false;
|
return false;
|
||||||
}else{
|
} else {
|
||||||
AIFadeFlag = true;
|
AIFadeFlag = true;
|
||||||
localStorage.setItem("live2dhidden", "0");
|
localStorage.setItem("live2dhidden", "0");
|
||||||
$('#landlord').fadeOut(200);
|
$('#landlord').fadeOut(200);
|
||||||
$('#open_live2d').delay(200).fadeIn(200);
|
$('#open_live2d').delay(200).fadeIn(200);
|
||||||
setTimeout(function(){
|
setTimeout(function () {
|
||||||
AIFadeFlag = false;
|
AIFadeFlag = false;
|
||||||
},300);
|
}, 300);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#open_live2d').on('click', function(){
|
$('#open_live2d').on('click', function () {
|
||||||
if(AIFadeFlag){
|
if (AIFadeFlag) {
|
||||||
return false;
|
return false;
|
||||||
}else{
|
} else {
|
||||||
AIFadeFlag = true;
|
AIFadeFlag = true;
|
||||||
localStorage.setItem("live2dhidden", "1");
|
localStorage.setItem("live2dhidden", "1");
|
||||||
$('#open_live2d').fadeOut(200);
|
$('#open_live2d').fadeOut(200);
|
||||||
$('#landlord').delay(200).fadeIn(200);
|
$('#landlord').delay(200).fadeIn(200);
|
||||||
setTimeout(function(){
|
setTimeout(function () {
|
||||||
AIFadeFlag = false;
|
AIFadeFlag = false;
|
||||||
},300);
|
}, 300);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#youduButton').on('click',function(){
|
$('#youduButton').on('click', function () {
|
||||||
if($('#youduButton').hasClass('doudong')){
|
if ($('#youduButton').hasClass('doudong')) {
|
||||||
var typeIs = $('#youduButton').attr('data-type');
|
var typeIs = $('#youduButton').attr('data-type');
|
||||||
$('#youduButton').removeClass('doudong');
|
$('#youduButton').removeClass('doudong');
|
||||||
$('body').removeClass(typeIs);
|
$('body').removeClass(typeIs);
|
||||||
$('#youduButton').attr('data-type','');
|
$('#youduButton').attr('data-type', '');
|
||||||
}else{
|
} else {
|
||||||
var duType = $('#duType').val();
|
var duType = $('#duType').val();
|
||||||
var duArr = duType.split(",");
|
var duArr = duType.split(",");
|
||||||
var dataType = duArr[Math.floor(Math.random() * duArr.length)];
|
var dataType = duArr[Math.floor(Math.random() * duArr.length)];
|
||||||
|
|
||||||
$('#youduButton').addClass('doudong');
|
$('#youduButton').addClass('doudong');
|
||||||
$('#youduButton').attr('data-type',dataType);
|
$('#youduButton').attr('data-type', dataType);
|
||||||
$('body').addClass(dataType);
|
$('body').addClass(dataType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(talkAPI!==""){
|
if (talkAPI !== "" && typeof EventSource !== 'undefined') {
|
||||||
$('#showInfoBtn').on('click',function(){
|
$('#showInfoBtn').on('click', function () {
|
||||||
var live_statu = $('#live_statu_val').val();
|
var live_statu = $('#live_statu_val').val();
|
||||||
if(live_statu=="0"){
|
if (live_statu == "0") {
|
||||||
return
|
return
|
||||||
}else{
|
} else {
|
||||||
$('#live_statu_val').val("0");
|
$('#live_statu_val').val("0");
|
||||||
$('.live_talk_input_body').fadeOut(500);
|
$('.live_talk_input_body').fadeOut(500);
|
||||||
AITalkFlag = false;
|
AITalkFlag = false;
|
||||||
@ -260,11 +284,11 @@ if(!norunFlag){
|
|||||||
$('#showInfoBtn').hide();
|
$('#showInfoBtn').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#showTalkBtn').on('click',function(){
|
$('#showTalkBtn').on('click', function () {
|
||||||
var live_statu = $('#live_statu_val').val();
|
var live_statu = $('#live_statu_val').val();
|
||||||
if(live_statu=="1"){
|
if (live_statu == "1") {
|
||||||
return
|
return
|
||||||
}else{
|
} else {
|
||||||
$('#live_statu_val').val("1");
|
$('#live_statu_val').val("1");
|
||||||
$('.live_talk_input_body').fadeIn(500);
|
$('.live_talk_input_body').fadeIn(500);
|
||||||
AITalkFlag = true;
|
AITalkFlag = true;
|
||||||
@ -273,126 +297,40 @@ if(!norunFlag){
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('#talk_send').on('click',function(){
|
$('#live_talk_input_form').on('submit', function (e) {
|
||||||
|
e.preventDefault();
|
||||||
var info_ = $('#AIuserText').val();
|
var info_ = $('#AIuserText').val();
|
||||||
var userid_ = $('#AIuserName').val();
|
// var userid_ = $('#AIuserName').val();
|
||||||
if(info_ == "" ){
|
let add_id = "";
|
||||||
showMessage('写点什么吧!',0);
|
if ($('#load_this').prop("checked")) {
|
||||||
return;
|
add_id = "&id=" + encodeURIComponent($('#post_id').val());
|
||||||
}
|
}
|
||||||
if(userid_ == ""){
|
if (info_ == "") {
|
||||||
showMessage('聊之前请告诉我你的名字吧!',0);
|
showMessage('写点什么吧!', 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
showMessage('思考中~', 0);
|
showMessage('思考中~', 0);
|
||||||
$.ajax({
|
showMessage(new EventSource(talkAPI + "?info=" + encodeURIComponent(info_) + add_id));
|
||||||
type: 'POST',
|
|
||||||
url: talkAPI,
|
|
||||||
data: {
|
|
||||||
"info":info_,
|
|
||||||
"userid":userid_
|
|
||||||
},
|
|
||||||
success: function(res) {
|
|
||||||
if(res.code !== 100000){
|
|
||||||
talkValTimer();
|
|
||||||
showMessage('似乎有什么错误,请和站长联系!',0);
|
|
||||||
}else{
|
|
||||||
talkValTimer();
|
|
||||||
showMessage(res.text,0);
|
|
||||||
}
|
|
||||||
console.log(res);
|
|
||||||
$('#AIuserText').val("");
|
|
||||||
sessionStorage.setItem("live2duser", userid_);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}else{
|
} else {
|
||||||
$('#showInfoBtn').hide();
|
$('#showInfoBtn').hide();
|
||||||
$('#showTalkBtn').hide();
|
$('#showTalkBtn').hide();
|
||||||
|
|
||||||
}
|
}
|
||||||
//获取音乐信息初始化
|
// //获取用户名
|
||||||
var bgmListInfo = $('input[name=live2dBGM]');
|
// var live2dUser = sessionStorage.getItem("live2duser");
|
||||||
if(bgmListInfo.length == 0){
|
// if(live2dUser !== null){
|
||||||
$('#musicButton').hide();
|
// $('#AIuserName').val(live2dUser);
|
||||||
}else{
|
// }
|
||||||
var bgmPlayNow = parseInt($('#live2d_bgm').attr('data-bgm'));
|
|
||||||
var bgmPlayTime = 0;
|
|
||||||
var live2dBGM_Num = sessionStorage.getItem("live2dBGM_Num");
|
|
||||||
var live2dBGM_PlayTime = sessionStorage.getItem("live2dBGM_PlayTime");
|
|
||||||
if(live2dBGM_Num){
|
|
||||||
if(live2dBGM_Num<=$('input[name=live2dBGM]').length-1){
|
|
||||||
bgmPlayNow = parseInt(live2dBGM_Num);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(live2dBGM_PlayTime){
|
|
||||||
bgmPlayTime = parseInt(live2dBGM_PlayTime);
|
|
||||||
}
|
|
||||||
var live2dBGMSrc = bgmListInfo.eq(bgmPlayNow).val();
|
|
||||||
$('#live2d_bgm').attr('data-bgm',bgmPlayNow);
|
|
||||||
$('#live2d_bgm').attr('src',live2dBGMSrc);
|
|
||||||
$('#live2d_bgm')[0].currentTime = bgmPlayTime;
|
|
||||||
$('#live2d_bgm')[0].volume = 0.5;
|
|
||||||
var live2dBGM_IsPlay = sessionStorage.getItem("live2dBGM_IsPlay");
|
|
||||||
var live2dBGM_WindowClose = sessionStorage.getItem("live2dBGM_WindowClose");
|
|
||||||
if(live2dBGM_IsPlay == '0' && live2dBGM_WindowClose == '0'){
|
|
||||||
$('#live2d_bgm')[0].play();
|
|
||||||
$('#musicButton').addClass('play');
|
|
||||||
}
|
|
||||||
sessionStorage.setItem("live2dBGM_WindowClose" , '1');
|
|
||||||
$('#musicButton').on('click',function(){
|
|
||||||
if($('#musicButton').hasClass('play')){
|
|
||||||
$('#live2d_bgm')[0].pause();
|
|
||||||
$('#musicButton').removeClass('play');
|
|
||||||
sessionStorage.setItem("live2dBGM_IsPlay",'1');
|
|
||||||
}else{
|
|
||||||
$('#live2d_bgm')[0].play();
|
|
||||||
$('#musicButton').addClass('play');
|
|
||||||
sessionStorage.setItem("live2dBGM_IsPlay",'0');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
window.onbeforeunload = function(){
|
|
||||||
sessionStorage.setItem("live2dBGM_WindowClose" , '0');
|
|
||||||
if($('#musicButton').hasClass('play')){
|
|
||||||
sessionStorage.setItem("live2dBGM_IsPlay",'0');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
document.getElementById('live2d_bgm').addEventListener("timeupdate", function(){
|
|
||||||
var live2dBgmPlayTimeNow = document.getElementById('live2d_bgm').currentTime;
|
|
||||||
sessionStorage.setItem("live2dBGM_PlayTime" , live2dBgmPlayTimeNow );
|
|
||||||
});
|
|
||||||
document.getElementById('live2d_bgm').addEventListener("ended", function(){
|
|
||||||
var listNow = parseInt($('#live2d_bgm').attr('data-bgm'));
|
|
||||||
listNow ++ ;
|
|
||||||
if(listNow > $('input[name=live2dBGM]').length-1){
|
|
||||||
listNow = 0;
|
|
||||||
}
|
|
||||||
var listNewSrc = $('input[name=live2dBGM]').eq(listNow).val();
|
|
||||||
sessionStorage.setItem("live2dBGM_Num",listNow);
|
|
||||||
$('#live2d_bgm').attr('src',listNewSrc);
|
|
||||||
$('#live2d_bgm')[0].play();
|
|
||||||
$('#live2d_bgm').attr('data-bgm',listNow);
|
|
||||||
});
|
|
||||||
document.getElementById('live2d_bgm').addEventListener("error", function(){
|
|
||||||
$('#live2d_bgm')[0].pause();
|
|
||||||
$('#musicButton').removeClass('play');
|
|
||||||
showMessage('音乐似乎加载不出来了呢!',0);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//获取用户名
|
|
||||||
var live2dUser = sessionStorage.getItem("live2duser");
|
|
||||||
if(live2dUser !== null){
|
|
||||||
$('#AIuserName').val(live2dUser);
|
|
||||||
}
|
|
||||||
//获取位置
|
//获取位置
|
||||||
var landL = sessionStorage.getItem("historywidth");
|
var landL = sessionStorage.getItem("historywidth");
|
||||||
var landB = sessionStorage.getItem("historyheight");
|
var landB = sessionStorage.getItem("historyheight");
|
||||||
if(landL == null || landB ==null){
|
if (landL == null || landB == null) {
|
||||||
landL = '5px'
|
landL = '5px'
|
||||||
landB = '0px'
|
landB = '0px'
|
||||||
}
|
}
|
||||||
$('#landlord').css('left',landL+'px');
|
$('#landlord').css('left', landL + 'px');
|
||||||
$('#landlord').css('bottom',landB + 'px');
|
$('#landlord').css('bottom', landB + 'px');
|
||||||
//移动
|
//移动
|
||||||
function getEvent() {
|
function getEvent() {
|
||||||
return window.event || arguments.callee.caller.arguments[0];
|
return window.event || arguments.callee.caller.arguments[0];
|
||||||
@ -405,7 +343,7 @@ if(!norunFlag){
|
|||||||
var moveable = false;
|
var moveable = false;
|
||||||
var docMouseMoveEvent = document.onmousemove;
|
var docMouseMoveEvent = document.onmousemove;
|
||||||
var docMouseUpEvent = document.onmouseup;
|
var docMouseUpEvent = document.onmouseup;
|
||||||
smcc.onmousedown = function(){
|
smcc.onmousedown = function () {
|
||||||
var ent = getEvent();
|
var ent = getEvent();
|
||||||
moveable = true;
|
moveable = true;
|
||||||
moveX = ent.clientX;
|
moveX = ent.clientX;
|
||||||
@ -413,20 +351,20 @@ if(!norunFlag){
|
|||||||
var obj = smcc;
|
var obj = smcc;
|
||||||
moveBottom = parseInt(obj.style.bottom);
|
moveBottom = parseInt(obj.style.bottom);
|
||||||
moveLeft = parseInt(obj.style.left);
|
moveLeft = parseInt(obj.style.left);
|
||||||
if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
|
if (isFirefox = navigator.userAgent.indexOf("Firefox") > 0) {
|
||||||
window.getSelection().removeAllRanges();
|
window.getSelection().removeAllRanges();
|
||||||
}
|
}
|
||||||
document.onmousemove = function(){
|
document.onmousemove = function () {
|
||||||
if(moveable){
|
if (moveable) {
|
||||||
var ent = getEvent();
|
var ent = getEvent();
|
||||||
var x = moveLeft + ent.clientX - moveX;
|
var x = moveLeft + ent.clientX - moveX;
|
||||||
var y = moveBottom + (moveY - ent.clientY);
|
var y = moveBottom + (moveY - ent.clientY);
|
||||||
obj.style.left = x + "px";
|
obj.style.left = x + "px";
|
||||||
obj.style.bottom = y + "px";
|
obj.style.bottom = y + "px";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
document.onmouseup = function(){
|
document.onmouseup = function () {
|
||||||
if(moveable){
|
if (moveable) {
|
||||||
var historywidth = obj.style.left;
|
var historywidth = obj.style.left;
|
||||||
var historyheight = obj.style.bottom;
|
var historyheight = obj.style.bottom;
|
||||||
historywidth = historywidth.replace('px', '');
|
historywidth = historywidth.replace('px', '');
|
||||||
@ -443,37 +381,105 @@ if(!norunFlag){
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
//获取音乐信息初始化
|
||||||
|
var bgmListInfo = $('input[name=live2dBGM]');
|
||||||
|
if (bgmListInfo.length == 0) {
|
||||||
|
$('#musicButton').hide();
|
||||||
|
} else {
|
||||||
|
var bgmPlayNow = parseInt($('#live2d_bgm').attr('data-bgm'));
|
||||||
|
var bgmPlayTime = 0;
|
||||||
|
var live2dBGM_Num = sessionStorage.getItem("live2dBGM_Num");
|
||||||
|
var live2dBGM_PlayTime = sessionStorage.getItem("live2dBGM_PlayTime");
|
||||||
|
if (live2dBGM_Num) {
|
||||||
|
if (live2dBGM_Num <= $('input[name=live2dBGM]').length - 1) {
|
||||||
|
bgmPlayNow = parseInt(live2dBGM_Num);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (live2dBGM_PlayTime) {
|
||||||
|
bgmPlayTime = parseInt(live2dBGM_PlayTime);
|
||||||
|
}
|
||||||
|
var live2dBGMSrc = bgmListInfo.eq(bgmPlayNow).val();
|
||||||
|
$('#live2d_bgm').attr('data-bgm', bgmPlayNow);
|
||||||
|
$('#live2d_bgm').attr('src', live2dBGMSrc);
|
||||||
|
$('#live2d_bgm')[0].currentTime = bgmPlayTime;
|
||||||
|
$('#live2d_bgm')[0].volume = 0.5;
|
||||||
|
var live2dBGM_IsPlay = sessionStorage.getItem("live2dBGM_IsPlay");
|
||||||
|
var live2dBGM_WindowClose = sessionStorage.getItem("live2dBGM_WindowClose");
|
||||||
|
if (live2dBGM_IsPlay == '0' && live2dBGM_WindowClose == '0') {
|
||||||
|
$('#live2d_bgm')[0].play();
|
||||||
|
$('#musicButton').addClass('play');
|
||||||
|
}
|
||||||
|
sessionStorage.setItem("live2dBGM_WindowClose", '1');
|
||||||
|
$('#musicButton').on('click', function () {
|
||||||
|
if ($('#musicButton').hasClass('play')) {
|
||||||
|
$('#live2d_bgm')[0].pause();
|
||||||
|
$('#musicButton').removeClass('play');
|
||||||
|
sessionStorage.setItem("live2dBGM_IsPlay", '1');
|
||||||
|
} else {
|
||||||
|
$('#live2d_bgm')[0].play();
|
||||||
|
$('#musicButton').addClass('play');
|
||||||
|
sessionStorage.setItem("live2dBGM_IsPlay", '0');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
window.onbeforeunload = function () {
|
||||||
|
sessionStorage.setItem("live2dBGM_WindowClose", '0');
|
||||||
|
if ($('#musicButton').hasClass('play')) {
|
||||||
|
sessionStorage.setItem("live2dBGM_IsPlay", '0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
document.getElementById('live2d_bgm').addEventListener("timeupdate", function () {
|
||||||
|
var live2dBgmPlayTimeNow = document.getElementById('live2d_bgm').currentTime;
|
||||||
|
sessionStorage.setItem("live2dBGM_PlayTime", live2dBgmPlayTimeNow);
|
||||||
|
});
|
||||||
|
document.getElementById('live2d_bgm').addEventListener("ended", function () {
|
||||||
|
var listNow = parseInt($('#live2d_bgm').attr('data-bgm'));
|
||||||
|
listNow++;
|
||||||
|
if (listNow > $('input[name=live2dBGM]').length - 1) {
|
||||||
|
listNow = 0;
|
||||||
|
}
|
||||||
|
var listNewSrc = $('input[name=live2dBGM]').eq(listNow).val();
|
||||||
|
sessionStorage.setItem("live2dBGM_Num", listNow);
|
||||||
|
$('#live2d_bgm').attr('src', listNewSrc);
|
||||||
|
$('#live2d_bgm')[0].play();
|
||||||
|
$('#live2d_bgm').attr('data-bgm', listNow);
|
||||||
|
});
|
||||||
|
document.getElementById('live2d_bgm').addEventListener("error", function () {
|
||||||
|
$('#live2d_bgm')[0].pause();
|
||||||
|
$('#musicButton').removeClass('play');
|
||||||
|
showMessage('音乐似乎加载不出来了呢!', 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$(document).ready(function() {
|
$(document).ready(function () {
|
||||||
var AIimgSrc = [
|
var AIimgSrc = [
|
||||||
home_Path + message_Path + "model/histoire/histoire.1024/texture_00.png",
|
message_Path + "model/histoire/histoire.1024/texture_00.png",
|
||||||
home_Path + message_Path + "model/histoire/histoire.1024/texture_01.png",
|
message_Path + "model/histoire/histoire.1024/texture_01.png",
|
||||||
home_Path + message_Path + "model/histoire/histoire.1024/texture_02.png",
|
message_Path + "model/histoire/histoire.1024/texture_02.png",
|
||||||
home_Path + message_Path + "model/histoire/histoire.1024/texture_03.png"
|
message_Path + "model/histoire/histoire.1024/texture_03.png"
|
||||||
]
|
]
|
||||||
var images = [];
|
var images = [];
|
||||||
var imgLength = AIimgSrc.length;
|
var imgLength = AIimgSrc.length;
|
||||||
var loadingNum = 0;
|
var loadingNum = 0;
|
||||||
for(var i=0;i<imgLength;i++){
|
for (var i = 0; i < imgLength; i++) {
|
||||||
images[i] = new Image();
|
images[i] = new Image();
|
||||||
images[i].src = AIimgSrc[i];
|
images[i].src = AIimgSrc[i];
|
||||||
images[i].onload = function(){
|
images[i].onload = function () {
|
||||||
loadingNum++;
|
loadingNum++;
|
||||||
if(loadingNum===imgLength){
|
if (loadingNum === imgLength) {
|
||||||
var live2dhidden = localStorage.getItem("live2dhidden");
|
var live2dhidden = localStorage.getItem("live2dhidden");
|
||||||
if(live2dhidden==="0"){
|
if (live2dhidden === "0") {
|
||||||
setTimeout(function(){
|
setTimeout(function () {
|
||||||
$('#open_live2d').fadeIn(200);
|
$('#open_live2d').fadeIn(200);
|
||||||
},1300);
|
}, 1300);
|
||||||
}else{
|
} else {
|
||||||
setTimeout(function(){
|
setTimeout(function () {
|
||||||
$('#landlord').fadeIn(200);
|
$('#landlord').fadeIn(200);
|
||||||
},1300);
|
}, 1300);
|
||||||
}
|
}
|
||||||
setTimeout(function(){
|
setTimeout(function () {
|
||||||
loadlive2d("live2d", message_Path+"model/histoire/model.json");
|
loadlive2d("live2d", message_Path + "model/histoire/model.json");
|
||||||
},1000);
|
}, 1000);
|
||||||
initLive2d ();
|
initLive2d();
|
||||||
images = null;
|
images = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 824 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 826 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 658 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 252 KiB |
@ -1,58 +0,0 @@
|
|||||||
{
|
|
||||||
"version":"1.0.0",
|
|
||||||
"model":"model.moc",
|
|
||||||
"textures":[
|
|
||||||
"histoire.1024/0.png",
|
|
||||||
"histoire.1024/1.png",
|
|
||||||
"histoire.1024/normal_2.png"
|
|
||||||
],
|
|
||||||
"layout":{
|
|
||||||
"center_x":0.0,
|
|
||||||
"center_y":-0.05,
|
|
||||||
"width":2.0
|
|
||||||
},
|
|
||||||
"hit_areas_custom":{
|
|
||||||
"head_x":[-1, 1],
|
|
||||||
"head_y":[1, -1],
|
|
||||||
"body_x":[-1, -1],
|
|
||||||
"body_y":[1, -1]
|
|
||||||
},
|
|
||||||
"motions":{
|
|
||||||
"idle":[
|
|
||||||
{"file":"motions/idle/idle_00.mtn"},
|
|
||||||
{"file":"motions/idle/idle_01.mtn"},
|
|
||||||
{"file":"motions/idle/idle_02.mtn"}
|
|
||||||
],
|
|
||||||
"sleepy":[
|
|
||||||
{"file":"motions/tap/shake.mtn"}
|
|
||||||
],
|
|
||||||
"flick_head":[
|
|
||||||
{"file":"motions/tap/refuse.mtn"},
|
|
||||||
{"file":"motions/tap/nep_slide_head_2.mtn"},
|
|
||||||
{"file":"motions/tap/nep_touch_belly_2.mtn"},
|
|
||||||
{"file":"motions/tap/nep_touch_boobs_1.mtn"}
|
|
||||||
],
|
|
||||||
"tap_body":[
|
|
||||||
{"file":"motions/tap/smile.mtn"}
|
|
||||||
|
|
||||||
],
|
|
||||||
"talk":[
|
|
||||||
{"file":"motions/tap/nep_touch_belly_1.mtn"},
|
|
||||||
{"file":"motions/tap/nep_slide_head_2.mtn"},
|
|
||||||
{"file":"motions/tap/nep_touch_head_1.mtn"}
|
|
||||||
|
|
||||||
],
|
|
||||||
"rest":[
|
|
||||||
{"file":"motions/tap/tilt_head.mtn"},
|
|
||||||
{"file":"motions/idle/idle_00.mtn"},
|
|
||||||
{"file":"motions/idle/idle_01.mtn"},
|
|
||||||
{"file":"motions/idle/idle_02.mtn"}
|
|
||||||
],
|
|
||||||
"":[
|
|
||||||
{"file":"motions/tap/nep_touch_belly_1.mtn"},
|
|
||||||
{"file":"motions/tap/nep_slide_head_2.mtn"},
|
|
||||||
{"file":"motions/tap/nep_touch_head_1.mtn"},
|
|
||||||
{"file":"motions/tap/nep_touch_boobs_1.mtn"}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user