generated from Meekdai/Gmeek-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme.js
124 lines (105 loc) · 2.55 KB
/
theme.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
let style = document.createElement("style");
style.innerHTML = `
/* header布局*/
.blogTitle {
display: unset;
}
#header {
height: 340px;
}
#header h1 {
position: absolute;
left: 50%;
transform: translateX(-50%);
display: flex;
flex-direction: column;
align-items: center;
}
.title-right {
margin: unset;
margin-top: 295px;
margin-left: 50%;
transform: translateX(-50%);
}
.avatar {
width: 200px;
height: 200px;
}
#header h1 a {
margin-top: 30px;
font-family: fantasy;
margin-left: unset;
}
/* 背景图片 */
html {
background: url('https://pic.imgdb.cn/item/66bb4508d9c307b7e9f004ec.jpg') no-repeat center center fixed;
background-size: cover;
}
/* 主体布局 */
body {
margin: 30px auto;
padding: 20px;
font-size: 16px;
font-family: sans-serif;
line-height: 1.25;
background: rgba(255, 255, 255, 0.8); /* 白色背景,透明度80% */
border-radius: 10px; /* 圆角边框 */
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* 添加阴影 */
overflow: auto;
}
.SideNav {
background: rgba(255, 255, 255, 0.6); /* 白色背景,透明度60% */
border-radius: 10px; /* 圆角边框 */
min-width: unset;
}
.SideNav-item:hover {
background-color: #c3e4e3;
border-radius: 10px;
transform: scale(1.02);
box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}
.SideNav-item {
transition: 0.5s;
}
/* 分页条 */
.pagination a:hover, .pagination a:focus, .pagination span:hover, .pagination span:focus, .pagination em:hover, .pagination em:focus {
border-color: rebeccapurple;
}
/* 右上角按钮 */
div.title-right .btn {
display: inline-flex;
align-items: center;
width: auto;
height: 40px;
margin: 0 3px;
border-radius: 2em !important;
transition: 0.3s;
}
div.title-right .btn:hover {
width: auto;
border-radius: 2em !important;
background-color: #3cd2cd;
}
div.title-right .btn .btndescription {
display: none;
margin-left: 3px;
white-space: nowrap;
color: black;
font-weight: bold;
}
div.title-right .btn:hover .btndescription {
display: inline;
}
`;
document.head.appendChild(style);
//右上角按钮描述
let topright_buttons = document.querySelectorAll(".title-right a.btn");
topright_buttons.forEach(button => {
var title = button.getAttribute('title');
if (title) {
var btndescription = document.createElement('span');
btndescription.className = 'btndescription';
btndescription.textContent = title;
button.appendChild(btndescription);
}
});