别来无恙;



关于本文

操作之前建议整个HEXO目录备份一下,养成好习惯方便回退

Artalk 评论区表情包优化教程(放大显示)以及评论区链接跳转实现中间页安全跳转!

文章和站点渲染的链接跳转参考:给Hexo和留言添加跳转中间页 - 朽丘秋雨以及柳哥哥的插件安全跳转页面·插件版 | LiuShen’s Blog

需要注意的是,柳神的插件是和本教程冲突的,如果安装了,需要前往hexo配置文件关闭插件:

1
2
3
4
hexo_safego:
# 基本功能设置
general:
enable: false # 启用插件

支持柳神插件的是twikoo,给Hexo和留言添加跳转中间页 - 朽丘秋雨,本教程的Artalk中间页自带渲染整站点。


本文为 保姆级教程(也许吧),全程无复杂操作,只需按步骤复制、粘贴、替换,即可实现两个核心功能:

  • 评论区表情包默认放大显示,解决模糊、尺寸过小问题
  • 点击表情包弹出超大预览,预览尺寸清晰且不变形
  • 安全跳转中间页,更安全的跳转方式

适用场景:使用 hexo-theme-stellar 主题Artalk 评论已安装并正常使用(其他使用 Artalk 的主题可参考,核心步骤一致)。

一、前期准备

确认文件路径

本次修改的核心文件为 Artalk 评论样式文件,默认路径(hexo-theme-stellar 主题):

hexo-theme-stellar/source/css/_plugins/comments/artalk.styl

⚠️ 注意:

  • 若你的主题不是 stellar,找到主题源文件(非 hexo 根目录,是主题自身的源文件),在主题目录下搜索 artalk.styl 即可(通常在 css/plugins、css/_plugins 或 comments 相关文件夹内)。
  • 修改前建议备份原文件(复制一份 artalk.styl 并重命名为 artalk.styl.bak),避免修改出错无法恢复。
  • 有的主题有的hexo是在themes文件夹,有的是node_modules

详细步骤(表情图片预览)

步骤1:打开 Artalk 样式

  1. 找到你的主题源文件目录(以 stellar 为例):hexo-theme-stellar/source/css/_plugins/comments/theme/stellar/source/css/_plugins/comments/,总之是主题源文件。
  2. 找到 artalk.styl 文件,开始修改,理论上其他系统也可以用吧,找到对应的就行。

步骤2:替换样式源码

  1. 全选 artalk.styl 原文件中的所有内容,删除(或直接覆盖)。
  2. 复制下面的 完整优化后源码,粘贴到 artalk.styl 中,保存文件。

⚠️ 注意:以下源码是完整的 artalk.styl 内容,已包含表情包放大、预览样式,无需修改任何内容,直接复制粘贴即可。

基于stellar主题,如果你是stellar那就应该是没什么问题的,基于原文件改的,如果不是或者不同可以看下方另一个的样式,来具体自己自行修改。

artalk.styl

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
.cmt-body.artalk .artalk
margin-top: 1rem
.atk-editor-plug-preview
scrollbar(0, 0)
.atk-main-editor
border-radius: $border-card
.atk-header,.atk-editor-user-wrap
border-bottom: 1px dashed var(--block-border)
padding: 0.5rem 1rem
margin: 0
.atk-editor-user
padding: 0
.atk-editor-user-wrap:empty
visibility: hidden
padding: 0
>.atk-bottom
padding: 8px
.atk-state-btn
height: 2rem
border-radius: 100px
.atk-cancel
background: none
.atk-plug-btn
border-radius: 32px
height: 2rem
width 2rem
.atk-send-btn
height: 2rem
border-radius: 100px
min-width: 5em
trans1 all
&:hover
--at-color-main: var(--accent)
&:empty
display: none
.atk-list-comments-wrap>.atk-comment-wrap
border-radius: $border-card
background: var(--card)
box-shadow: 0 0 8px 0px rgba(0, 0, 0, 0.02)
>.atk-comment
padding: 1rem
&+.atk-comment-wrap
margin-top: .5rem
.atk-comment-children
border-top: 1px dashed var(--block-border)
margin-top: .5rem
.atk-avatar
padding: 0
.atk-avatar img
border-radius: 50%
width: 36px
height: 36px
.atk-comment-wrap>.atk-comment>.atk-main
margin-left: calc(36px + .5rem)
.atk-comment>.atk-main>.atk-header .atk-item.atk-nick
color: var(--text-p3)
font-weight: 500

.atk-badge-wrap span
border-radius: 100px
.atk-height-limit-btn
padding: 0.5rem 2rem
.atk-list-read-more
margin-top: 2.5rem
padding-bottom: 1.5rem
.atk-list-read-more-inner
padding: 1rem 2rem
border-radius: $border-button
height: 3rem
width: 12rem
margin: -1.5rem auto 0
&:hover
background: var(--card)
.atk-list-footer .atk-copyright
padding: 1rem
.atk-error-layer
background: none

.with-fancybox .atk-content img:not([atk-emoticon])
cursor: zoom-in

.cmt-body
.artalk, .atk-layer-wrap, .artalk.atk-dark-mode, .atk-layer-wrap.atk-dark-mode
--at-color-font: var(--text-p1)
--at-color-deep: var(--text-p2)
--at-color-sub: var(--text-p3)
--at-color-grey: var(--text-p4)
--at-color-meta: var(--text-p4)
if $site-background-image
--at-color-border: transparent
else
--at-color-border: var(--block-border)
--at-color-light: var(--link)
--at-color-bg: var(--card)
--at-color-bg-transl: var(--card)
--at-color-bg-grey: var(--block)
--at-color-bg-grey-transl: var(--block-border)
--at-color-bg-light: var(--theme)
--at-color-main: var(--theme)
--at-color-red: $c-red
--at-color-green: $c-green
--at-color-gradient: linear-gradient(180deg, transparent, var(--card), 50%, var(--card))


// fix style
.cmt-body.artalk
.atk-comment>.atk-main>.atk-body
overflow: visible
.artalk pre code, .atk-layer-wrap pre code
background: none
.atk-main-editor>.atk-textarea-wrap>.atk-textarea
background: none
padding: 1rem
margin: 0
border: none

.atk-loading
border-radius: $border-card
.atk-main-editor .atk-editor-user-wrap .atk-editor-user .atk-user-profile-btn
padding: 0
&:hover
background: none

.artalk>.atk-list>.atk-list-header
padding: .5rem 1rem
.atk-comment-count
display: flex
align-items: baseline
.artalk>.atk-list>.atk-list-header .atk-dropdown-wrap .atk-arrow-down-icon
height: 8px
.artalk>.atk-list>.atk-list-header .atk-text
display: block

.atk-notify-wrap .atk-notify
border-radius: $border-bar
margin: 8px

// emoticons
.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp
padding: .5rem
margin-bottom: 32px
.atk-editor-plug-emoticons>.atk-grp-wrap>.atk-grp[data-type=image]>.atk-item
width 3rem
height: 3rem
margin: 0
border-radius: 4px
padding: .5rem
>img
border-radius: 4px


// override
.md-text .cmt-body.artalk .artalk
--gap-p: 1rem
p
line-height: 1.5
font-size: $fs-15
>img
margin: var(--gap-p) auto
border-radius: $border-image-s
a>img
display: inline
img[atk-emoticon]
max-height: 3.5em
transform: scale(1)
margin: 0 6px
vertical-align: bottom
border-radius: 4px
image-rendering: crisp-edges
cursor: pointer
ul li, ol li
font-size: $fs-14
blockquote
position: relative
border-left: none
background: none
padding: 0.25rem 1rem
p
color: var(--text-p3)
.atk-content a
--at-color-main: var(--link)

#owo-big
display: none
position: absolute
z-index: 9999
pointer-events: none
width: 280px
height: 280px
padding: 16px
background: var(--liushen-card-secondbg, var(--card))
border: var(--liushen-card-border, 1px solid var(--block-border))
border-radius: 12px
box-shadow: var(--liushen-nav-shadow, 0 4px 15px rgba(0,0,0,0.15))
opacity: 0
transition: opacity 0.2s ease
img
width: 100%
height: 100%
object-fit: contain

具体的修改

修改表情包默认大小(原始代码)

1
2
3
4
5
6
img[atk-emoticon]
max-height: 1.5em
transform: scale(1.2)
margin: 0 4px
vertical-align: bottom
border-radius: 4px

修改表情包默认大小(优化后代码)

1
2
3
4
5
6
img[atk-emoticon]
max-height: 3.5em <-- 改大:1.5em → 3.5em
transform: scale(1) <-- 修复模糊:关闭缩放
margin: 0 6px <-- 微调间距
vertical-align: bottom
border-radius: 4px

末尾代码(新增以下全部代码)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#owo-big
display: none
position: absolute
z-index: 9999
pointer-events: none
width: 280px <-- 预览框大小
height: 280px
padding: 16px
background: var(--liushen-card-secondbg, var(--card))
border: var(--liushen-card-border, 1px solid var(--block-border))
border-radius: 12px
box-shadow: var(--liushen-nav-shadow, 0 4px 15px rgba(0,0,0,0.15))
opacity: 0
transition: opacity 0.2s ease

img
width: 100%
height: 100%
object-fit: contain

直接手动修改

  1. 找到 img[atk-emoticon]
  2. max-height 改成 3.5em
  3. 加上:
1
2
image-rendering: crisp-edges
cursor: pointer
  1. 在文件最底部粘贴:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#owo-big
display: none
position: absolute
z-index: 9999
pointer-events: none
width: 280px
height: 280px
padding: 16px
background: var(--liushen-card-secondbg, var(--card))
border: var(--liushen-card-border, 1px solid var(--block-border))
border-radius: 12px
box-shadow: var(--liushen-nav-shadow, 0 4px 15px rgba(0,0,0,0.15))
opacity: 0
transition: opacity 0.2s ease
img
width: 100%
height: 100%
object-fit: contain

步骤3:添加预览JS,CSS

(实现点击表情包弹出预览)

仅修改CSS无法实现“点击放大”功能,需添加一段简单JS,步骤如下:

  1. 打开 hexo 的自定义JS文件(这是我推荐丢的位置,方便找,也可以丢主题源文件夹):hexo根目录/source/js/ak.js(若没有 ak.js,新建一个即可,如果有同名自己换一个文件名)
  2. 打开 ak.js 文件,将下面的JS代码复制粘贴到文件末尾,保存。

感谢:评论区表情包放大 - 枋柚梓博客提供的文章帮助

ak.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/**
* 评论区表情包放大弹出层 完整实现
* 适配:Artalk/Valine/Waline/自定义评论系统
*/
class EmojiEnlarge {
constructor(options = {}) {
// 配置项(可自定义修改)
this.config = {
zoomRatio: 3, // 放大倍数
maxSize: 220, // 最大宽高
// 表情包选择器(适配你的评论系统,默认兼容Artalk)
emojiSelector: 'img[atk-emoticon],.atk-grp img,.atk-comment-wrap img',
...options
};

// 创建全局弹出层
this.popup = this.createPopup();
// 初始化监听
this.init();
}

// 1. 创建悬浮弹出层DOM
createPopup() {
const popup = document.createElement('div');
popup.className = 'emoji-popup';
popup.innerHTML = `
<img class="emoji-img" src="" alt="">
<div class="emoji-alt"></div>
`;
document.body.appendChild(popup);
return popup;
}

// 2. 计算图片放大尺寸(核心算法,沿用并优化你的代码)
calculateSize(img) {
const { zoomRatio, maxSize } = this.config;
const { clientWidth, clientHeight } = img;
const { naturalWidth, naturalHeight } = img;

// 基础放大尺寸
let tempW = clientWidth * zoomRatio;
let tempH = clientHeight * zoomRatio;

// 等比约束:不超过最大尺寸
const ratio = tempW / tempH;
if (tempW > maxSize) {
tempW = maxSize;
tempH = tempW / ratio;
}
if (tempH > maxSize) {
tempH = maxSize;
tempW = tempH * ratio;
}

return { width: tempW, height: tempH };
}

// 3. 鼠标悬浮触发放大
handleMouseOver(e) {
// 仅鼠标触发,排除触屏/触控笔
if (e.pointerType !== 'mouse') return;

const target = e.target;
// 判断是否为表情包图片
if (!target.matches(this.config.emojiSelector)) return;

const img = target;
if (!img.src) return;

// 计算尺寸
const { width, height } = this.calculateSize(img);
const popupImg = this.popup.querySelector('.emoji-img');
const popupAlt = this.popup.querySelector('.emoji-alt');

// 设置弹出层内容
popupImg.src = img.src;
popupImg.width = width;
popupImg.height = height;
popupAlt.textContent = img.alt || '图片窗预览';

// 设置位置(鼠标右下角,避免超出屏幕)
const gap = 10;
let left = e.clientX + gap;
let top = e.clientY + gap;

// 右边界检测
if (left + width > window.innerWidth) {
left = e.clientX - width - gap;
}
// 下边界检测
if (top + height + 30 > window.innerHeight) {
top = e.clientY - height - 30;
}

this.popup.style.left = `${left}px`;
this.popup.style.top = `${top}px`;
this.popup.style.display = 'block';
}

// 4. 鼠标离开隐藏弹出层
handleMouseOut() {
this.popup.style.display = 'none';
}

// 5. 绑定事件到元素
bindEvents(element) {
element.addEventListener('pointerover', this.handleMouseOver.bind(this));
element.addEventListener('pointerout', this.handleMouseOut.bind(this));
element.addEventListener('pointermove', this.handleMouseOver.bind(this)); // 跟随鼠标
}

// 6. 监听动态新增评论(MutationObserver)
observeComments() {
const observer = new MutationObserver((mutations) => {
mutations.forEach(mutation => {
mutation.addedNodes.forEach(node => {
if (node.nodeType === 1) {
// 给新增节点绑定事件
this.bindEvents(node);
// 递归处理子元素
if (node.querySelectorAll) {
node.querySelectorAll('*').forEach(el => this.bindEvents(el));
}
}
});
});
});

// 监听整个body(适配所有评论区容器)
observer.observe(document.body, {
childList: true,
subtree: true
});
}

// 初始化
init() {
// 给现有元素绑定事件
document.querySelectorAll('*').forEach(el => this.bindEvents(el));
// 监听动态新增元素
this.observeComments();
}
}

// ========== 初始化使用 ==========
// 默认配置(适配Artalk)
window.emojiEnlarge = new EmojiEnlarge();

// 自定义配置示例(适配其他评论系统)
// window.emojiEnlarge = new EmojiEnlarge({
// zoomRatio: 2.5,
// maxSize: 250,
// emojiSelector: 'img.emoji,.comment-content img'
// });

这则是ak-1.js

  1. 打开 hexo 的自定义JS文件(这是我推荐丢的位置,方便找,也可以丢主题源文件夹):hexo根目录/source/js/ak-1.js(若没有 ak-1.js,新建一个即可,如果有同名自己换一个文件名)
  2. 打开 ak-1.js 文件,将下面的JS代码复制粘贴到文件末尾,保存ak-1.js文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
document.addEventListener('click', function (e) {
const img = e.target.closest('img[atk-emoticon]')
if (!img) return
const owo = document.createElement('div')
owo.id = 'owo-big'
owo.innerHTML = `<img src="${img.src}">`
document.body.appendChild(owo)
owo.style.left = e.pageX + 10 + 'px'
owo.style.top = e.pageY + 10 + 'px'
owo.style.display = 'block'
setTimeout(() => owo.style.opacity = 1, 10)
setTimeout(() => {
owo.remove()
}, 1500)
})
  1. 打开 hexo 的自定义JS文件(这是我推荐丢的位置,方便找,也可以丢主题源文件夹):hexo根目录/source/css/ak.css (若没有 ak.css ,新建一个即可,如果有同名自己换一个文件名)
  2. 打开 ak.css 文件,将下面的css代码复制粘贴到文件末尾,保存。ak.css文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* 表情包放大弹出层 全局样式 */
.emoji-popup {
position: fixed;
z-index: 99999;
background: #fff;
border-radius: 6px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
padding: 4px;
display: none; /* 默认隐藏 */
pointer-events: none; /* 不阻挡鼠标事件 */
}
/* 弹出层内图片 */
.emoji-popup img {
display: block;
object-fit: contain;
border-radius: 4px;
}
/* 图片alt文字提示 */
.emoji-popup .emoji-alt {
font-size: 12px;
color: #666;
text-align: center;
margin-top: 4px;
white-space: nowrap;
}

随后引用:

主题配置文件,这里是stellar主题所以是_config.stellar.yml

1
2
3
head:
...
- <link rel="stylesheet" href="/css/ak.css"> #artalk评论预览
script:
...
- <script src="/js/ak.js"></script> #artalk评论预览
- <script src="/js/ak-1.js"></script> #artalk评论预览

步骤4:重启hexo

修改完成后,需重启hexo才能生效,执行以下命令(在hexo根目录执行):

1
2
3
4
5
6
# 清除缓存(可选,避免缓存导致不生效)
hexo clean
# 启动本地预览(查看效果)
hexo s
# 或构建
hexo g

打开本地博客localhost:4000,进入评论区,测试功能;或者推送hexo d看

若测试正常,执行 hexo d 部署到线上,线上即可生效。

详细步骤(Artalk跳转中间页)

创建js脚本

打开 hexo 的自定义JS文件(这是我推荐丢的位置,方便找,也可以丢主题源文件夹):hexo根目录/source/js/xx.js(若没有 xx.js,新建一个即可,如果有同名自己换一个文件名)

文件名字可随意xx.js,建议使用下边的推荐方案,更加完善完全,用这段虽然是方便了那么一步但是如果你用了柳神的中间页插件可能会出现冲突渲染hexo g后报错。

1
根据游客反馈出现致命BUD,请使用推荐方案

如果想加白名单,就使用以下方案:

推荐方案

js文件代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
(function() {
// ======================
// ✅ 白名单(在这里添加)
// ======================
window.DOMAIN_WHITELIST = [
"koxiuqiu.cn",
"blogscn.fun",
"www.foreverblog.cn",
];

var siteDomain = window.location.hostname;
var redirectPage = '/link.html';
var DOMAIN_WHITELIST = window.DOMAIN_WHITELIST || [];

function isExternalLink(url) {
if (!url || !/^https?:\/\//.test(url)) return false;
try {
var h = new URL(url).hostname.replace(/^www\./, '');
var s = siteDomain.replace(/^www\./, '');

// 白名单匹配
for (var i = 0; i < DOMAIN_WHITELIST.length; i++) {
var whiteDomain = DOMAIN_WHITELIST[i].replace(/^www\./, '');
if (h === whiteDomain || h.endsWith('.' + whiteDomain)) {
return false;
}
}

return h !== s;
} catch {
return false;
}
}

function fixLink(link) {
var href = link.href;
if (!href) return;
if (href.includes(redirectPage)) return;
if (isExternalLink(href)) {
link.href = redirectPage + '?url=' + encodeURIComponent(href);
}
}

function run() {
document.querySelectorAll('a[target="_blank"]').forEach(fixLink);
}
// 轮询强制覆盖,解决 Artalk 异步渲染问题
setTimeout(run, 300);
setTimeout(run, 800);
setInterval(run, 2000);

var observer = new MutationObserver(run);
observer.observe(document.body, {
childList: true,
subtree: true
});
})();

html中间页样式文件

注意:需要自己修改【】中的内容,【】分别是中间页图标和中间页页面logo(不需要要加【】符号),并且直接放在source可能不会构建,需要自己直接放在public文件目录直接推送运行,如果每次用hexo clean需要重新放一次,建议备份一个。

link.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
<link rel="icon" href="【中间页网站图标】" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow"/>
<title>😃页面加载中,请稍候...</title>
<style type="text/css">
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
body {
overflow: hidden;
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
transition: background 0.5s ease-in-out, color 0.3s ease;
animation: pageFadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
opacity: 0;
background: linear-gradient(135deg, #121212, #181818);
color: #E0E0E0;
}
.tip-modal, .copy-success-modal {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.6);
z-index: 1000;
transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.tip-modal.hidden, .copy-success-modal.hidden {
opacity: 0;
pointer-events: none;
}
.modal-content, .copy-success-content {
width: 90%;
max-width: 420px;
padding: 36px;
border-radius: 24px;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(40, 40, 40, 0.8);
box-shadow: 0 0 40px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
text-align: center;
transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
background: rgba(26, 26, 26, 0.88);
color: #E0E0E0;
}
.tip-modal.hidden .modal-content, .copy-success-modal.hidden .copy-success-content {
transform: translateY(30px) scale(0.95);
}
.modal-title, .copy-success-title {
font-size: 22px;
font-weight: 700;
margin-bottom: 16px;
letter-spacing: 0.8px;
color: inherit;
}
.modal-desc, .copy-success-desc {
font-size: 15px;
line-height: 1.7;
margin-bottom: 28px;
opacity: 0.95;
color: inherit;
}
.modal-buttons, .copy-success-buttons {
display: flex;
gap: 16px;
justify-content: center;
}
.modal-btn, .copy-success-btn {
padding: 12px 28px;
border-radius: 14px;
border: none;
cursor: pointer;
font-size: 15px;
font-weight: 600;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.modal-btn.understand, .copy-success-btn.know {
background-color: #3B82F6;
color: white;
}
.modal-btn.feedback {
background-color: #242424;
color: #E0E0E0;
}
.modal-btn::after, .copy-success-btn::after {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
transition: left 0.6s ease;
}
.modal-btn:hover::after, .copy-success-btn:hover::after {
left: 100%;
}
.modal-btn:hover, .copy-success-btn:hover {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}
.theme-switch {
position: relative;
width: 52px;
height: 52px;
border-radius: 50%;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(15px);
-webkit-backdrop-filter: blur(15px);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255,255,255,0.1);
transition: all 0.3s ease;
margin-top: 24px;
z-index: 99;
background: rgba(26, 26, 26, 0.9);
color: #3B82F6;
border-color: rgba(40, 40, 40, 0.5);
}
.theme-switch .tooltip {
position: absolute;
bottom: calc(100% + 12px);
left: 50%;
transform: translateX(-50%);
padding: 6px 12px;
background: #fff;
color: #333;
font-size: 12px;
font-weight: 500;
border-radius: 8px;
white-space: nowrap;
box-shadow: 0 4px 12px rgba(0,0,0,0.15);
opacity: 0;
pointer-events: none;
transition: opacity 0.2s ease, transform 0.2s ease;
transform: translateX(-50%) translateY(5px);
z-index: 100;
}
.theme-switch .tooltip::after {
content: '';
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
border-width: 4px;
border-style: solid;
border-color: #fff transparent transparent transparent;
}
.theme-switch:hover .tooltip {
opacity: 1;
transform: translateX(-50%) translateY(0);
}
.theme-switch svg {
width: 26px;
height: 26px;
fill: currentColor;
transition: all 0.3s ease;
}
.theme-switch:hover {
transform: scale(1.08);
box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
}
.container {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
margin: 0;
flex-direction: column;
padding: 20px;
}
.avatar-placeholder, .avatar {
width: 108px;
height: 108px;
border-radius: 50%;
margin-bottom: 18px;
display: block;
transition: all 0.5s ease;
}
.avatar {
display: none;
box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
border: 2px solid rgba(255,255,255,0.2);
}
.description {
font-size: 24px;
font-weight: 700;
margin-bottom: 8px;
letter-spacing: 0.8px;
color: #E0E0E0;
}
.subtitle {
font-size: 14px;
margin-bottom: 28px;
color: #C4C4C4;
opacity: 0.8;
letter-spacing: 0.5px;
}
.loading {
text-align: center;
padding: 40px;
border-radius: 28px;
animation: fadein 0.8s cubic-bezier(0.4, 0, 0.2, 1);
width: 100%;
max-width: 500px;
transition: all 0.4s ease-in-out;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(40, 40, 40, 0.5);
box-shadow: 0 0 50px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255,255,255,0.05);
position: relative;
overflow: hidden;
background: rgba(26, 26, 26, 0.75);
}
.loading::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: linear-gradient(45deg, rgba(59,130,246,0.03), rgba(14, 165, 233, 0.02));
pointer-events: none;
}
@keyframes fadein {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
@keyframes pageFadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.content {
margin-bottom: 28px;
width: 100%;
}
.url-text {
margin-bottom: 14px;
font-size: 16px;
letter-spacing: 0.8px;
text-align: left;
font-weight: 500;
color: #C0C0C0;
}
.jump-url {
position: relative;
font-size: 16px;
display: block;
margin-top: 5px;
margin-bottom: 32px;
padding: 18px 24px;
border-radius: 18px;
height: auto;
min-height: 56px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
display: flex;
align-items: center;
transition: all 0.3s ease;
border: 1px solid rgba(40, 40, 40, 0.5);
box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
background-color: rgba(26, 26, 26, 0.8);
color: #E0E0E0;
}
.copy-btn-container {
position: absolute;
display: flex;
align-items: center;
right: 12px;
top: 50%;
transform: translateY(-50%);
height: 80%;
width: 76px;
flex-direction: row-reverse;
border-radius: 14px;
background: linear-gradient(to left, rgba(26,26,26,0.8) 70%,transparent 100%);
}
.copy-btn {
width: 46px;
height: 46px;
border-radius: 14px;
border: 1px solid rgba(40, 40, 40, 0.5);
transition: all 0.3s ease-in-out;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
backdrop-filter: blur(12px);
position: relative;
overflow: hidden;
background-color: rgba(26, 26, 26, 0.95);
color: #C0C0C0;
}
.copy-btn::after {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
transition: left 0.5s ease;
}
.copy-btn:hover::after {
left: 100%;
}
.copy-btn-container svg {
width: 24px;
height: 24px;
fill: currentColor;
}
.copy-btn:hover {
transform: scale(1.08);
box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}
.countdown-text {
margin-top: 8px;
font-size: 14px;
line-height: 1.6;
opacity: 0.8;
letter-spacing: 0.5px;
color: #C0C0C0;
}
.button-container {
display: flex;
justify-content: center;
gap: 20px;
margin-top: 16px;
width: 100%;
}
.button {
padding: 0;
border-radius: 16px;
border: none;
cursor: pointer;
font-size: 16px;
font-weight: 600;
width: 100%;
max-width: 150px;
height: 50px;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
letter-spacing: 0.8px;
position: relative;
overflow: hidden;
}
.cancel-button {
background-color: #242424;
color: #E0E0E0;
}
.confirm-button {
background-color: #3B82F6;
color: #FFF;
}
.button::after {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
transition: left 0.6s ease;
}
.button:hover::after {
left: 100%;
}
.button:hover {
transform: translateY(-3px);
box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}
.button:active {
transform: translateY(-1px);
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}
body.light {
background: linear-gradient(135deg, #F8FAFF, #EFF6FF);
color: #1E293B;
}
body.light .loading {
background: rgba(255,255,255,0.75);
border-color: rgba(255, 255, 255, 0.2);
}
body.light .loading:hover {
box-shadow: 0 0 60px rgba(59,130,246,0.18);
}
body.light .description {
color: #1E293B;
}
body.light .url-text {
color: #2A3B4C;
}
body.light .countdown-text {
color: #64748B;
}
body.light .jump-url {
background-color: rgba(255, 255, 255, 0.9);
color: #1E293B;
border-color: rgba(255,255,255,0.15);
}
body.light .copy-btn-container {
background: linear-gradient(to left, rgba(255,255,255,0.9) 70%,transparent 100%);
}
body.light .copy-btn {
background-color: rgba(255, 255, 255, 0.95);
color: #475569;
border-color: rgba(164, 164, 164, 0.2);
}
body.light .cancel-button {
background-color: #EFF6FF;
color: #2563EB;
}
body.light .confirm-button {
background-color: #2563EB;
color: white;
}
body.light .theme-switch {
background: rgba(255,255,255,0.9);
color: #2563EB;
border: 1px solid rgba(37, 99, 235, 0.15);
}
body.light .modal-content, body.light .copy-success-content {
background: rgba(255,255,255,0.88);
color: #1E293B;
border-color: rgba(255, 255, 255, 0.25);
}
body.light .modal-btn.understand, body.light .copy-success-btn.know {
background-color: #2563EB;
color: white;
}
body.light .modal-btn.feedback {
background-color: #EFF6FF;
color: #2563EB;
}
body.dark {
background: linear-gradient(135deg, #121212, #181818);
color: #E0E0E0;
}
body.dark .loading {
background: rgba(26, 26, 26, 0.75);
border-color: rgba(40, 40, 40, 0.5);
}
body.dark .loading:hover {
box-shadow: 0 0 60px rgba(0, 0, 0, 0.35);
}
body.dark .description {
color: #E0E0E0;
}
body.dark .url-text, body.dark .countdown-text {
color: #C0C0C0;
}
body.dark .jump-url {
background-color: rgba(26, 26, 26, 0.8);
color: #E0E0E0;
border-color: rgba(40, 40, 40, 0.5);
}
body.dark .copy-btn-container {
background: linear-gradient(to left, rgba(26,26,26,0.8) 70%,transparent 100%);
}
body.dark .copy-btn {
background-color: rgba(26, 26, 26, 0.95);
color: #C0C0C0;
border-color: rgba(40, 40, 40, 0.5);
}
body.dark .cancel-button {
background-color: #242424;
color: #E0E0E0;
}
body.dark .confirm-button {
background-color: #3B82F6;
color: #FFF;
}
body.dark .theme-switch {
background: rgba(26, 26, 26, 0.9);
color: #3B82F6;
border-color: rgba(40, 40, 40, 0.5);
}
body.dark .modal-content, body.dark .copy-success-content {
background: rgba(26, 26, 26, 0.88);
color: #E0E0E0;
border-color: rgba(40, 40, 40, 0.8);
}
body.dark .modal-btn.understand, body.dark .copy-success-btn.know {
background-color: #3B82F6;
color: white;
}
body.dark .modal-btn.feedback {
background-color: #242424;
color: #E0E0E0;
}
@media (max-width: 480px) {
.loading {
padding: 32px 28px;
}
.description {
font-size: 22px;
}
.jump-url {
font-size: 14px;
padding: 16px 20px;
}
.button {
max-width: 130px;
height: 46px;
font-size: 15px;
}
.theme-switch {
width: 48px;
height: 48px;
margin-top: 20px;
}
.theme-switch svg {
width: 24px;
height: 24px;
}
.modal-content, .copy-success-content {
padding: 32px 28px;
}
.modal-title, .copy-success-title {
font-size: 20px;
}
.modal-btn, .copy-success-btn {
padding: 10px 24px;
}
}
</style>
</head>
<body class="dark">
<div class="tip-modal" id="tipModal">
<div class="modal-content">
<div class="modal-title">内容审查提示</div>
<div class="modal-desc">内容审查严格,需自行点击跳转至目标链接。如有非法、违规等问题链接,请点击下方反馈按钮提交处理。</div>
<div class="modal-buttons">
<button class="modal-btn understand" id="understandBtn">我知道了</button>
<button class="modal-btn feedback" id="feedbackBtn" onclick="window.location.href='https://feedback.koxiuqiu.cn'">问题反馈</button>
</div>
</div>
</div>
<div class="copy-success-modal hidden" id="copySuccessModal">
<div class="copy-success-content">
<div class="copy-success-title">复制成功</div>
<div class="copy-success-desc">链接已成功复制到剪贴板,可直接粘贴使用</div>
<div class="copy-success-buttons">
<button class="copy-success-btn know" id="knowBtn">了解</button>
</div>
</div>
</div>
<div class="container">
<div class="avatar-placeholder"></div>
<img src="" alt="头像" class="avatar">
<div class="description">朽丘秋雨</div>
<div class="subtitle">安全提示</div>
<div class="loading">
<div class="content">
<div class="url-text">您即将离开本站,跳转到:</div>
<div class="jump-url" id="jump-url">
<span id="jump-url-text"></span>
<div class="copy-btn-container">
<button class="copy-btn" onclick="copyToClipboard()">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<path d="M208 0L332.1 0c12.7 0 24.9 5.1 33.9 14.1l67.9 67.9c9 9 14.1 21.2 14.1 33.9L448 336c0 26.5-21.5 48-48 48l-192 0c-26.5 0-48-21.5-48-48l0-288c0-26.5 21.5-48 48-48zM48 128l80 0 0 64-64 0 0 256 192 0 0-32 64 0 0 48c0 26.5-21.5 48-48 48L48 512c-26.5 0-48-21.5-48-48L0 176c0-26.5 21.5-48 48-48z"/>
</svg>
</button>
</div>
</div>
</div>
<div class="countdown-text">💡请自行确认链接安全性,手动点击跳转</div>
<div class="button-container">
<button class="button cancel-button" onclick="closeWindow()">取消跳转</button>
<button class="button confirm-button" onclick="jump()">立即跳转</button>
</div>
</div>
<button class="theme-switch" id="themeSwitch">
<span class="tooltip">是否切换主题</span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" id="themeIcon">
<path d="M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32V64 448 480c0 17.7 14.3 32 32 32s32-14.3 32-32V416l64.3-64.3c43.1 25.7 95.8 32.8 141.7 19.4c61.4-18.3 103.9-75.1 103.9-139.1c0-97.2-78.8-176-176-176c-64 0-120.8 42.5-139.1 103.9c-13.4 45.9-6.3 98.6 19.4 141.7L64 416V32z"/>
</svg>
</button>
</div>
<script type="text/javascript">
function updateThemeIcon(theme) {
const icon = document.getElementById('themeIcon');
if (theme === 'dark') {
icon.innerHTML = '<path d="M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32V64 448 480c0 17.7 14.3 32 32 32s32-14.3 32-32V416l64.3-64.3c43.1 25.7 95.8 32.8 141.7 19.4c61.4-18.3 103.9-75.1 103.9-139.1c0-97.2-78.8-176-176-176c-64 0-120.8 42.5-139.1 103.9c-13.4 45.9-6.3 98.6 19.4 141.7L64 416V32z"/>';
} else {
icon.innerHTML = '<path d="M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9 165.7 509.2c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 1.8c4.5-3.1 10.2-3.7 15.2-1.6zM256 128a128 128 0 1 0 0 256 128 128 0 1 0 0-256z"/>';
}
}
function toggleTheme() {
const body = document.body;
let newTheme = 'light';
if (body.classList.contains('light')) {
newTheme = 'dark';
body.classList.remove('light');
body.classList.add('dark');
} else {
newTheme = 'light';
body.classList.remove('dark');
body.classList.add('light');
}
localStorage.setItem('theme', newTheme);
updateThemeIcon(newTheme);
window.dispatchEvent(new StorageEvent('storage', { key: 'theme', newValue: newTheme }));
}
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
return r ? decodeURIComponent(r[2]) : null;
}
function decodeSafeUrlParam(paramStr) {
try {
const base64 = paramStr.replace(/-/g, '+').replace(/_/g, '/');
const paddedBase64 = base64.padEnd(base64.length + (4 - base64.length % 4) % 4, '=');
const decodedBinary = atob(paddedBase64);
const decoded = decodeURIComponent(Array.from(decodedBinary).map(c =>
'%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
).join(''));
return decoded;
} catch (e) {
console.warn('URL解码失败,使用原始值:', e);
return paramStr;
}
}

// 👇 这里已经改成支持 ?u= 加密参数
let jump_url = GetQueryString('u') || GetQueryString('url');

if (jump_url) {
jump_url = decodeSafeUrlParam(jump_url);
}
const UrlReg = new RegExp('^((http|https|thunder|qqdl|ed2k|Flashget|qbrowser|ftp|rtsp|mms)://)', 'i');
if (!jump_url || !UrlReg.test(jump_url)) {
document.title = '参数错误,正在返回首页...';
jump_url = location.origin;
}
function jump() {
location.href = jump_url;
}
function closeWindow() {
function isWeChat() {
return /MicroMessenger/i.test(navigator.userAgent);
}
function isQQ() {
return /QQ/i.test(navigator.userAgent) && !/MicroMessenger/i.test(navigator.userAgent);
}
if (isWeChat()) {
if (typeof WeixinJSBridge !== "undefined") {
WeixinJSBridge.call('closeWindow');
} else {
document.addEventListener('WeixinJSBridgeReady', function () {
WeixinJSBridge.call('closeWindow');
}, { once: true });
}
} else if (isQQ()) {
try {
if (typeof mqq !== "undefined" && mqq.ui && mqq.ui.closeWebView) {
mqq.ui.closeWebView();
} else {
fallbackBack();
}
} catch (e) {
fallbackBack();
}
} else {
window.opener = null;
window.open('', '_self');
window.close();
}
}
function fallbackBack() {
if (window.history.length <= 1) {
window.location.href = location.origin;
} else {
window.history.back();
}
}
function showCopySuccess() {
const copyModal = document.getElementById('copySuccessModal');
copyModal.classList.remove('hidden');
}
function closeCopySuccessModal() {
const copyModal = document.getElementById('copySuccessModal');
copyModal.classList.add('hidden');
}
function copyToClipboard() {
const urlText = document.getElementById('jump-url-text').textContent;
navigator.clipboard.writeText(urlText).then(showCopySuccess)
.catch(() => {
const tempInput = document.createElement('input');
tempInput.value = urlText;
document.body.appendChild(tempInput);
tempInput.select();
document.execCommand('copy');
document.body.removeChild(tempInput);
showCopySuccess();
});
}
async function loadAvatar() {
const avatarImg = document.querySelector('.avatar');
const placeholder = document.querySelector('.avatar-placeholder');
const img = new Image();
img.src = '【你的中间页的logo图标】';
img.onload = function () {
avatarImg.src = img.src;
avatarImg.style.display = 'block';
placeholder.style.display = 'none';
}
img.onerror = function() {
placeholder.style.display = 'none';
}
}
function closeTipModal() {
const modal = document.getElementById('tipModal');
modal.classList.add('hidden');
}
function handleFeedback() {
window.open(location.origin + '/feedback', '_blank');
closeTipModal();
}
window.addEventListener('load', function () {
loadAvatar();
const jumpUrlElement = document.getElementById('jump-url-text');
jumpUrlElement.textContent = jump_url;
const countdownText = document.querySelector('.countdown-text');
countdownText.textContent = "💡请自行确认链接安全性,手动点击跳转";
document.getElementById('themeSwitch').addEventListener('click', toggleTheme);
document.getElementById('understandBtn').addEventListener('click', closeTipModal);
document.getElementById('feedbackBtn').addEventListener('click', handleFeedback);
document.getElementById('knowBtn').addEventListener('click', closeCopySuccessModal);
});
</script>
</body>
</html>

引用js脚本

1
2
3
script:
...
- <script src="/js/文件名.js"></script> #Artalk跳转中间页

四、常见问题解决

问题1:

修改后表情包没有变大、点击无预览

  • 排查1:确认 artalk.styl 文件路径正确,是否覆盖了原文件,保存是否成功。
  • 排查2:确认 custom.js 文件存在,JS代码是否完整复制(无遗漏、无多余字符)。
  • 排查3:执行 hexo clean 清除缓存,再重启hexo(缓存会导致修改不生效)。
  • 排查4:检查是否备份了原文件,是否误改了文件名(如 artalk.styl 改成了 artalk.styl.bak)。

问题2:

预览框太大/太小,想调整尺寸

修改 artalk.styl 文件中 #owo-big 部分的 widthheight 即可:

1
2
3
4
#owo-big
width: 280px // 预览框宽度,可改为320px350px
height: 280px // 预览框高度,与宽度一致即可
...(其他内容不变)

问题3:

预览框显示异常(无背景、无边框)

原因:你的主题没有 --liushen-card-secondbg 等自定义变量,已做兼容处理,若仍异常,修改 #owo-big 部分:

1
2
3
4
#owo-big
background: #fff // 改为纯色背景,如#fff(白色)、#f5f5f5(浅灰)
border: 1px solid #eee // 改为固定边框,避免主题变量缺失导致无边框
...(其他内容不变)

四、补充说明

  • 本教程仅修改 Artalk 评论区表情包样式,不影响 Artalk 其他功能(评论发送、回复、表情选择等)。
  • 若后续主题更新,可能会覆盖 artalk.styl 文件,更新后需重新执行本教程步骤(说个人话就是收藏一下)。
  • 所有修改均基于原生 Artalk 和 hexo-theme-stellar 主题,其他主题(如 next、butterfly)可参考,核心是找到 artalk.styl 文件并替换源码、添加JS。

五、总结

全程只需4步:备份原文件 → 替换 artalk.styl 源码 → 添加JS → 重启hexo,即可实现评论区表情包放大+点击预览功能,无需任何专业知识,新手也能轻松完成。

若遇到其他问题,可在评论区留言,会及时补充解决方案。