Skip to content

Commit 8f6d940

Browse files
authored
🌈 style: 图片加载动画
1 parent c18a6ad commit 8f6d940

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/hexo-theme-async/scripts/filters/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
hexo.extend.filter.register('after_post_render', data => {
2-
let replaceText = ` data-tag='post-image'`;
2+
let replaceText = ` data-tag='post-image' onload='this.onload=null;this.style.opacity=1;'`;
33

44
// img lazyload
55
if (hexo.theme.config.lazyload && hexo.theme.config.lazyload.enable) {

packages/hexo-theme-async/source/css/_components/publication.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
[data-tag="post-image"] {
6060
cursor: zoom-in;
6161
transition: 0.2s;
62+
opacity: 0;
6263

6364
&:hover {
6465
filter: blur(0) brightness(0.75);

0 commit comments

Comments
 (0)