diff --git a/assets/css/_common/components/third-party/utterances.scss b/assets/css/_common/components/third-party/utterances.scss index d324d55..114be85 100644 --- a/assets/css/_common/components/third-party/utterances.scss +++ b/assets/css/_common/components/third-party/utterances.scss @@ -1,5 +1,6 @@ @if $utterances_enable { .utterances { - max-width: unset; + //max-width: unset; + min-height: 300px; } } diff --git a/assets/css/_common/scaffolding/comments.scss b/assets/css/_common/scaffolding/comments.scss index a0402cd..6c651b0 100644 --- a/assets/css/_common/scaffolding/comments.scss +++ b/assets/css/_common/scaffolding/comments.scss @@ -67,10 +67,6 @@ .first-comment { color: $first_comment_color; - - @if $two_comments_actived==$first_comment_name { - font-weight: bold; - } } .second-comment { @@ -82,6 +78,7 @@ } $switch_btn_bg_color: $first_comment_color; + $switch_btn_move_bc: $second_comment_color; .switch-btn { position: relative; @@ -100,6 +97,7 @@ @if $two_comments_actived==$second_comment_name { $switch_btn_bg_color: $second_comment_color; + $switch_btn_move_bc: $first_comment_color; } background-color: $switch_btn_bg_color; @@ -120,7 +118,11 @@ transition: .4s } - &.move:before { + &.move { + background-color: $switch_btn_move_bc; + } + + &.move:before { -webkit-transform: translateX(20px); -moz-transform: translateX(20px); -o-transform: translateX(20px); @@ -129,6 +131,7 @@ } } } + } } diff --git a/assets/js/next-boot.js b/assets/js/next-boot.js index 0c27ed1..b070bf1 100644 --- a/assets/js/next-boot.js +++ b/assets/js/next-boot.js @@ -50,6 +50,7 @@ NexT.boot.refresh = function() { NexT.utils.registerLangSelect();*/ NexT.utils.registerSidebarTOC(); NexT.utils.registerPostReward(); + NexT.utils.registerCommonSwitch(); NexT.utils.wrapTableWithBox(); NexT.utils.registerVideoIframe(); }; diff --git a/assets/js/utils.js b/assets/js/utils.js index 7c18011..435c783 100644 --- a/assets/js/utils.js +++ b/assets/js/utils.js @@ -243,6 +243,20 @@ NexT.utils = { }); }, + registerCommonSwitch: function() { + const button = document.querySelector('.comment-switch .switch-btn'); + if (!button) return; + const cwrap = document.querySelector('.comment-wrap'); + button.addEventListener('click', () => { + button.classList.toggle('move'); + const comms = document.querySelectorAll('.comment-wrap > div'); + let len = comms.length; + while(len--){ + cwrap.appendChild(comms[len]); + } + }); + }, + activateNavByIndex: function(index) { const target = document.querySelectorAll('.post-toc li a.nav-link')[index]; if (!target || target.classList.contains('active-current')) return; diff --git a/layouts/partials/_thirdparty/comment/utterances.html b/layouts/partials/_thirdparty/comment/utterances.html index 757bd02..571b0a5 100644 --- a/layouts/partials/_thirdparty/comment/utterances.html +++ b/layouts/partials/_thirdparty/comment/utterances.html @@ -1,5 +1,6 @@ {{- with .Site.Params.utterances }} - {{- end }} +{{- end }}