From 8a8cb14f22f67baa11b9b209470b453d09a1e306 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Thu, 24 Jun 2021 18:53:52 +0800 Subject: [PATCH] update avatar bg --- layout/_partial/sidebar/logo.ejs | 2 +- source/css/_layout/sidebar/sidebar.styl | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/layout/_partial/sidebar/logo.ejs b/layout/_partial/sidebar/logo.ejs index 523837c..d31e53c 100644 --- a/layout/_partial/sidebar/logo.ejs +++ b/layout/_partial/sidebar/logo.ejs @@ -2,7 +2,7 @@ <% if (md_text(theme.sidebar.logo.avatar)) { %> <% if (theme.style.animated_avatar.animate) { %> - +
<% } %>
diff --git a/source/css/_layout/sidebar/sidebar.styl b/source/css/_layout/sidebar/sidebar.styl index c0da4cf..ffd0868 100644 --- a/source/css/_layout/sidebar/sidebar.styl +++ b/source/css/_layout/sidebar/sidebar.styl @@ -26,6 +26,10 @@ border-radius: 50px overflow: hidden margin-right: 1rem + div.bg + width: 100% + height: 100% + background-size: cover img.avatar margin: 2px object-fit: cover @@ -33,7 +37,7 @@ height: "calc(100% - 2 * %s)" % @margin border-radius: @width if hexo-config('style.animated_avatar.animate') - img.bg + div.bg trans1: opacity position: absolute opacity: 0 !important @@ -44,13 +48,13 @@ to transform:rotate(360deg) if hexo-config('style.animated_avatar.animate') == 'always' - img.bg + div.bg opacity: 1 !important animation: spin infinite 1s animation-timing-function: linear if hexo-config('style.animated_avatar.animate') == 'auto' &:hover - img.bg + div.bg opacity: 1 !important animation: spin infinite 1s animation-timing-function: linear