Skip to content

Commit

Permalink
feat(animate): avatar transition
Browse files Browse the repository at this point in the history
  • Loading branch information
wangyang0210 committed Apr 18, 2023
1 parent 0610c04 commit 68b6cd2
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/v2/Docs/Customization/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,32 @@ window.cnblogsConfig = {
}
```
### avatar - 头像旋转特效
?> 版本 >= v2.1.3
- 类型:`Object`
- 默认值:
```json
{
enable: false // 是否开启
}
```
```javascript
window.cnblogsConfig = {
animate: {
avatar: {
enable: false,
},
},
}
```
## code - 代码
### type - 代码渲染类型
Expand Down
3 changes: 3 additions & 0 deletions src/components/config/config.json5
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@
size: 8,
sizeF: 36
}
},
avatar: {
enable: false,
}
},

Expand Down
11 changes: 11 additions & 0 deletions src/components/sidebar/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -339,4 +339,15 @@ export default function main(_) {
}, 300);
});
})();

/**
* 头像旋转动效
*/
(() => {
if (_.__config.animate.avatar.enable) {
$('#menuBlogAvatar').addClass('img-rounded')
$('.author_avatar').addClass('img-rounded')
$('.feedbackAvatar').addClass('img-rounded')
}
})();
}
12 changes: 12 additions & 0 deletions src/style/simpleMemory.css
Original file line number Diff line number Diff line change
Expand Up @@ -2056,6 +2056,18 @@ div#tbCommentBodyPreview {
font-size: 14px
}

.img-rounded {
transition: transform 0.5s ease-out;
-webkit-transition: transform 0.6s ease-out;
-moz-transition: transform 0.5s ease-out;
-ms-transition: transform 0.5s ease-out;
-o-transition: transform 0.5s ease-out;
}

.img-rounded:hover {
transform: rotate(1turn);
}

#cnblogs_post_body img {
max-width: 700px;
margin: 10px 0
Expand Down

0 comments on commit 68b6cd2

Please sign in to comment.