修改根目录

1
node_modules\hexo-theme-butterfly\layout\post.pug

在底部添加你想要的弹窗内容:

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
extends includes/layout.pug

block content
#post
if top_img === false
include includes/header/post-info.pug

article#article-container.post-content!=page.content
include includes/post/post-copyright.pug
.tag_share
if (theme.post_meta.post.tags)
.post-meta__tag-list
each item, index in page.tags.data
a(href=url_for(item.path)).post-meta__tags #[=item.name]
include includes/third-party/share/index.pug

if theme.reward.enable && theme.reward.QR_code
!=partial('includes/post/reward', {}, {cache: true})

//- ad
if theme.ad && theme.ad.post
.ads-wrap!=theme.ad.post

if theme.post_pagination
include includes/pagination.pug
if theme.related_post && theme.related_post.enable
!= related_posts(page,site.posts)

if page.comments !== false && theme.comments && theme.comments.use
- var commentsJsLoad = true
!=partial('includes/third-party/comments/index', {}, {cache: true})

//- Modal overlay
.blur-background
.popup-window
.menu-bar
button.close-btn X
.content
.text 你个废物,因为你看不懂
a(href='https://trss.me/' target='_blank') TRSS.me
| ,害的我得给你写个图文教程,给你们搞教程还是很辛苦的好吧,打点钱意思一下呗!
.qr-code
img(src='https://tele.x406.cn/file/cd6dfb1fbc86ca02aee22.png', alt='二维码图片')
.images
img(src='https://tele.x406.cn/file/c1dcb16d5548953003dfe.png', alt='兔子图片')

继续,添加:\source\css\sweetalert.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
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
/* Modal overlay styles */
.blur-background {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 255, 0.2); /* 蓝色背景 */
backdrop-filter: blur(15px); /* 增强毛玻璃效果 */
display: flex;
justify-content: center;
align-items: center;
z-index: 1000;
visibility: hidden;
opacity: 0;
transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Modal active state */
.blur-background.active {
visibility: visible;
opacity: 1;
}

/* Popup window styles */
.popup-window {
position: relative;
width: 600px; /* 调整宽度 */
height: auto; /* 调整高度 */
padding: 30px; /* 增加内边距 */
background: rgba(255, 255, 255, 0.7); /* 增强半透明效果 */
border-radius: 20px;
box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column; /* 改为垂直布局 */
align-items: center;
}

/* Menu bar styles */
.popup-window .menu-bar {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 50px;
background: rgba(0, 0, 0, 0.5); /* 菜单栏背景色 */
border-top-left-radius: 20px;
border-top-right-radius: 20px;
display: flex;
justify-content: flex-end;
align-items: center;
}

/* Close button styles */
.popup-window .menu-bar .close-btn {
background: #ff4d4d;
color: #fff;
border: none;
border-radius: 50%;
width: 30px;
height: 30px;
font-size: 20px;
cursor: pointer;
margin-right: 20px;
}

/* Popup content styles */
.popup-window .content {
display: flex;
flex-direction: column; /* 改为垂直布局 */
align-items: center;
width: 100%;
margin-top: 50px; /* 增加顶部间距 */
}

/* Text styles */
.popup-window .content .text {
font-weight: bold;
font-size: 24px;
text-align: center;
max-width: 100%;
margin-bottom: 20px; /* 增加底部间距 */
}

/* QR code styles */
.popup-window .content .qr-code img {
max-height: 200px;
max-width: 200px;
cursor: pointer;
transition: transform 0.3s;
}

/* QR code hover effect */
.popup-window .content .qr-code img:hover {
transform: scale(2); /* 放大效果 */
}

/* Image styles */
.popup-window .content .images img {
max-width: 300px;
max-height: 150px;
margin: 10px 0;
}

继续,添加\source\js\sweetalert.js

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
document.addEventListener('DOMContentLoaded', function () {
const modal = document.querySelector('.blur-background');
const closeButton = document.querySelector('.close-btn');

// Show the modal if it's an article page
if (modal && document.querySelector('article.post-content')) {
modal.classList.add('active');
}

// Close the modal when the close button is clicked
if (closeButton) {
closeButton.addEventListener('click', function () {
modal.classList.remove('active');
});
}
});

继续,在配置文件中引路:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
inject:
head:
- <link rel="stylesheet" href="/css/custom.css" media="defer" onload="this.media='all'">
- <link rel="stylesheet" href="/css/universe.css">
- <link rel="stylesheet" href="/css/custom.css">
- <script src="/live2d-widget/autoload.js"></script>
- <link rel="stylesheet" href="/css/sweetalert.css">
bottom:
- <canvas id="universe"></canvas>
- <script defer src="/js/universe.js"></script>
- <script src="/js/sweetalert.js"></script>
#网易云歌单
- <div class="aplayer no-destroy" data-id="8837491939" data-server="netease" data-type="playlist" data-order="list" data-fixed="true" data-preload="auto" data-autoplay="true" data-mutex="true" data-position="fixed" data-fixed-position="rb"></div>

效果: