diff --git a/config.template.toml b/config.template.toml index 31724c4..c1d2450 100644 --- a/config.template.toml +++ b/config.template.toml @@ -19,9 +19,9 @@ pygmentsUseClasses = true keywords = "blog, google analytics" rss = true lastmod = true - favicon = "/images/github.png" + favicon = "/images/github-mark.png" avatar = "/images/avatar.png" - headerIcon = "/images/GitHub-Mark-Light-32px.png" + headerIcon = "/images/github-mark-white.png" location = "China" userStatusEmoji = "😀" enableGitalk = true diff --git a/layouts/partials/user-profile.html b/layouts/partials/user-profile.html index cacb073..0d6d80c 100644 --- a/layouts/partials/user-profile.html +++ b/layouts/partials/user-profile.html @@ -118,7 +118,9 @@ {{ if .Site.Params.twitter}} - @twitter + + + {{ end }} @@ -204,12 +206,15 @@ window.onscroll = function (e) { var style = localStorage.getItem('data-color-mode'); iconElement = document.getElementById('github-icon'); +twitterIconElement = document.getElementById('twitter-icon'); if (style == 'light') { iconElement.setAttribute('fill', '#24292e'); + twitterIconElement.setAttribute("fill","black") } else { iconElement.removeAttribute('fill'); iconElement.setAttribute('class', 'octicon'); iconElement.setAttribute('color', '#f0f6fc'); + twitterIconElement.setAttribute("fill","white") } diff --git a/static/images/GitHub-Mark-Light-32px.png b/static/images/GitHub-Mark-Light-32px.png deleted file mode 100644 index 628da97..0000000 Binary files a/static/images/GitHub-Mark-Light-32px.png and /dev/null differ diff --git a/static/images/github-mark-white.png b/static/images/github-mark-white.png new file mode 100644 index 0000000..50b8175 Binary files /dev/null and b/static/images/github-mark-white.png differ diff --git a/static/images/github-mark.png b/static/images/github-mark.png new file mode 100644 index 0000000..6cb3b70 Binary files /dev/null and b/static/images/github-mark.png differ diff --git a/static/images/github.png b/static/images/github.png deleted file mode 100644 index 1c8da39..0000000 Binary files a/static/images/github.png and /dev/null differ diff --git a/static/images/twitter-black.png b/static/images/twitter-black.png new file mode 100644 index 0000000..2c2d7e8 Binary files /dev/null and b/static/images/twitter-black.png differ diff --git a/static/images/twitter-white.png b/static/images/twitter-white.png new file mode 100644 index 0000000..2609e58 Binary files /dev/null and b/static/images/twitter-white.png differ diff --git a/static/images/twitter.png b/static/images/twitter.png deleted file mode 100755 index af44ca5..0000000 Binary files a/static/images/twitter.png and /dev/null differ diff --git a/static/js/theme-mode.js b/static/js/theme-mode.js index 9ed8cc1..222ff25 100644 --- a/static/js/theme-mode.js +++ b/static/js/theme-mode.js @@ -4,6 +4,7 @@ function switchTheme() { if (currentStyle === 'light') { setTheme('dark'); + setIconTheme('dark') if (iconElement) { iconElement.setAttribute('class', 'octicon'); iconElement.setAttribute('color', '#f0f6fc'); @@ -11,6 +12,7 @@ function switchTheme() { } else { setTheme('light'); + setIconTheme('light') if (iconElement) { iconElement.removeAttribute('color'); iconElement.removeAttribute('class'); @@ -26,6 +28,15 @@ function setTheme(style) { localStorage.setItem('data-color-mode', style); } +function setIconTheme(theme) { + twitterIconElement = document.getElementById('twitter-icon'); + if (theme === 'light') { + twitterIconElement.setAttribute("fill", "black") + } else if (theme === 'dark') { + twitterIconElement.setAttribute("fill", "white") + } +} + function currentTheme() { const localStyle = localStorage.getItem('data-color-mode'); const systemStyle = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';