Skip to content

Commit

Permalink
Update homepage subtitle and disable API integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mobeicanyue committed Jun 2, 2024
1 parent 1b8da8a commit fa18234
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _config.fluid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,12 @@ index:

# 为空则按 hexo config.subtitle 显示
# If empty, text based on `subtitle` in hexo config
text: "漠北残月的博客"
text: "<img src='https://pic1.zhimg.com/80/v2-422b9050d913581f87e3e62a902977cc_1440w.webp' class='avatar'/> <br/>「人间有味是清欢」"

# 通过 API 接口作为首页副标题的内容,必须返回的是 JSON 格式,如果请求失败则按 text 字段显示,该功能必须先开启 typing 打字机功能
# Subtitle of the homepage through the API, must be returned a JSON. If the request fails, it will be displayed in `text` value. This feature must first enable the typing animation
api:
enable: true
enable: false

# 请求地址
# Request url
Expand Down
1 change: 1 addition & 0 deletions scripts/inject.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hexo.extend.injector.register('head_begin', '<link rel="stylesheet" href="/css/avatar.css">', 'default');
46 changes: 46 additions & 0 deletions source/css/avatar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
from https://github.com/Musicminion/blog
*/

.avatar:hover {
transform: rotate(360deg);
/* 鼠标悬停时旋转 */
}

/* 针对宽屏设备(桌面显示器)的样式 */
@media screen and (min-width: 1024px) {
.avatar {
width: 210px;
height: 210px;
border-radius: 50%;
transition: transform 1s; /* 添加过渡效果 */
border: 5px solid #ddd; /* 添加边框 */
margin: 20px 0 75px 0;
}
}

/* 针对平板设备的样式 */
@media screen and (min-width: 768px) and (max-width: 1023px) {
.avatar {
width: 190px;
height: 190px;
border-radius: 50%;
transition: transform 1s; /* 添加过渡效果 */
border: 4px solid #ddd; /* 添加边框 */
/* 添加 bottom 的 margin 值,使其与下面的文字对齐 */
margin: 20px 0 80px 0;
}
}

/* 针对手机设备的样式 */
@media screen and (max-width: 767px) {
.avatar {
width: 160px;
height: 160px;
border-radius: 50%;
transition: transform 1s; /* 添加过渡效果 */
border: 3px solid #ddd; /* 添加边框 */
/* 添加 bottom 的 margin 值,使其与下面的文字对齐 */
margin: 60px 0 25px 0;
}
}

0 comments on commit fa18234

Please sign in to comment.