Heimdall美化

Heimdall美化

效果图


首先安装Heimdall,如果你没安装请看这篇文章.

没安装可以看这篇文章

注意: 本教程需要一点耐心和一定的电脑基础

在本地电脑创建 styles.css、javascript.js

复制以下代码到刚刚创建的styles.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
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
body {
font-family: var(--font-inter);
font-size: var(--base-size)!important;
font-weight: 500;
color: var(--neutral-02);
background-color: var(--background-color-01);
/*限制页面滚动*/
/*overflow: hidden;*/
}
.hero {
width: 100%;
position: relative;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
background-color: var(--hero-background-color-01);
background-image: linear-gradient(to bottom,var(--hero-background-color-01),var(--hero-background-color-02));
z-index: 1
}

.hero .matrix-rain,.hero .particles,.hero .snowfall {
position: absolute;
inset: 0;
z-index: 1
}

.hero .container {
min-height: 30rem;
padding: 6rem 1.5rem 4rem;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center
}

.hero .content {
width: 100%;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
z-index: 3;
gap: 1em
}

.hero .content .dracula-icon {
width: 11.25rem;
height: 11.25rem;
display: flex
}

.hero .content .dracula-icon img,.hero .content .dracula-icon svg {
width: 100%;
height: 100%;
object-fit: contain
}

.hero .content .title-wrapper {
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
text-align: center
}

.hero .content .title-wrapper .title {
line-height: 1
}

.hero .content .title-wrapper .title.t {
line-height: 1.8;
font-family: var(--font-inter);
font-size: var(--text-02);
color: var(--neutral-02)
}

.hero .content .cta-wrapper {
margin: 1.5rem 0 0
}

.hero .video-container {
position: relative;
display: flex;
align-items: center;
justify-content: center;
z-index: 3
}

.hero .video-container .video {
height: 18.75rem;
position: relative;
overflow: hidden;
display: flex;
border-radius: var(--radius-02);
box-shadow: var(--box-shadow-03);
-webkit-backdrop-filter: blur(.125rem);
backdrop-filter: blur(.125rem)
}

.hero .video-container .video iframe {
aspect-ratio: 16/9;
margin: 0;
padding: 0;
border: none
}

.hero .ppp {
width: 100%;
padding: 6rem 1.5rem 2rem;
position: relative;
background-color: var(--background-color-02);
background-image: url(/images/hero/circuit-board.svg);
background-position: 50%;
box-shadow: var(--box-shadow-03);
z-index: 3
}

.hero .ppp,.hero .ppp .wrapper {
display: flex;
align-items: center;
justify-content: center
}

.hero .ppp .wrapper {
max-width: 90rem;
flex-flow: row nowrap;
gap: 1.875rem
}

.hero .ppp .wrapper .flag {
width: 7.75rem;
height: 6rem;
padding: .25rem;
display: flex;
align-items: center;
justify-content: center;
position: relative;
border-radius: var(--radius-01);
background-color: var(--neutral-05)
}

.hero .ppp .wrapper .flag img {
width: 100%;
height: 100%;
border-radius: var(--radius-01);
object-fit: cover;
object-position: center
}

.hero .ppp .wrapper .message {
display: flex;
flex-direction: column;
line-height: 2
}

.hero .ppp .wrapper .message * {
margin: 0
}

.hero .ppp .wrapper .message .highlight {
color: var(--color)
}

.hero .castle {
width: 100%;
height: 100%;
position: absolute;
bottom: -.5rem;
background-image:url(svg.svg);
background-size: contain;
background-position: bottom;
background-repeat: no-repeat;
z-index: 2
}

.hero .tag-link {
padding-bottom: 4.5rem;
position: absolute;
transform: translate(-50%,-50%);
top: 100%;
left: 72%;
gap: .5em;
border-radius: var(--radius-01);
border: none;
color: var(--neutral-01);
background-color: var(--background-color-01);
z-index: 3
}
.hero.contribute {
background-color: var(--background-color-02);
background-image: none
}

.hero.contribute .content .title-wrapper .title.t {
color: var(--neutral-03)
}

.hero.shop .container {
justify-content: space-evenly;
gap: 1.5rem
}

.hero.shop .content,.hero.shop .video-container {
padding: 0 1.5rem;
justify-content: center
}

.hero.shop .content {
width: 40%;
align-items: flex-start
}

.hero.shop .content .title-wrapper {
align-items: flex-start;
text-align: left;
max-width: 80%
}

.hero.shop .content .title-wrapper .title.t {
line-height: 1.8
}

@media screen and (max-width: 64rem) {
.hero .ppp .wrapper {
flex-direction:column
}

.hero .castle {
width: 400%;
left: -242%
}

.hero.shop .container {
flex-direction: column;
gap: 2.625rem
}

.hero.shop .container .content,.hero.shop .container .video-container {
width: 100%;
padding: 0
}

.hero.shop .container .content .title-wrapper {
text-align: left
}

.hero.shop .container .content .cta-wrapper {
margin: .75rem 0 0
}

.hero.shop .container .video-container .video {
width: 100%;
height: auto
}

.hero.shop .container .video-container .video iframe {
width: 100%
}
}
@media(prefers-reduced-motion:no-preference) {
* {
scroll-behavior: smooth
}
}

* {
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale
}
@media screen and (max-width: 64rem) {
section#newsletter .newsletter {
padding:2.25rem 1.5rem 1.5rem
}

section#newsletter .newsletter .input-wrapper {
flex-direction: column
}

section#newsletter .newsletter .input-wrapper input {
max-width: 100%;
border-radius: var(--radius-01) var(--radius-01) 0 0
}

section#newsletter .newsletter .input-wrapper button {
width: 100%;
border-radius: 0 0 var(--radius-01) var(--radius-01)
}
}

:root {
--hue: 254;
--main-hue: 250;
--background-color-01: hsl(var(--hue),12%,6%);
--background-color-02: hsl(var(--hue),12%,12%);
--hero-background-color-01: hsl(var(--main-hue),24%,12%);
--hero-background-color-02: hsl(var(--main-hue),24%,30%);
}

@media screen and (max-width: 64rem) {
:root {
--max-width:100%
}
}

* {
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale
}

::-webkit-scrollbar {
width: 0rem
}

::-webkit-scrollbar-track {
margin: 1em 0;
border-radius: 1em;
background-color: transparent
}

::-webkit-scrollbar-thumb {
border-radius: 1.5rem;
border: .375rem solid transparent;
background-color: var(--neutral-04);
background-clip: padding-box;
-webkit-transition: background-color .16s ease;
transition: background-color .16s ease
}

::-webkit-scrollbar-thumb:hover {
background-color: var(--color)
}

::selection {
text-shadow: .0625rem .0625rem .125rem rgba(0,0,0,.6);
color: var(--neutral-01);
background-color: var(--purple)
}

@media(prefers-reduced-motion:no-preference) {
* {
scroll-behavior: smooth
}
}
.item {
background-color: var(--background-color-02) !important;
width: 280px;
height: 90px;
margin: 10px;
flex: 0 0 280px;
border-radius: 15px;
padding: 15px;
padding-right: 55px;
color: white;
overflow: hidden;
position: relative;
transition: all 0.35s ease-in-out;
display: flex;
align-items: center;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: .125rem solid var(--background-color-02);
outline: 1px solid transparent;
z-index: 99999;
background-image: none;
}

.item:hover {
background-color: var(--background-color-01) !important;
}

.item:after {
display: none;
}
/** 打开settings - 自定义 CSS,写入下面代码 **/
/*************导航栏隐藏*************/
@import url("https://fonts.googleapis.com/css?family=Raleway");

#app {
margin-top: -250px; /* 根据需要调整上移的距离 */
background-position: center;
background-image: none !important;
}
#app #sortable,
#app main {
padding: 25px;
}
#config-buttons {
display: flex; /* 使用 Flex 布局 */
align-items: center; /* 垂直居中 */
padding: 0 0px; /* 添加 padding 以增加标签之间的间距 */
height: 285px; /* 调整高度,可根据需要修改 */
position: fixed;
right: 0; /* 改变right属性为0,将其显示在右边 */
top: 0px; /* 新增top属性为0,将其显示在上边 */
transition: right 0.3s ease;
user-select: none;
border-top-left-radius: -5px;
border-bottom-left-radius: 10px;
box-shadow: rgba(255, 255, 255, 0.1) -1px 1px 1px 0, rgba(255, 255, 255, 0.1) 0 -1px 1px 0, rgba(0, 0, 0, 0.1) -1px 0 20px 5px;
background-color: rgba(40, 40, 40, 0.25);
backdrop-filter: saturate(180%) blur(10px);
}
/* 隐藏点击时的边框 */
#config-buttons:focus-within a:focus {
border: 0px solid hsla(0,0%,100%,.569);
outline: 0;
}
#config-buttons a {
user-select: none; /* 防止出现白色边框 */
background: none;
}
#config-buttons a svg {
transition: all 0.1s linear;
color: rgba(255, 255, 255, 0.5);
}
#config-buttons a:hover svg {
transform: scale(1.1);
color: rgba(255, 255, 255, 0.95);
}

.black {
color: white !important;
}
//卡片样式

.item:after {
display: none;
}
/* 统一颜色 */
.black {
color: #ffffff !important;
}
/* 给标题添加一个阴影 */
.item .title {
font-size: 18px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}
/* 卡片布局方式 */
#app main {
flex-direction: column;
}
@media screen and (min-width: 1150px) {
#app main, #app #sortable {
display: flex;
justify-content: center;
align-items: center;
flex: 1;
position: relative;
flex-wrap: wrap;
align-content: center;
list-style: none;
margin: 25px 80px;
z-index: 11;
}
}
.tooltip {
display: none;
}
#app .content .appheader {
display: none;
}
.svg-inline--fa.fa-w-14 {
color: transparent;
}
.sidenav {
z-index: 99999 !important;
}

复制以下代码到刚刚创建的javascript.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
        var context;
var arr = new Array();
var starCount = 800;

function init() {
var stars = document.getElementById("stars");
windowWidth = window.innerWidth;
stars.width = windowWidth;
stars.height = window.innerHeight;
context = stars.getContext("2d");
}

var Star = function () {
this.x = windowWidth * Math.random();
this.y = 5000 * Math.random();
this.text = ".";
this.color = "#fff";

this.getColor = function () {
var _r = Math.random();
if (_r < 0.5) {
this.color = "#333";
} else {
this.color = "#fff";
}
}

this.init = function () {
this.getColor();
}

this.draw = function () {
context.fillStyle = this.color;
context.fillText(this.text, this.x, this.y);
}
}

function drawMoon() {
var moon = new Image();
moon.src = "./images/moon.jpg"
context.drawImage(moon, -5, -10);
}

window.onload = function () {
init();

for (var i = 0; i < starCount; i++) {
var star = new Star();
star.init();
star.draw();
arr.push(star);
}

drawMoon();
playStars();
}

function playStars() {
for (var n = 0; n < starCount; n++) {
arr[n].getColor();
arr[n].draw();
}

setTimeout("playStars()", 100);
}


$('title').text('DTZSGHNR');
document.addEventListener('visibilitychange', function () {
if (document.visibilityState == 'hidden') {
normal_title = document.title;
document.title = '某女星性感写真照流出!告诉你们什么才叫真正的惹火身材!';
} else {
document.title = normal_title;
}
});

const icon = 'storage/backgrounds/favicon.ico';

$('link[rel="mask-icon"]')[0].href = icon;
$('link[rel="icon"]').each(function () {
$(this)[0].href = icon;
})
$('link[rel="apple-touch-icon"]').each(function () {
$(this)[0].href = icon;
})

document.addEventListener('dragstart', function (event) {
event.preventDefault();
});
var configButtons = document.getElementById('config-buttons');

document.addEventListener('mousemove', function (e) {
var mouseX = e.clientX;
var windowWidth = window.innerWidth;


if (mouseX < windowWidth - configButtons.clientWidth) {
configButtons.style.right = '-100px';
} else {

configButtons.style.right = '0';
}
});

把svg.svg、css、js文件保存之后上传到Heimdall目录

提醒: /volume1/docker/Heimdall/config/www/background 是我的目录,你要根据你自己的实际目录调整。

目录结构

目录结构

  • 没有这个目录的需要到Heimdall设置里面先自定义一次背景
  • svg.svg在文章最后下载

设置自定义背景

上面完成后打开Heimdall,找到设置里面的自定义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
//生成背景所需元素
// 获取<body>元素
var bodyElement = document.body;

// 要插入的 HTML 代码
var htmlCode = `
<div class="hero">
<div class="particles" aria-hidden="true">
<canvas id="stars" width="2924" height="960"></canvas>
</div>
<div class="container"></div>
<div class="castle"></div>
</div>
`;

// 在<body>元素的最前面插入 HTML 代码
bodyElement.insertAdjacentHTML('afterbegin', htmlCode);
// 创建<link>元素
var linkElement = document.createElement('link');
linkElement.rel = 'stylesheet';
linkElement.href = 'storage/backgrounds/styles.css';
linkElement.setAttribute('data-precedence', 'next');

// 创建<script>元素
var scriptElement = document.createElement('script');
scriptElement.src = 'storage/backgrounds/javascript.js';

// 获取<head>元素
var headElement = document.head;

// 在<head>元素的末尾插入<link>和<script>标签
headElement.appendChild(linkElement);
headElement.appendChild(scriptElement);
//动态设置星空画布宽度
var screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;

// 获取Canvas元素
var canvas = document.getElementById('stars');

// 将Canvas元素的宽度和高度设置为页面的宽度和高度
canvas.width = screenWidth;

本教程所提到文件 点我下载