hexo-theme-gnix 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/README.md +106 -0
  2. package/include/hexo/filter/locals.js +109 -0
  3. package/include/hexo/generator/categories.js +12 -0
  4. package/include/hexo/generator/category.js +52 -0
  5. package/include/hexo/generator/insight.js +50 -0
  6. package/include/hexo/generator/manifest.js +23 -0
  7. package/include/hexo/generator/tags.js +12 -0
  8. package/include/hexo/helper/cdn.js +21 -0
  9. package/include/hexo/helper/page.js +27 -0
  10. package/include/hexo/view.js +40 -0
  11. package/include/register.js +11 -0
  12. package/include/util/common.js +33 -0
  13. package/languages/en.yml +47 -0
  14. package/languages/fr.yml +46 -0
  15. package/languages/ja.yml +46 -0
  16. package/languages/zh-CN.yml +47 -0
  17. package/languages/zh-TW.yml +47 -0
  18. package/layout/archive.jsx +118 -0
  19. package/layout/categories.jsx +137 -0
  20. package/layout/category.jsx +38 -0
  21. package/layout/comment/disqus.jsx +79 -0
  22. package/layout/comment/disqusjs.jsx +127 -0
  23. package/layout/comment/giscus.jsx +193 -0
  24. package/layout/comment/gitalk.jsx +141 -0
  25. package/layout/comment/twikoo.jsx +63 -0
  26. package/layout/comment/utterances.jsx +86 -0
  27. package/layout/comment/valine.jsx +143 -0
  28. package/layout/comment/waline.jsx +156 -0
  29. package/layout/common/article.jsx +131 -0
  30. package/layout/common/article_cover.jsx +33 -0
  31. package/layout/common/article_media.jsx +34 -0
  32. package/layout/common/comment.jsx +38 -0
  33. package/layout/common/footer.jsx +228 -0
  34. package/layout/common/head.jsx +242 -0
  35. package/layout/common/navbar.jsx +219 -0
  36. package/layout/common/plugins.jsx +39 -0
  37. package/layout/common/scripts.jsx +49 -0
  38. package/layout/common/search.jsx +22 -0
  39. package/layout/common/theme_selector.jsx +79 -0
  40. package/layout/common/toc.jsx +53 -0
  41. package/layout/index.jsx +29 -0
  42. package/layout/layout.jsx +34 -0
  43. package/layout/misc/article_licensing.jsx +114 -0
  44. package/layout/misc/meta.jsx +61 -0
  45. package/layout/misc/open_graph.jsx +164 -0
  46. package/layout/misc/paginator.jsx +90 -0
  47. package/layout/misc/structured_data.jsx +110 -0
  48. package/layout/misc/web_app.jsx +106 -0
  49. package/layout/page.jsx +12 -0
  50. package/layout/plugin/bing_webmaster.jsx +47 -0
  51. package/layout/plugin/busuanzi.jsx +40 -0
  52. package/layout/plugin/clarity.jsx +22 -0
  53. package/layout/plugin/cookie_consent.jsx +136 -0
  54. package/layout/plugin/google_analytics.jsx +66 -0
  55. package/layout/plugin/google_tag_mamager.jsx +41 -0
  56. package/layout/plugin/netlify.jsx +39 -0
  57. package/layout/plugin/pjax.jsx +20 -0
  58. package/layout/plugin/statcounter.jsx +69 -0
  59. package/layout/plugin/twitter_conversion_tracking.jsx +51 -0
  60. package/layout/post.jsx +16 -0
  61. package/layout/search/insight.jsx +53 -0
  62. package/layout/tag.jsx +29 -0
  63. package/layout/tags.jsx +55 -0
  64. package/package.json +42 -0
  65. package/scripts/index.js +1 -0
  66. package/source/css/callout_blocks.css +204 -0
  67. package/source/css/default.css +1590 -0
  68. package/source/css/font/woff2/Futura-Book.woff2 +0 -0
  69. package/source/css/font/woff2/Paris2024-Variable.woff2 +0 -0
  70. package/source/css/font/woff2/doto.woff2 +0 -0
  71. package/source/css/optional/chinese.css +17 -0
  72. package/source/css/responsive/desktop.css +164 -0
  73. package/source/css/responsive/mobile.css +46 -0
  74. package/source/css/responsive/tablet.css +46 -0
  75. package/source/css/responsive/touch.css +254 -0
  76. package/source/css/shiki/shiki.min.css +1 -0
  77. package/source/css/twikoo.css +2143 -0
  78. package/source/img/avatar.webp +0 -0
  79. package/source/img/background.webp +0 -0
  80. package/source/img/favicon.svg +6 -0
  81. package/source/img/logo.svg +9 -0
  82. package/source/img/og_image.png +0 -0
  83. package/source/js/busuanzi.js +46 -0
  84. package/source/js/host/cookieconsent/3.1.1/build/cookieconsent.min.css +6 -0
  85. package/source/js/host/cookieconsent/3.1.1/build/cookieconsent.min.js +1 -0
  86. package/source/js/host/iconify-icon/3.0.2/iconify-icon.min.js +12 -0
  87. package/source/js/host/medium-zoom/dist/medium-zoom.min.js +2 -0
  88. package/source/js/host/mermaid/mermaid.min.js +2811 -0
  89. package/source/js/host/pjax/0.2.8/pjax.min.js +1 -0
  90. package/source/js/host/twikoo/1.6.41/dist/twikoo.all.min.js +2 -0
  91. package/source/js/insight.js +330 -0
  92. package/source/js/instant-page.min.js +1 -0
  93. package/source/js/live2d_Asoul/Model/Ava/Ava.4096/texture_00.webp +0 -0
  94. package/source/js/live2d_Asoul/Model/Ava/Ava.moc3 +0 -0
  95. package/source/js/live2d_Asoul/Model/Ava/Ava.model3.json +323 -0
  96. package/source/js/live2d_Asoul/Model/Ava/Ava.physics3.json +1225 -0
  97. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_idle.motion3.json +1 -0
  98. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_shake01.motion3.json +1 -0
  99. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_shake02.motion3.json +1 -0
  100. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap01.motion3.json +1 -0
  101. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap02.motion3.json +1 -0
  102. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap03.motion3.json +1 -0
  103. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap04.motion3.json +1 -0
  104. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap05.motion3.json +1 -0
  105. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap06.motion3.json +1 -0
  106. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap07.motion3.json +1 -0
  107. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap08.motion3.json +1 -0
  108. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap09.motion3.json +1 -0
  109. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap10.motion3.json +1 -0
  110. package/source/js/live2d_Asoul/Model/Ava/motions/Ava_tap11.motion3.json +1 -0
  111. package/source/js/live2d_Asoul/Model/Ava/raw.ex.json +16 -0
  112. package/source/js/live2d_Asoul/Model/Ava/raw.model3.json +321 -0
  113. package/source/js/live2d_Asoul/Model/Diana/Diana.4096/texture_00.webp +0 -0
  114. package/source/js/live2d_Asoul/Model/Diana/Diana.moc3 +0 -0
  115. package/source/js/live2d_Asoul/Model/Diana/Diana.model3.json +212 -0
  116. package/source/js/live2d_Asoul/Model/Diana/Diana.physics3.json +764 -0
  117. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_idle.motion3.json +1 -0
  118. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap01.motion3.json +1 -0
  119. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap02.motion3.json +1 -0
  120. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap03.motion3.json +1 -0
  121. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap04.motion3.json +1 -0
  122. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap05.motion3.json +1 -0
  123. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap06.motion3.json +1 -0
  124. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap07.motion3.json +1 -0
  125. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap08.motion3.json +1 -0
  126. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap09.motion3.json +1 -0
  127. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap10.motion3.json +1 -0
  128. package/source/js/live2d_Asoul/Model/Diana/motions/Diana_tap11.motion3.json +1 -0
  129. package/source/js/live2d_Asoul/Model/Diana/raw.ex.json +16 -0
  130. package/source/js/live2d_Asoul/Model/Diana/raw.model3.json +210 -0
  131. package/source/js/live2d_Asoul/TweenLite.js +12 -0
  132. package/source/js/live2d_Asoul/cubism4.min.js +2 -0
  133. package/source/js/live2d_Asoul/live2dcubismcore.min.js +9 -0
  134. package/source/js/live2d_Asoul/load.js +231 -0
  135. package/source/js/live2d_Asoul/pio.css +161 -0
  136. package/source/js/live2d_Asoul/pio.js +296 -0
  137. package/source/js/live2d_Asoul/pio_sdk4.js +149 -0
  138. package/source/js/live2d_Asoul/pixi.min.js +9 -0
  139. package/source/js/main.js +218 -0
  140. package/source/js/pjax.js +29 -0
  141. package/source/js/shiki/shiki.js +191 -0
  142. package/source/js/theme-selector.js +206 -0
  143. package/util/cache.js +47 -0
@@ -0,0 +1,231 @@
1
+ var 引流 = [
2
+ "https://space.bilibili.com/672328094",
3
+ "https://www.bilibili.com/video/BV1FZ4y1F7HH",
4
+ "https://www.bilibili.com/video/BV1FX4y1g7u8",
5
+ "https://www.bilibili.com/video/BV1aK4y1P7Cg",
6
+ "https://www.bilibili.com/video/BV17A411V7Uh",
7
+ "https://www.bilibili.com/video/BV1JV411b7Pc",
8
+ "https://www.bilibili.com/video/BV1AV411v7er",
9
+ "https://www.bilibili.com/video/BV1564y1173Q",
10
+
11
+ "https://www.bilibili.com/video/BV1MX4y1N75X",
12
+ "https://www.bilibili.com/video/BV17h411U71w",
13
+ "https://www.bilibili.com/video/BV1ry4y1Y71t",
14
+ "https://www.bilibili.com/video/BV1Sy4y1n7c4",
15
+ "https://www.bilibili.com/video/BV15y4y177uk",
16
+ "https://www.bilibili.com/video/BV1PN411X7QW",
17
+ "https://www.bilibili.com/video/BV1Dp4y1H7iB",
18
+ "https://www.bilibili.com/video/BV1bi4y1P7Eh",
19
+ "https://www.bilibili.com/video/BV1vQ4y1Z7C2",
20
+ "https://www.bilibili.com/video/BV1oU4y1h7Sc",
21
+ ]
22
+
23
+ const initConfig = {
24
+ mode: "fixed",
25
+ hidden: true,
26
+ content: {
27
+ link: 引流[Math.floor(Math.random() * 引流.length)],
28
+ welcome: ["Hi!"],
29
+ touch: "",
30
+ skin: ["诶,想看看其他团员吗?", "替换后入场文本"],
31
+ custom: [
32
+ { "selector": ".comment-form", "text": "Content Tooltip" },
33
+ { "selector": ".home-social a:last-child", "text": "Blog Tooltip" },
34
+ { "selector": ".list .postname", "type": "read" },
35
+ { "selector": ".post-content a, .page-content a, .post a", "type": "link" }
36
+ ],
37
+ },
38
+ night: "toggleNightMode()",
39
+ model: [
40
+ "/js/live2d_Asoul/Model/Ava/Ava.model3.json",
41
+ "/js/live2d_Asoul/Model/Diana/Diana.model3.json",
42
+ // "https://cdn.jsdelivr.net/gh/efterklang/live2d_Asoul/live2d/Ava/Ava.model3.json",
43
+ ],
44
+ tips: true,
45
+ onModelLoad: onModelLoad
46
+ }
47
+
48
+ function 加载圣·嘉然() {
49
+ pio_reference = new Paul_Pio(initConfig)
50
+
51
+ pio_alignment = "left"
52
+
53
+ // Then apply style
54
+ pio_refresh_style()
55
+ }
56
+
57
+ function onModelLoad(model) {
58
+ const container = document.getElementById("pio-container")
59
+ const canvas = document.getElementById("pio")
60
+ const modelNmae = model.internalModel.settings.name
61
+ const coreModel = model.internalModel.coreModel
62
+ const motionManager = model.internalModel.motionManager
63
+
64
+ let touchList = [
65
+ {
66
+ text: "点击展示文本1",
67
+ motion: "Idle"
68
+ },
69
+ {
70
+ text: "点击展示文本2",
71
+ motion: "Idle"
72
+ }
73
+ ]
74
+
75
+ function playAction(action) {
76
+ action.text && pio_reference.modules.render(action.text)
77
+ action.motion && pio_reference.model.motion(action.motion)
78
+
79
+ if (action.from && action.to) {
80
+ Object.keys(action.from).forEach(id => {
81
+ const hidePartIndex = coreModel._partIds.indexOf(id)
82
+ TweenLite.to(coreModel._partOpacities, 0.6, { [hidePartIndex]: action.from[id] });
83
+ // coreModel._partOpacities[hidePartIndex] = action.from[id]
84
+ })
85
+
86
+ motionManager.once("motionFinish", (data) => {
87
+ Object.keys(action.to).forEach(id => {
88
+ const hidePartIndex = coreModel._partIds.indexOf(id)
89
+ TweenLite.to(coreModel._partOpacities, 0.6, { [hidePartIndex]: action.to[id] });
90
+ // coreModel._partOpacities[hidePartIndex] = action.to[id]
91
+ })
92
+ })
93
+ }
94
+ }
95
+
96
+ canvas.onclick = function () {
97
+ if (motionManager.state.currentGroup !== "Idle") return
98
+
99
+ const action = pio_reference.modules.rand(touchList)
100
+ playAction(action)
101
+ }
102
+
103
+ if (modelNmae === "Diana") {
104
+ container.dataset.model = "Diana"
105
+ initConfig.content.skin[1] = ["我是吃货担当 嘉然 Diana~"]
106
+ playAction({ motion: "Tap抱阿草-左手" })
107
+
108
+ touchList = [
109
+ {
110
+ text: "嘉心糖屁用没有",
111
+ motion: "Tap生气 -领结"
112
+ },
113
+ {
114
+ text: "有人急了,但我不说是谁~",
115
+ motion: "Tap= = 左蝴蝶结"
116
+ },
117
+ {
118
+ text: "呜呜...呜呜呜....",
119
+ motion: "Tap哭 -眼角"
120
+ },
121
+ {
122
+ text: "想然然了没有呀~",
123
+ motion: "Tap害羞-中间刘海"
124
+ },
125
+ {
126
+ text: "阿草好软呀~",
127
+ motion: "Tap抱阿草-左手"
128
+ },
129
+ {
130
+ text: "不要再戳啦!好痒!",
131
+ motion: "Tap摇头- 身体"
132
+ },
133
+ {
134
+ text: "嗷呜~~~",
135
+ motion: "Tap耳朵-发卡"
136
+ },
137
+ {
138
+ text: "zzZ。。。",
139
+ motion: "Leave"
140
+ },
141
+ {
142
+ text: "哇!好吃的!",
143
+ motion: "Tap右头发"
144
+ },
145
+ ]
146
+
147
+ } else if (modelNmae === "Ava") {
148
+ container.dataset.model = "Ava"
149
+ initConfig.content.skin[1] = ["我是<s>拉胯</s>Gamer担当 向晚 AvA~"]
150
+ playAction({
151
+ motion: "Tap左眼",
152
+ from: {
153
+ "Part15": 1
154
+ },
155
+ to: {
156
+ "Part15": 0
157
+ }
158
+ })
159
+
160
+ touchList = [
161
+ {
162
+ text: "水母 水母~ 只是普通的生物",
163
+ motion: "Tap右手"
164
+ },
165
+ {
166
+ text: "可爱的鸽子鸽子~我喜欢你~",
167
+ motion: "Tap胸口项链",
168
+ from: {
169
+ "Part12": 1
170
+ },
171
+ to: {
172
+ "Part12": 0
173
+ }
174
+ },
175
+ {
176
+ text: "好...好兄弟之间喜欢很正常啦",
177
+ motion: "Tap中间刘海",
178
+ from: {
179
+ "Part12": 1
180
+ },
181
+ to: {
182
+ "Part12": 0
183
+ }
184
+ },
185
+ {
186
+ text: "啊啊啊!怎么推流辣",
187
+ motion: "Tap右眼",
188
+ from: {
189
+ "Part16": 1
190
+ },
191
+ to: {
192
+ "Part16": 0
193
+ }
194
+ },
195
+ {
196
+ text: "你怎么老摸我,我的身体是不是可有魅力",
197
+ motion: "Tap嘴"
198
+ },
199
+ {
200
+ text: "AAAAAAAAAAvvvvAAA 向晚!",
201
+ motion: "Tap左眼",
202
+ from: {
203
+ "Part15": 1
204
+ },
205
+ to: {
206
+ "Part15": 0
207
+ }
208
+ }
209
+ ]
210
+ canvas.width = model.width * 1.2
211
+ const hideParts = [
212
+ "Part5", // 晕
213
+ "neko", // 喵喵拳
214
+ "game", // 左手游戏手柄
215
+ "Part15", // 墨镜
216
+ "Part21", // 右手小臂
217
+ "Part22", // 左手垂下
218
+ "Part", // 双手抱拳
219
+ "Part16", // 惊讶特效
220
+ "Part12" // 小心心
221
+ ]
222
+ const hidePartsIndex = hideParts.map(id => coreModel._partIds.indexOf(id))
223
+ hidePartsIndex.forEach(idx => {
224
+ coreModel._partOpacities[idx] = 0
225
+ })
226
+ }
227
+ }
228
+
229
+
230
+ var pio_reference
231
+ window.onload = 加载圣·嘉然
@@ -0,0 +1,161 @@
1
+ /* ----
2
+
3
+ # Pio Plugin
4
+ # By: Dreamer-Paul
5
+ # Modify: journey-ad
6
+ # Last Update: 2021.5.10
7
+
8
+ 一个支持更换 Live2D 模型的 Typecho 插件。
9
+
10
+ 本代码为奇趣保罗原创,并遵守 GPL 2.0 开源协议。欢迎访问我的博客:https://paugram.com
11
+
12
+ ---- */
13
+
14
+ .pio-container {
15
+ bottom: 0;
16
+ z-index: 2000;
17
+ color: #666;
18
+ position: fixed;
19
+ user-select: none;
20
+ }
21
+
22
+ .pio-container .pio-show {
23
+ left: -1.2em;
24
+ bottom: -0.2em;
25
+ width: 6em;
26
+ height: 6.8em;
27
+ display: none;
28
+ cursor: pointer;
29
+ position: absolute;
30
+ transition: all 0.3s;
31
+ opacity: 0.7;
32
+ }
33
+
34
+ .pio-container.hidden .pio-show {
35
+ display: block;
36
+ }
37
+
38
+ .pio-container.hidden .pio-show:hover {
39
+ opacity: 0.9;
40
+ transform: translateX(0.5em);
41
+ }
42
+
43
+ .pio-container.hidden #pio {
44
+ display: none;
45
+ }
46
+
47
+ .pio-container.hidden .pio-dialog {
48
+ display: none;
49
+ }
50
+
51
+ .pio-container.left {
52
+ left: 0;
53
+ }
54
+
55
+ .pio-container.right {
56
+ right: 0;
57
+ }
58
+
59
+ .pio-container.active {
60
+ cursor: move;
61
+ }
62
+
63
+ .pio-container.static {
64
+ pointer-events: none;
65
+ }
66
+
67
+ .pio-container .pio-action {
68
+ top: 3em;
69
+ opacity: 0;
70
+ position: absolute;
71
+ transition: opacity 0.3s;
72
+ }
73
+
74
+ .pio-container.left .pio-action {
75
+ right: 0;
76
+ }
77
+
78
+ .pio-container.right .pio-action {
79
+ left: 0;
80
+ }
81
+
82
+ .pio-container:hover .pio-action {
83
+ opacity: 1;
84
+ }
85
+
86
+ .pio-action span {
87
+ color: var(--ctp-lavender);
88
+ width: 2em;
89
+ height: 2em;
90
+ margin-bottom: 0.6em;
91
+ display: block;
92
+ cursor: pointer;
93
+ text-align: center;
94
+ margin-bottom: 0.5em;
95
+ background-size: 100%;
96
+ }
97
+
98
+ .pio-action .pio-home {
99
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M472.86 249.918V361.57c-.024 61.53-49.899 111.404-111.431 111.43h-222.86c-61.529-.026-111.403-49.9-111.428-111.43V249.918a111.828 111.828 0 0 1 35.658-81.79L189.383 50.904c34.128-31.872 87.109-31.872 121.234 0l126.585 117.224a111.825 111.825 0 0 1 35.658 81.79z' fill='%23c3cbd3'/%3E%3Cpath d='M327.334 317.02c-.062 9.206-7.511 16.653-16.717 16.715H189.383c-12.867 0-20.908-13.93-14.475-25.073a16.718 16.718 0 0 1 14.475-8.357h121.234c9.239-.011 16.729 7.478 16.717 16.715z' fill='%23202020'/%3E%3C/svg%3E");
100
+ }
101
+
102
+ .pio-action .pio-close {
103
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M249.999 198.668L352.665 96c14.667-14.666 36.668-14.666 51.335 0 14.666 14.667 14.666 36.668 0 51.334L301.333 250 404 352.668c14.666 14.667 14.666 36.666 0 51.332-14.667 14.667-36.667 14.667-51.334 0L249.999 301.334 147.333 404c-14.668 14.667-36.666 14.667-51.334 0-14.666-14.666-14.666-36.665 0-51.332L198.666 250 95.999 147.334c-14.666-14.666-14.666-36.667 0-51.334 14.668-14.666 36.665-14.666 51.333 0l102.667 102.668z' fill='%23873a18'/%3E%3C/svg%3E");
104
+ }
105
+
106
+ .pio-action .pio-skin {
107
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 249.999C5 385.312 114.688 495 250.001 495 385.312 495 495 385.312 495 249.999 495 114.688 385.312 5 250.001 5 114.688 5 5 114.688 5 249.999z' fill='%23FEC43C'/%3E%3Cpath d='M490.1 200.509C467.071 88.789 368.58 5 250.001 5 114.76 5 5 114.76 5 249.999 5 309.29 26.07 363.19 60.86 405.33c41.65 23.03 89.18 35.77 140.14 35.77 144.06 0 263.621-103.88 289.1-240.591z' fill='%23FFD73A'/%3E%3Cpath d='M116.712 225.3c0 34.539 37.39 56.125 67.301 38.856a44.868 44.868 0 0 0 22.433-38.856c0-24.779-20.089-44.866-44.87-44.866-24.778 0-44.864 20.087-44.864 44.866zm219.346 0c0 24.779 20.087 44.866 44.867 44.866 24.778 0 44.864-20.091 44.864-44.866 0-24.779-20.09-44.864-44.866-44.864-24.778 0-44.865 20.085-44.865 44.864z' fill='%23873A18'/%3E%3Cpath d='M271.251 334.973H201.46c-8.474 0-14.956-6.482-14.956-14.956 0-8.477 6.482-14.957 14.956-14.957h69.791c8.476 0 14.957 6.483 14.957 14.957s-6.484 14.956-14.957 14.956zM158.59 210.343H79.818c-6.979 0-12.962-6.482-12.962-14.957 0-8.473 5.982-14.95 12.966-14.95h78.763c6.975 0 12.962 6.478 12.962 14.95 0 8.478-5.987 14.957-12.966 14.957zm217.348 0h-74.775c-8.477 0-14.956-6.482-14.956-14.957 0-8.473 6.484-14.95 14.956-14.95h74.774c8.478 0 14.956 6.478 14.956 14.95 0 8.478-6.482 14.957-14.956 14.957z' fill='%23873A18'/%3E%3Cpath d='M54 161.799c-26.95 0-49-22.05-49-48.999C5 68.699 54 5 54 5s48.999 63.699 48.999 107.8c0 26.949-22.049 48.999-48.999 48.999z' fill='%2361A3E0'/%3E%3C/svg%3E");
108
+ }
109
+
110
+ .pio-action .pio-info {
111
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'%3E%3Crect transform='rotate(45.001 238.211 363.575)' x='29.285' y='22.411' width='273.903' height='505.038' rx='70' ry='70' fill='%23dcdcdc'/%3E%3Cpath d='M218.543 249.999l-47.186 47.186c-8.987 8.988-8.987 22.47 0 31.457 8.988 8.988 22.47 8.988 31.457 0L250 281.456l15.728 15.729c17.976 17.976 17.976 46.063 0 64.038l-64.037 64.038c-17.976 17.975-46.063 17.975-64.038 0l-64.038-64.038c-17.975-17.975-17.975-46.062 0-64.038l64.038-64.037c17.975-17.976 46.062-17.976 64.038 0l16.852 16.851z' fill='%23fff'/%3E%3Cpath d='M281.457 249.999l47.186-47.186c8.988-8.987 8.988-22.469 0-31.457-8.987-8.987-22.469-8.987-31.457 0L250 218.542l-15.729-15.729c-17.975-17.975-17.975-46.062 0-64.037l64.038-64.038c17.975-17.975 46.062-17.975 64.038 0l64.037 64.038c17.977 17.975 17.977 46.062 0 64.037l-64.037 64.038c-17.976 17.976-46.063 17.976-64.038 0l-16.852-16.852z' fill='%2361a3e0'/%3E%3C/svg%3E");
112
+ }
113
+
114
+ .pio-action .pio-night {
115
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 500 500' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M186.744 40.493a15.34 15.34 0 0 1 9.956-.097 15.743 15.743 0 0 1 10.643 17.018l-.639 2.794-2.549 8.484a230.05 230.05 0 0 0 21.824 175.818c41.315 73.085 119.925 117.041 203.82 113.977l8.093-.491h2.649c11.217 1.139 18.309 12.601 14.32 23.148l-1.374 2.795-2.256 3.727-6.472 8.533a225.604 225.604 0 0 1-62.629 54.194c-107.795 63.019-245.655 25.599-307.89-83.57-62.235-109.12-25.257-248.695 82.49-311.715a219.638 219.638 0 0 1 17.755-9.319l9.022-4.07 3.286-1.226zm176.702 52.576a4.402 4.402 0 0 1 2.108 2.156l11.181 23.982c1.08 2.305 2.944 4.218 5.297 5.296l24.031 11.182c3.06 1.482 3.366 5.717.554 7.626-.176.12-.361.227-.554.32l-24.031 11.181a10.994 10.994 0 0 0-5.297 5.296l-11.181 24.031c-1.482 3.058-5.717 3.366-7.625.554a4.11 4.11 0 0 1-.32-.554l-11.23-24.031a10.998 10.998 0 0 0-5.297-5.296l-23.981-11.181c-3.06-1.482-3.367-5.717-.555-7.626.176-.12.362-.227.555-.32l24.029-11.182a10.993 10.993 0 0 0 5.249-5.296l11.23-24.031a4.412 4.412 0 0 1 5.837-2.107zm-62.825-73.812c.491.246.883.589 1.08 1.08l5.59 11.967a5.346 5.346 0 0 0 2.649 2.647l12.015 5.592c1.548.699 1.757 2.812.377 3.804-.12.084-.244.157-.377.218l-12.015 5.589a5.496 5.496 0 0 0-2.649 2.649l-5.59 11.966c-.778 1.512-2.9 1.611-3.819.182a2.694 2.694 0 0 1-.105-.182l-5.64-11.966a5.491 5.491 0 0 0-2.649-2.649l-11.966-5.64c-1.548-.699-1.757-2.814-.377-3.803.119-.085.244-.158.377-.218l11.966-5.589a5.498 5.498 0 0 0 2.649-2.65l5.591-11.965a2.205 2.205 0 0 1 2.942-1.08z' fill='%23FFCB3C'/%3E%3C/svg%3E");
116
+ }
117
+
118
+ .pio-container .pio-dialog {
119
+ top: -2em;
120
+ opacity: 0;
121
+ z-index: -1;
122
+ font-size: 0.8em;
123
+ min-width: 12em;
124
+ color: var(--ctp-text);
125
+ background: var(--ctp-base);
126
+ padding: 0.75em 1em;
127
+ border-radius: 1em;
128
+ visibility: hidden;
129
+ position: absolute;
130
+ word-break: break-all;
131
+ border: 1px solid var(--ctp-overlay0);
132
+ transition: opacity 0.3s, visibility 0.3s;
133
+ }
134
+
135
+ .pio-container .pio-dialog.active {
136
+ opacity: 1;
137
+ visibility: visible;
138
+ }
139
+
140
+ .pio-container.left .pio-dialog {
141
+ left: 1em;
142
+ }
143
+
144
+ .pio-container.right .pio-dialog {
145
+ right: 1em;
146
+ }
147
+
148
+ #pio {
149
+ height: 250px;
150
+ vertical-align: middle;
151
+ }
152
+
153
+ @media screen and (max-width: 768px) {
154
+ #pio {
155
+ width: 8em;
156
+ }
157
+
158
+ .pio-container {
159
+ pointer-events: none;
160
+ }
161
+ }
@@ -0,0 +1,296 @@
1
+ /* ----
2
+
3
+ # Pio Plugin
4
+ # By: Dreamer-Paul
5
+ # Modify: journey-ad
6
+ # Last Update: 2021.5.4
7
+
8
+ 一个支持更换 Live2D 模型的 Typecho 插件。
9
+
10
+ 本代码为奇趣保罗原创,并遵守 GPL 2.0 开源协议。欢迎访问我的博客:https://paugram.com
11
+
12
+ ---- */
13
+
14
+ var Paul_Pio = function (prop) {
15
+ var that = this;
16
+
17
+ var current = {
18
+ idol: 0,
19
+ menu: document.querySelector(".pio-container .pio-action"),
20
+ canvas: document.getElementById("pio"),
21
+ body: document.querySelector(".pio-container"),
22
+ root: document.location.protocol + '//' + document.location.hostname + '/'
23
+ };
24
+
25
+ /* - 方法 */
26
+ var modules = {
27
+ // 更换模型
28
+ idol: function () {
29
+ current.idol < (prop.model.length - 1) ? current.idol++ : current.idol = 0;
30
+ return current.idol;
31
+ },
32
+ // 创建内容
33
+ create: function (tag, prop) {
34
+ var e = document.createElement(tag);
35
+ if (prop.class) e.className = prop.class;
36
+ return e;
37
+ },
38
+ // 随机内容
39
+ rand: function (arr) {
40
+ return arr[Math.floor(Math.random() * arr.length + 1) - 1];
41
+ },
42
+ // 创建对话框方法
43
+ render: function (text) {
44
+ if (text.constructor === Array) {
45
+ dialog.innerHTML = modules.rand(text);
46
+ }
47
+ else if (text.constructor === String) {
48
+ dialog.innerHTML = text;
49
+ }
50
+ else {
51
+ dialog.innerHTML = "输入内容出现问题了 X_X";
52
+ }
53
+
54
+ dialog.classList.add("active");
55
+
56
+ clearTimeout(this.t);
57
+ this.t = setTimeout(function () {
58
+ dialog.classList.remove("active");
59
+ }, 3000);
60
+ },
61
+ // 移除方法
62
+ destroy: function () {
63
+ that.initHidden();
64
+ localStorage.setItem("posterGirl", 0);
65
+ },
66
+ // 是否为移动设备
67
+ isMobile: function () {
68
+ var ua = window.navigator.userAgent.toLowerCase();
69
+ ua = ua.indexOf("mobile") || ua.indexOf("android") || ua.indexOf("ios");
70
+
71
+ return window.innerWidth < 500 || ua !== -1;
72
+ }
73
+ };
74
+ this.modules = modules;
75
+ this.destroy = modules.destroy;
76
+
77
+ var elements = {
78
+ home: modules.create("span", { class: "pio-home" }),
79
+ skin: modules.create("span", { class: "pio-skin" }),
80
+ info: modules.create("span", { class: "pio-info" }),
81
+ night: modules.create("span", { class: "pio-night" }),
82
+ close: modules.create("span", { class: "pio-close" }),
83
+
84
+ show: modules.create("div", { class: "pio-show" })
85
+ };
86
+
87
+ var dialog = modules.create("div", { class: "pio-dialog" });
88
+ current.body.appendChild(dialog);
89
+ current.body.appendChild(elements.show);
90
+
91
+ /* - 提示操作 */
92
+ var action = {
93
+ // 欢迎
94
+ welcome: function () {
95
+ if (document.referrer !== "" && document.referrer.indexOf(current.root) === -1) {
96
+ var referrer = document.createElement('a');
97
+ referrer.href = document.referrer;
98
+ prop.content.referer ? modules.render(prop.content.referer.replace(/%t/, "“" + referrer.hostname + "”")) : modules.render("欢迎来自 “" + referrer.hostname + "” 的朋友!");
99
+ }
100
+ else if (prop.tips) {
101
+ var text, hour = new Date().getHours();
102
+
103
+ if (hour > 22 || hour <= 5) {
104
+ text = '你是夜猫子呀?这么晚还不睡觉,明天起的来嘛';
105
+ }
106
+ else if (hour > 5 && hour <= 8) {
107
+ text = '早上好!';
108
+ }
109
+ else if (hour > 8 && hour <= 11) {
110
+ text = '上午好!工作顺利嘛,不要久坐,多起来走动走动哦!';
111
+ }
112
+ else if (hour > 11 && hour <= 14) {
113
+ text = '中午了,工作了一个上午,现在是午餐时间!';
114
+ }
115
+ else if (hour > 14 && hour <= 17) {
116
+ text = '午后很容易犯困呢,今天的运动目标完成了吗?';
117
+ }
118
+ else if (hour > 17 && hour <= 19) {
119
+ text = '傍晚了!窗外夕阳的景色很美丽呢,最美不过夕阳红~';
120
+ }
121
+ else if (hour > 19 && hour <= 21) {
122
+ text = '晚上好,今天过得怎么样?';
123
+ }
124
+ else if (hour > 21 && hour <= 23) {
125
+ text = '已经这么晚了呀,早点休息吧,晚安~';
126
+ }
127
+ else {
128
+ text = "奇趣保罗说:这个是无法被触发的吧,哈哈";
129
+ }
130
+
131
+ modules.render(text);
132
+ }
133
+ else {
134
+ modules.render(prop.content.welcome || "欢迎来到本站!");
135
+ }
136
+ },
137
+ // 触摸
138
+ touch: function () {
139
+ current.canvas.onclick = function () {
140
+ modules.render(prop.content.touch || ["你在干什么?", "再摸我就报警了!", "HENTAI!", "不可以这样欺负我啦!"]);
141
+ };
142
+ },
143
+ // 右侧按钮
144
+ buttons: function () {
145
+ // 返回首页
146
+ elements.home.onclick = function () {
147
+ location.href = current.root;
148
+ };
149
+ elements.home.onmouseover = function () {
150
+ modules.render(prop.content.home || "点击这里回到首页!");
151
+ };
152
+ current.menu.appendChild(elements.home);
153
+
154
+ // 更换模型
155
+ elements.skin.onclick = function () {
156
+ that.model = loadlive2d("pio", prop.model[modules.idol()], model => {
157
+ prop.onModelLoad && prop.onModelLoad(model)
158
+ prop.content.skin && prop.content.skin[1] ? modules.render(prop.content.skin[1]) : modules.render("新衣服真漂亮~");
159
+ });
160
+ };
161
+ elements.skin.onmouseover = function () {
162
+ prop.content.skin && prop.content.skin[0] ? modules.render(prop.content.skin[0]) : modules.render("想看看我的新衣服吗?");
163
+ };
164
+ if (prop.model.length > 1) current.menu.appendChild(elements.skin);
165
+
166
+ // 关于我
167
+ elements.info.onclick = function () {
168
+ window.open(prop.content.link || "https://paugram.com/coding/add-poster-girl-with-plugin.html");
169
+ };
170
+ elements.info.onmouseover = function () {
171
+ modules.render("想了解更多关于我的信息吗?");
172
+ };
173
+ current.menu.appendChild(elements.info);
174
+
175
+ // 夜间模式
176
+ if (prop.night) {
177
+ elements.night.onclick = function () {
178
+ eval(prop.night);
179
+ };
180
+ elements.night.onmouseover = function () {
181
+ modules.render("夜间点击这里可以保护眼睛呢");
182
+ };
183
+ current.menu.appendChild(elements.night);
184
+ }
185
+
186
+ // 关闭看板娘
187
+ elements.close.onclick = function () {
188
+ modules.destroy();
189
+ };
190
+ elements.close.onmouseover = function () {
191
+ modules.render(prop.content.close || "QWQ 下次再见吧~");
192
+ };
193
+ current.menu.appendChild(elements.close);
194
+ },
195
+ custom: function () {
196
+ prop.content.custom.forEach(function (t) {
197
+ if (!t.type) t.type = "default";
198
+ var e = document.querySelectorAll(t.selector);
199
+
200
+ if (e.length) {
201
+ for (var j = 0; j < e.length; j++) {
202
+ if (t.type === "read") {
203
+ e[j].onmouseover = function () {
204
+ modules.render("想阅读 %t 吗?".replace(/%t/, "“" + this.innerText + "”"));
205
+ }
206
+ }
207
+ else if (t.type === "link") {
208
+ e[j].onmouseover = function () {
209
+ modules.render("想了解一下 %t 吗?".replace(/%t/, "“" + this.innerText + "”"));
210
+ }
211
+ }
212
+ else if (t.text) {
213
+ e[j].onmouseover = function () {
214
+ modules.render(t.text);
215
+ }
216
+ }
217
+ }
218
+ }
219
+ });
220
+ }
221
+ };
222
+
223
+ /* - 运行 */
224
+ var begin = {
225
+ static: function () {
226
+ current.body.classList.add("static");
227
+ },
228
+ fixed: function () {
229
+ action.touch(); action.buttons();
230
+ },
231
+ draggable: function () {
232
+ action.touch(); action.buttons();
233
+
234
+ var body = current.body;
235
+ body.onmousedown = function (downEvent) {
236
+ var location = {
237
+ x: downEvent.clientX - this.offsetLeft,
238
+ y: downEvent.clientY - this.offsetTop
239
+ };
240
+
241
+ function move(moveEvent) {
242
+ body.classList.add("active");
243
+ body.classList.remove("right");
244
+ body.style.left = (moveEvent.clientX - location.x) + 'px';
245
+ body.style.top = (moveEvent.clientY - location.y) + 'px';
246
+ body.style.bottom = "auto";
247
+ }
248
+
249
+ document.addEventListener("mousemove", move);
250
+ document.addEventListener("mouseup", function () {
251
+ body.classList.remove("active");
252
+ document.removeEventListener("mousemove", move);
253
+ });
254
+ };
255
+ }
256
+ };
257
+
258
+ // 运行
259
+ this.init = function (onlyText) {
260
+ if (!(prop.hidden && modules.isMobile())) {
261
+ if (!onlyText) {
262
+ action.welcome();
263
+ that.model = loadlive2d("pio", prop.model[0], model => {
264
+ prop.onModelLoad && prop.onModelLoad(model)
265
+ });
266
+ }
267
+
268
+ switch (prop.mode) {
269
+ case "static": begin.static(); break;
270
+ case "fixed": begin.fixed(); break;
271
+ case "draggable": begin.draggable(); break;
272
+ }
273
+
274
+ if (prop.content.custom) action.custom();
275
+ }
276
+ };
277
+
278
+ // 隐藏状态
279
+ this.initHidden = function () {
280
+ current.body.classList.add("hidden");
281
+ dialog.classList.remove("active");
282
+
283
+ elements.show.onclick = function () {
284
+ current.body.classList.remove("hidden");
285
+ localStorage.setItem("posterGirl", 1);
286
+ that.init();
287
+ }
288
+ }
289
+
290
+ localStorage.getItem("posterGirl") == 0 ? this.initHidden() : this.init();
291
+ };
292
+
293
+ // 请保留版权说明
294
+ if (window.console && window.console.log) {
295
+ console.log("%c Pio %c https://paugram.com ", "color: #fff; margin: 1em 0; padding: 5px 0; background: #673ab7;", "margin: 1em 0; padding: 5px 0; background: #efefef;");
296
+ }